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

All python server commands · Model Context Protocol (MCP) 1 cheatsheet

Was this page helpful?