> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.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/90_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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U fastmcp
    ```
  </Step>

  <Step title="Run the example">
    Save the code above as `server.py`, then run:

    ```bash theme={null}
    python server.py
    ```
  </Step>
</Steps>

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