> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Client

> Launch a local FastMCP server by command and connect an agent to it with MCPTools.

```python client.py theme={null}
"""
Client
=============================

Demonstrates client.
"""

import asyncio

from agno.agent import Agent
from agno.models.groq import Groq
from agno.tools.mcp import MCPTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


async def run_agent(message: str) -> None:
    # Initialize the MCP server
    async with (
        MCPTools(
            "fastmcp run cookbook/91_tools/mcp/local_server/server.py",  # Supply the command to run the MCP server
        ) as mcp_tools,
    ):
        agent = Agent(
            model=Groq(id="openai/gpt-oss-120b"),
            tools=[mcp_tools],
            markdown=True,
        )
        await agent.aprint_response(message, stream=True)


# Example usage
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(run_agent("What is the weather in San Francisco?"))
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U "agno[mcp]" groq
```

**2. Export your Groq API key**

```bash Mac/Linux theme={null}
export GROQ_API_KEY="your_groq_api_key_here"
```

```bash Windows theme={null}
$Env:GROQ_API_KEY="your_groq_api_key_here"
```

**3. Run the example**

Save the code above as `client.py`, then run:

```bash theme={null}
python client.py
```

Full source: [cookbook/91\_tools/mcp/local\_server/client.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/mcp/local_server/client.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.