Skip to content

Missing prompt-level _meta support in MCPServer.prompt() and Prompt model #3476

Description

@m3chanic

Initial Checks

Release line

2.x (current stable)

Description

Description

The 2026-07-28 specification defines the optional _meta field on the Prompt schema. While other decorators like @mcp.tool support meta and pass it down as _meta on serialization (e.g., in MCPServer.list_tools). The @mcp.prompt decorator and the high-level Prompt classes are missing support for meta.

Expected Behavior

Including meta on @mcp.prompt does not incur a type error and returns _meta for the prompt on list_prompts.

Example Code

from mcp.server.mcpserver import MCPServer

# ATTEMPTING TO USE METADATA ON PROMPTS
mcp = MCPServer("MetaTestServer")

# This currently raises a TypeError because meta is not a parameter in @mcp.prompt
@mcp.prompt(name="code_review",title="Code Review",
            description="Review code with specific metadata rules",
            meta={"strictness": "high"})
def review_code(code: str) -> str:
    return f"Review this: {code}"
   
# 2. EXPECTED BEHAVIOR
# If the decorator parameter was supported, list_prompts should return prompt with _meta:
# listed_prompts = await mcp.list_prompts()
# assert listed_prompts[0].meta == {"audience": "strictness": "high"}

Python & MCP Python SDK

- Python: 3.12+
- MCP Python SDK: 2.2.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions