home / mcp / mcp2anp mcp server

MCP2ANP MCP Server

A MCP server that can convert the MCP protocol into the ANP protocol, enabling applications that support MCP to also support ANP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "agent-network-protocol-mcp2anp": {
      "url": "https://agent-connect.ai/mcp2anp/mcp",
      "headers": {
        "X_API_KEY": "YOUR_API_KEY",
        "ANP_DID_DOCUMENT_PATH": "/path/to/public-did-doc.json",
        "ANP_DID_PRIVATE_KEY_PATH": "/path/to/private-key.pem"
      }
    }
  }
}

MCP2ANP acts as a bridge between MCP clients and ANP, enabling MCP-enabled tools to be used as if they were local ANP utilities. This guide walks you through using the MCP2ANP server from remote endpoints or by running it locally, so you can leverage MCP-compatible interactions with ANP agents efficiently.

How to use

You can access MCP2ANP through a remote MCP endpoint or run a local server to connect MCP clients with ANP capabilities. The remote option is convenient for quick starts, while the local option gives you full control over the server environment and credentials. When you use the remote endpoint, your MCP client talks to the hosted MCP2ANP service over HTTP. When you run locally, you start a Python-based MCP2ANP server that your MCP clients can reach via localhost or your private network.

How to install

Prerequisites: ensure you have Python available on your system and a compatible shell environment. You will also use a specialized toolflow to manage MCP2ANP locally and securely.

Step 1: Install and set up locally (optional)

# Clone the project repository locally

git clone [email protected]:agent-network-protocol/mcp2anp.git
cd mcp2anp

# Set up a Python virtual environment using uvx tooling
 uv venv --python 3.11
 uv sync

Step 2: Run a local MCP2ANP server (stdio)

Choose one of the following commands to start the local server. The commands run the MCP2ANP server via the uv runtimes and the Python module.

uv run python -m mcp2anp.server

Step 3: Run with production-ready DID credentials (stdio)

For production deployments, configure your environment to point to your DID documents and private key. Then start the server with a higher log level to aid troubleshooting.

# Set DID document and private key paths
export ANP_DID_DOCUMENT_PATH="docs/did_public/public-did-doc.json"
export ANP_DID_PRIVATE_KEY_PATH="docs/did_public/public-private-key.pem"

# Start the server with informational logging
uv run python -m mcp2anp.server --log-level INFO

Step 4: Add the local server to Claude (optional)

If you use Claude, you can register a local MCP2ANP server and point it to your DID credentials through environment variables. This enables Claude to communicate with your local instance directly.

# Example integration using a repository path
MCP2ANP_DIR=/Users/yourname/mcp2anp

claude mcp add mcp2anp \
  --env ANP_DID_DOCUMENT_PATH=$MCP2ANP_DIR/docs/did_public/public-did-doc.json \
  --env ANP_DID_PRIVATE_KEY_PATH=$MCP2ANP_DIR/docs/did_public/public-private-key.pem \
  -- uv run --directory $MCP2ANP_DIR python -m mcp2anp.server

Step 5: Run the official demo

You can run the official demo script to see a full usage example, including listing tools, fetching descriptive docs, and invoking OpenRPC methods.

uv run python examples/mcp_client_demo.py

Available tools

fetchDoc

Fetches the agent description document describing available tools and capabilities from the ANP side.

invokeOpenRPC

Executes an OpenRPC method provided by the ANP agent and returns the result.

listTools

Lists all available tools exposed through the MCP2ANP bridge.