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

# FastMCP Local Server

> Serve weather tools from a minimal FastMCP stdio server.

````python server.py theme={null}
"""
`fastmcp` is required for this demo.

```bash
uv pip install fastmcp
```

Run this with `fastmcp run cookbook/91_tools/mcp/local_server/server.py`
"""

from fastmcp import FastMCP

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


mcp = FastMCP("weather_tools")


@mcp.tool()
def get_weather(city: str) -> str:
    return f"The weather in {city} is sunny"


@mcp.tool()
def get_temperature(city: str) -> str:
    return f"The temperature in {city} is 70 degrees"


# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    mcp.run(transport="stdio")
````

## Run the Example

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

**1. Install dependencies**

```bash theme={null}
uv pip install -U fastmcp
```

**2. Run the example**

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

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

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


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