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

# Connect MCP tools

> Mount local Model Context Protocol servers into an outbound AIR worker.

The Python SDK can mount a local Model Context Protocol server and proxy its
tools through the normal AIR worker connection.

## Stdio server

```python theme={null}
import asyncio
import os

from air import Worker


async def main() -> None:
    worker = Worker(
        os.environ["AIR_BASE_URL"],
        os.environ["AIR_WORKER_KEY"],
        environment=os.getenv("AIR_WORKER_ENV", "staging"),
    )
    stop = asyncio.Event()
    try:
        names = await worker.mount_mcp(
            "stdio",
            command=["python", "my_mcp_server.py"],
            prefix="inventory",
        )
        print("registered", names)
        await worker.run(stop)
    finally:
        await worker.aclose()


asyncio.run(main())
```

## Local HTTP server

```python theme={null}
names = await worker.mount_mcp(
    "http",
    url="http://127.0.0.1:8765/mcp",
    prefix="internal",
    timeout=30,
)
```

Call `mount_mcp()` before `start()` or `run()` so mounted tools are included in
the registration manifest. AIR normalizes unsupported characters in MCP tool
names and adds deterministic suffixes when names collide.

Mounted tools use the same review flow as Python tools: inspect the manifest,
enable the tool, and add it to a new agent version.

<Warning>
  Treat an MCP server as executable infrastructure. Pin and review it, restrict
  its credentials, and expose only the capabilities your project needs.
</Warning>
