Merge pull request #104 from modelcontextprotocol/update-server-docs

docs: add server initialization instructions to quickstart guide
This commit is contained in:
David Soria Parra 2025-01-06 10:36:06 +00:00 • committed by GitHub
commit a50261cd09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,6 +220,16 @@ Forecast: {period['detailedForecast']}
return "\n---\n".join(forecasts) return "\n---\n".join(forecasts)
``` ```
### Running the server
Finally, let's initialize and run the server:
```python
if __name__ == "__main__":
# Initialize and run the server
mcp.run(transport='stdio')
```
Your server is complete! Run `uv run weather.py` to confirm that everything's working. Your server is complete! Run `uv run weather.py` to confirm that everything's working.
Let's now test your server from an existing MCP host, Claude for Desktop. Let's now test your server from an existing MCP host, Claude for Desktop.