How to Register and Discover MCP Servers with ERC-8004
Learn how to register MCP servers on ERC-8004, integrate them with LangChain, and build trust through on-chain reputation. Complete tutorial for AI agent developers.
The Model Context Protocol (MCP) enables LLMs to communicate with external tools and data sources, but a critical question remains: how do you trust these tools? When MCP tools represent arbitrary code execution, developers need verifiable trust signals beyond "someone says it works."
ERC-8004 solves this by creating an on-chain registry where AI agents and MCP servers can be registered, discovered, and build reputation over time. Instead of blindly trusting tools, developers can rely on verifiable on-chain signals that reflect actual usage patterns and community feedback.
Building a Simple MCP Server
Getting started with MCP development is straightforward using FastMCP, a Python framework for rapidly building MCP servers. A basic echo server requires just 30 lines of code.
The implementation includes three key MCP components:
- Tools — functions that LLMs can call (like an echo function)
- Resources — data sources that agents can access
- Prompts — reusable prompt templates for common tasks
Once deployed to a service like fastmcp.cloud, the server exposes an HTTP endpoint that LLMs can query for available capabilities. The server responds with structured metadata about each tool, including input schemas and descriptions.
Integrating MCP Tools with LangChain
LangChain provides built-in MCP adapters that convert MCP tools into standard LangChain tools. This allows developers to integrate MCP servers into existing agent workflows without custom integration work.
The MultiServerMCPClient handles the protocol details:
- Tool Discovery — automatically fetches available tools from MCP endpoints
- Schema Conversion — transforms MCP tool schemas into LangChain-compatible formats
- Execution Handling — manages tool calls and response processing
When an LLM agent receives a user request, it can reason about which tools to use and execute them through the MCP protocol. The agent sees tool calls and responses in its conversation context, enabling multi-step reasoning.
The Trust Problem
MCP tools solve the "how" of tool integration, but not the "which" of tool selection. In a world where anyone can deploy MCP servers, how do agents and developers distinguish between reliable tools and potentially malicious ones?
Traditional approaches rely on centralized app stores or manual curation. ERC-8004 provides a decentralized alternative: a blockchain-based registry where tools can build public reputation through verifiable usage and feedback.
On-Chain Agent Discovery
The Agent0 SDK enables programmatic interaction with the ERC-8004 registry. Developers can search for registered agents and MCP servers based on specific criteria, including supported trust mechanisms and declared capabilities.
Search results include comprehensive metadata:
- Identity — agent name, description, owner addresses
- Capabilities — declared MCP tools, resources, and prompts
- Trust Signals — supported reputation mechanisms and feedback history
- Status — active/inactive state and last activity timestamps
Registering MCP Servers On-Chain
Registration involves creating an ERC-8004 identity that points to an IPFS-hosted registration file. This file contains the MCP endpoint URL and declared capabilities, creating a verifiable link between on-chain identity and off-chain service.
The registration process includes several configuration steps:
- Basic Metadata — name, description, and image for the MCP server
- Endpoint Configuration — MCP server URL and protocol version
- Trust Settings — supported reputation mechanisms
- Capability Declaration — tools, resources, and prompts offered by the server
Once registered, the MCP server receives a unique agent ID that can be used for discovery and reputation tracking. The registration file is stored on IPFS for decentralized access and immutability.
Retrieving Registered Services
Developers can fetch registered MCP servers using their agent ID, which returns a summary of capabilities and metadata. To get the actual MCP endpoint URL, they need to fetch the full registration JSON from IPFS using the token URI.
This two-step process separates frequently-accessed metadata (stored on-chain) from detailed configuration (stored off-chain), optimizing for both gas costs and flexibility.
Building Reputation Through Feedback
Feedback submission is the core mechanism for building agent reputation in ERC-8004. After interacting with an MCP server, users can submit on-chain feedback that includes numeric ratings, tags, and optional rich context.
Feedback components include:
- Numeric Score — typically 0-100 rating based on tool performance
- Tags — short labels categorizing the interaction ("learning", "production", etc.)
- Rich Context — detailed feedback stored off-chain with experience details
- Capability Focus — specific tools or resources being reviewed
Feedback is permissionless — anyone can submit reviews after using a tool. The on-chain registry acts as a neutral log, while reputation aggregators determine how to weight and interpret signals for trust scoring.
Why It Matters
ERC-8004 transforms MCP from a tool integration protocol into a trust-minimized discovery system. Developers can find tools based on verifiable reputation rather than marketing claims, while tool creators can build credibility through demonstrated reliability.
This creates a foundation for safer agent-to-agent composition, where autonomous systems can evaluate tool quality before integration. The combination of MCP for capability and ERC-8004 for trust enables a more robust AI agent ecosystem.