> ## 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.utils.mcp

<a id="camel.utils.mcp" />

<a id="camel.utils.mcp._is_pydantic_serializable" />

## \_is\_pydantic\_serializable

```python theme={"system"}
def _is_pydantic_serializable(type_annotation: Any):
```

Check if a type annotation is Pydantic serializable.

**Parameters:**

* **type\_annotation**: The type annotation to check

**Returns:**

Tuple\[bool, str]: (is\_serializable, error\_message)

<a id="camel.utils.mcp._validate_function_types" />

## \_validate\_function\_types

```python theme={"system"}
def _validate_function_types(func: Callable[..., Any]):
```

Validate function parameter and return types are Pydantic serializable.

**Parameters:**

* **func** (Callable\[..., Any]): The function to validate.

**Returns:**

List\[str]: List of error messages for incompatible types.

<a id="camel.utils.mcp.MCPServer" />

## MCPServer

```python theme={"system"}
class MCPServer:
```

Decorator class for registering functions of a class as tools in an MCP
(Model Context Protocol) server.

This class is typically used to wrap a toolkit or service class and
automatically register specified methods (or methods derived from
`BaseToolkit`) with a FastMCP server.

**Parameters:**

* **function\_names** (Optional\[list\[str]]): A list of method names to expose via the MCP server. If not provided and the class is a subclass of `BaseToolkit`, method names will be inferred from the tools returned by `get_tools()`.
* **server\_name** (Optional\[str]): A name for the MCP server. If not provided, the class name of the decorated object is used.

<a id="camel.utils.mcp.MCPServer.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    function_names: Optional[List[str]] = None,
    server_name: Optional[str] = None
):
```

<a id="camel.utils.mcp.MCPServer.make_wrapper" />

### make\_wrapper

```python theme={"system"}
def make_wrapper(self, func: Callable[..., Any]):
```

Wraps a function (sync or async) to preserve its signature and
metadata.

This is used to ensure the MCP server can correctly call and introspect
the method.

**Parameters:**

* **func** (Callable\[..., Any]): The function to wrap.

**Returns:**

Callable\[..., Any]: The wrapped function, with preserved signature
and async support.

<a id="camel.utils.mcp.MCPServer.__call__" />

### **call**

```python theme={"system"}
def __call__(self, cls):
```

Decorates a class by injecting an MCP server instance and
registering specified methods.

**Parameters:**

* **cls** (type): The class being decorated.

**Returns:**

type: The modified class with MCP integration.
