Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tjdragon/MCP-4-DFNS

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFNS MCP Server

A robust Model Context Protocol (MCP) server integration for the DFNS Python SDK. This server allows AI agents (like Gemini or Claude) to interact securely with DFNS digital asset custody services.

🧠 What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI models to connect with external tools and data sources. Instead of writing custom integrations for Every AI model, MCP provides a universal interface.

In this project, the MCP server acts as a bridge:

  1. Gemini/Claude asks to see wallets.
  2. MCP Server translates this request into a DFNS API call.
  3. DFNS returns the wallet data.
  4. MCP Server passes the structured data back to the AI.
  5. AI explains the results to you in plain English.

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository.
  2. Initialize the environment:
    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt # Or install: mcp dfns-sdk google-genai python-dotenv pydantic
  3. Configure Environment Variables: Copy .env.example to .env and fill in your credentials.
    cp .env.example .env

🛠️ How it Works

Project Structure

  • mcp_server/main.py: The entry point that initializes the high-performance FastMCP server.
  • mcp_server/client.py: A secure wrapper that handles DFNS authentication and client initialization.
  • mcp_server/tools/: Contains domain-specific tool definitions (Wallets, Policies).
  • gemini_client.py: A native Python client demonstrating how to use Gemini with this server.

Supported Tools

  • Wallets: List, create, and get wallet details; list assets and transactions; transfer assets.
  • Policies: List and get security policies.

🔍 Testing

1. Local Testing (MCP Inspector)

Use the official MCP Inspector to verify tool connectivity without an AI agent:

npx -y @modelcontextprotocol/inspector ./venv/bin/python mcp_server/main.py

This launches a web interface at http://localhost:6274.

2. Real AI Test (Gemini)

Run the interactive chat script to talk to DFNS using natural language:

./venv/bin/python gemini_client.py

Example Prompts:

  • "What are my current DFNS wallets?"
  • "Can you list the assets inside wallet [ID]?"
  • "Show me my security policies."

🛡️ Security

  • Secrets: Sensitive keys are loaded from .env and never hardcoded.
  • Git: .env is excluded via .gitignore. An .env.example is provided for configuration templates.
  • MPC: DFNS uses Multi-Party Computation to ensure your private keys are never exposed in full.

📄 License

This project is licensed under the MIT License.

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.