Skip to main content
Version: 1.0.3

Model Context Protocol (MCP) and uAgents Integration

Model Context Protocol (MCP) is an open standard designed to enable AI models and agents to interact with external tools, APIs, and services in a consistent and standardized way. MCP abstracts the complexity of custom integrations by providing a schema-based interface for tool access, making it easier to extend the capabilities of AI agents with real-world data and services.

Integrating MCP with Fetch.ai's uAgents framework unlocks a powerful, modular, and extensible agent ecosystem. This integration enables agents to access real-world data, external APIs, and advanced tools in a standardized, discoverable, and collaborative manner. Below, you'll find an overview of MCP, the motivations and benefits of integrating it with uAgents, and the main integration patterns used in practice.

What is MCP?

  • Standardization: MCP defines a unified protocol for tool and service access, eliminating the need for custom code for each integration.
  • Dynamic Tool Discovery: Agents can dynamically discover and call tools at runtime, enabling flexible and extensible workflows.
  • Transport Methods: MCP supports various communication transports, such as stdio, SSE and even custom transports making it adaptable to different environments.
  • Type Safety: Tool schemas ensure that input and output data are validated and structured.

Why Integrate MCP with uAgents?

Motivation & Benefits

  • Standardized Access to External Capabilities: MCP provides a schema-based, open protocol for exposing tools and APIs to agents, eliminating the need for custom integration logic for each new service. uAgents are lightweight, autonomous agents with built-in identity, messaging, and wallet support, making them ideal for decentralized, composable agent networks.

  • Dynamic Discovery and Orchestration: By registering MCP-enabled agents on Agentverse, they become discoverable by the ASI:One LLM and other agents, enabling dynamic orchestration and tool selection based on user queries. This allows for seamless, real-time collaboration between users, LLMs, and specialized agents.

  • Plug-and-Play Extensibility: New capabilities (e.g., medical calculators, travel APIs, weather data, research databases) can be added simply by connecting new MCP servers—no need to rewrite agent logic. Agents can call each other's MCP-exposed tools, fostering a network of shared capabilities.

  • Ecosystem Growth and Modularity: As more MCP servers and tools are published (e.g., via Smithery.ai), the agent ecosystem grows richer and more versatile. Modular design means agents can be composed, reused, and extended for new domains and workflows.

Typical Use Cases

  • Connecting research agents to medical databases (e.g., PubMed, clinical trials)
  • Enabling travel assistants to access real-time listings (e.g., Airbnb)
  • Allowing productivity agents to interact with calendars, emails, or web search

Main Integration Approaches

Currently, there are two primary ways to integrate MCP with uAgents and make them discoverable and callable from ASI:One LLM via Agentverse:

1. LangGraph Agent with MCP Adapter

mcp-langgraph
  • How it works:

    • A LangGraph agent is created and uses the langchain_mcp_adapters to connect to one or more MCP servers, enabling tool access within the agent's workflow.
    • The LangGraph agent is then wrapped using the uagents_adapter, making it a uAgent that can be registered on Agentverse (AV).
    • Once registered, the agent becomes discoverable and callable by ASI:One LLM, allowing natural language queries to trigger MCP tool calls through the agent.
  • Use case:

    • Ideal for scenarios where you want to leverage LangGraph's workflow/stategraph capabilities and expose those as agentic services in the Fetch.ai ecosystem.

2. Remote MCP Server via uAgent Client (Smithery.ai)

mcp-Smithery
  • How it works:
    • A uAgent client is configured to connect directly to remote MCP servers, such as those hosted on Smithery.ai (e.g., PubMed, clinical trials, calculators, etc.).
    • The uAgent acts as a bridge, forwarding requests to the appropriate MCP server and returning results.
    • This uAgent is then registered on Agentverse, making its capabilities available to ASI:One LLM and other agents.
  • Use case:
    • Useful for quickly exposing existing remote MCP services to the agent ecosystem without custom agent logic.

3. Create MCP Server on Agentverse

FastMCP Server Adapter
  • How it works:

    • A FastMCP server is implemented in Python, exposing tools (functions) using the MCP protocol.
    • The MCPServerAdapter from the uagents-adapter package is used to wrap the FastMCP server as a uAgent.
    • The uAgent is then registered on Agentverse, making all MCP tools discoverable and callable by ASI:One LLM and other agents.
    • The adapter leverages ASI:One LLM for intelligent tool selection and natural language interaction.
  • Use case:

    • Ideal for developers who want to quickly deploy Python-based FastMCP Servers that expose tools or services (e.g., weather APIs, calculators, custom business logic) to the agent ecosystem with minimal integration effort.

For practical implementations and code examples of MCP integration with uAgents, please refer to the following local examples: