Skip to content

Commit 69b393f

Browse files
Merge pull request modelcontextprotocol#1568 from a-akimov/main
Docs: Update Python server code to reflect the sample
2 parents c14fce9 + a0cf19a commit 69b393f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/docs/develop/build-server.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,12 @@ Forecast: {period['detailedForecast']}
252252
Finally, let's initialize and run the server:
253253

254254
```python
255-
if __name__ == "__main__":
255+
def main():
256256
# Initialize and run the server
257257
mcp.run(transport='stdio')
258+
259+
if __name__ == "__main__":
260+
main()
258261
```
259262

260263
Your server is complete! Run `uv run weather.py` to start the MCP server, which will listen for messages from MCP hosts.

0 commit comments

Comments
 (0)