Model Context Protocol (MCP) 1 · Python server
Expose a prompt template
Offer a reusable prompt that clients can show to users.
@mcp.prompt()
def review_code(code: str) -> str:
return f"Please review this code:\n\n{code}"
Official Model Context Protocol (MCP) 1 documentation
More python server commands
- Install the Python SDK
- Create a Python server with a tool
- Expose a resource
- Serve over HTTP
- Log without breaking stdio
- Test with the dev server
All python server commands · Model Context Protocol (MCP) 1 cheatsheet