> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.agents.mcp agent

<a id="camel.agents.mcp_agent" />

<a id="camel.agents.mcp_agent.MCPAgent" />

## MCPAgent

```python theme={"system"}
class MCPAgent(ChatAgent):
```

A specialized agent designed to interact with MCP registries.
The MCPAgent enhances a base ChatAgent by integrating MCP tools from
various registries for search capabilities.

**Parameters:**

* **system\_message** (Optional\[str]): The system message for the chat agent. (default: :str:`"You are an assistant with search capabilities using MCP tools."`)
* **model** (BaseModelBackend): The model backend to use for generating responses. (default: :obj:`ModelPlatformType.DEFAULT` with `ModelType.DEFAULT`)
* **registry\_configs** (List\[BaseMCPRegistryConfig]): List of registry configurations (default: :obj:`None`)
* **local\_config** (Optional\[Dict\[str, Any]]): The local configuration for the MCP agent. (default: :obj:`None`)
* **local\_config\_path** (Optional\[str]): The path to the local configuration file for the MCP agent. (default: :obj:`None`)
* **function\_calling\_available** (bool): Flag indicating whether the model is equipped with the function calling ability. (default: :obj:`True`) \*\*kwargs: Inherited from ChatAgent

<a id="camel.agents.mcp_agent.MCPAgent.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    system_message: Optional[Union[str, BaseMessage]] = 'You are an assistant with search capabilities using MCP tools.',
    model: Optional[BaseModelBackend] = None,
    registry_configs: Optional[Union[List[BaseMCPRegistryConfig], BaseMCPRegistryConfig]] = None,
    local_config: Optional[Dict[str, Any]] = None,
    local_config_path: Optional[str] = None,
    tools: Optional[List[Union[FunctionTool, Callable]]] = None,
    function_calling_available: bool = True,
    **kwargs
):
```

<a id="camel.agents.mcp_agent.MCPAgent._initialize_mcp_toolkit" />

### \_initialize\_mcp\_toolkit

```python theme={"system"}
def _initialize_mcp_toolkit(self):
```

Initialize the MCP toolkit from the provided configuration.

<a id="camel.agents.mcp_agent.MCPAgent.add_registry" />

### add\_registry

```python theme={"system"}
def add_registry(self, registry_config: BaseMCPRegistryConfig):
```

Add a new registry configuration to the agent.

**Parameters:**

* **registry\_config** (BaseMCPRegistryConfig): The registry configuration to add.

<a id="camel.agents.mcp_agent.MCPAgent.step" />

### step

```python theme={"system"}
def step(
    self,
    input_message: Union[BaseMessage, str],
    *args,
    **kwargs
):
```

Synchronous step function. Make sure MCP toolkit is connected
before proceeding.

**Parameters:**

* **input\_message** (Union\[BaseMessage, str]): The input message. \*args: Additional arguments. \*\*kwargs: Additional keyword arguments.

**Returns:**

ChatAgentResponse: The response from the agent.
