This guide walks you through turning your CAMEL AI agent into an MCP client, letting your agent easily use tools from multiple MCP servers.

Quick Setup Steps

  1. Create a Config File: Tell CAMEL which MCP servers you want to connect to.
  2. Use MCPToolkit to Connect: Load your config file to connect to the servers.
  3. Enable Tools in CAMEL Agent: Pass the server tools to your CAMEL agent to use.

This guide walks you through turning your CAMEL AI agent into an MCP client, letting your agent easily use tools from multiple MCP servers.

Step-by-Step Setup

1

Step 1: Configure MCP Servers

Start by creating a config file that tells your CAMEL agent what MCP servers to connect to. You can define local or remote servers, each with a transport method.

{
  "mcpServers": {
    "time_server": {
      "command": "python",
      "args": ["time_server.py"],
      "transport": "stdio"
    }
  }
}
2

Step 2: Connect & Build the Agent

Use MCPToolkit to connect to the servers and pass the tools to your CAMEL agent.

import asyncio
from camel.toolkits.mcp_toolkit import MCPToolkit
from camel.agents import ChatAgent

async def main():
    async with MCPToolkit(config_path="config/time.json") as toolkit:
      agent = ChatAgent(model=model, tools=toolkit.get_tools())
      response = await agent.astep("What time is it now?")
      print(response.msgs[0].content)

asyncio.run(main())
3

Step 3: Add More Tools & Debug

Once connected, you can extend your setup with other servers from ACI.dev, Composio, or npx.

  • Use stdio for local testing, sse or streamable-http for cloud tools.
  • Secure your API keys using the env field in the config.
  • Use the MCP Inspector (npx @modelcontextprotocol/inspector) if you run into issues.

Try plugging in servers like GitHub, Notion, or ArXiv and see your CAMEL agent in action.

How It Works – System Diagram

camel_toolks_as_mcp_server

CAMEL Agent as an MCP Client

This diagram illustrates how CAMEL agents use MCPToolkit to seamlessly connect with MCP servers. Servers provide external tools from platforms like GitHub, Gmail, Notion, and more.

Advanced: Register with MCP Hubs & Registries

Connect your agent to an MCP registry

Want your MCP agent discoverable by thousands of clients?
Register it with a hub like ACI.dev or similar.

Register with ACI Registry
from camel.agents import MCPAgent
from camel.types import ACIRegistryConfig, ModelFactory, ModelPlatformType, ModelType
import os

aci_config = ACIRegistryConfig(
    api_key=os.getenv("ACI_API_KEY"),
    linked_account_owner_id=os.getenv("ACI_LINKED_ACCOUNT_OWNER_ID"),
)
model = ModelFactory.create(
    model_platform=ModelPlatformType.OPENAI,
    model_type=ModelType.GPT_4O,
)

agent = MCPAgent(
    model=model,
    registry_configs=[aci_config],
)

Your agent is now connected to the ACI.dev registry and visible in the ecosystem.

Discover MCP Servers Easily with PulseMCP

Finding MCP servers is now a breeze with PulseMCP integration.
You don’t have to guess which MCP servers are available, just search, browse, and connect.

Discover MCP Servers Instantly

PulseMCP acts as a living directory of the entire MCP ecosystem.
CAMEL toolkits can plug directly into PulseMCP, letting you browse and connect to thousands of servers, all kept up to date in real time.

You can visit PulseMCP.com to browse all available MCP servers—everything from file systems and search to specialized APIs.

If you prefer to search programmatically inside your CAMEL code, just use:

from camel.toolkits.mcp import PulseMCPSearchToolkitsearch_toolkit = PulseMCPSearchToolkit()
results = search_toolkit.search_mcp_servers(query=“Slack”, top_k=1)
print(results)

PulseMCP does the heavy lifting of finding, categorizing, and keeping MCP servers fresh—your agents just connect and go.

Minimal agent without function-calling

Don’t need advanced tool-calling?
See this example for a super-lightweight setup.

Using Transport Methods

  • stdio: Ideal for local servers. Fast and easy.
  • sse: Great for cloud-hosted servers like ACI.dev.
  • streamable-http: Recommended for modern cloud integrations.

Tips to Keep in Mind

  • For easiest troubleshooting, try with a simple local stdio server first; once you’re comfortable, you can connect to cloud servers using sse or streamable-http.
  • Store your API keys securely in the config file, never in code.
  • Use the MCP Inspector tool (npx @modelcontextprotocol/inspector) for debugging.

Give It a Go

Try setting up a config file for an MCP server (like GitHub or Notion) and see your CAMEL agent use the new tools right away!