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

# Weather MCP Example

> Discover and govern the official Python Weather MCP server.

<Card title="modelcontextprotocol/quickstart-resources" icon="github" iconType="brands" href="https://github.com/modelcontextprotocol/quickstart-resources/tree/main/weather-server-python" horizontal cta="Open repository">
  Official Python Weather MCP server using stdio and the US National Weather Service API.
</Card>

The server exposes:

```text theme={null}
get_alerts(state)
get_forecast(latitude, longitude)
```

## 1. Clone and prepare the server

```bash theme={null}
git clone https://github.com/modelcontextprotocol/quickstart-resources.git
cd quickstart-resources/weather-server-python

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "mcp[cli]>=1.2.0" "httpx>=0.28.1"
export WEATHER_MCP_DIR="$PWD"
```

The official example is intentionally small. Keep it local unless you add authentication, request limits, timeouts, and log redaction before exposing it over a network.

## 2. Preview Discovery

```bash theme={null}
gforge discover mcp weather-mcp \
  --stdio \
  --command "uv --directory '$WEATHER_MCP_DIR' run weather.py" \
  --preview \
  --json
```

Confirm that the preview lists both tools and does not include local environment secret values. Preview reads definitions; it does not call either weather tool.

## 3. Upload the inventory

```bash theme={null}
gforge discover mcp weather-mcp \
  --stdio \
  --command "uv --directory '$WEATHER_MCP_DIR' run weather.py" \
  --upload \
  --debug
```

Open **MCPs → weather-mcp** and confirm the two schemas.

> **Screenshot placeholder**\
> Add `/images/examples/weather-mcp-inventory.png` showing the provider, last Discovery status, and both tools.

## 4. Create Gateway rules

A useful first configuration is:

| Capability     | Action  |
| -------------- | ------- |
| `get_alerts`   | Observe |
| `get_forecast` | Review  |

## 5. Test the governed server

```bash theme={null}
gforge mcp inspector weather-mcp \
  --gateway weather-gateway \
  --command "uv --directory '$WEATHER_MCP_DIR' run weather.py"
```

In MCP Inspector:

1. call `get_alerts` with `state: NY` and confirm it runs under Observe;
2. call `get_forecast` with `latitude: 38.8977` and `longitude: -77.0365`;
3. open **Operator Tasks** in GroundForge;
4. approve or reject the forecast request.

The reviewed call must not run before approval.

## 6. Review the records

Check the Gateway decision, whether the tool executed, the reviewed input, and any later Drift after changing a tool schema.

Continue with [Discovery](/concepts/discovery), [Observations](/concepts/observations), and [Drifts](/concepts/drifts), [Gateway Rules](/governance/gateways), or [CLI MCP Workflows](/cli/mcp).


## Related topics

- [Examples](/examples/index.md)
- [MCP Providers](/concepts/mcp-providers.md)
- [Agents](/concepts/agents.md)
