modelcontextprotocol / modelcontextprotocol/python-sdk
Missing prompt-level _meta support in MCPServer.prompt() and Prompt model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.3k
- Forks
- 4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 31
Description
Initial Checks
- I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1)
- I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at MCPServer.prompt and the high-level Prompt model, then trace how list_prompts serializes prompt fields. Confirm how @mcp.tool accepts meta and how its list operation emits _meta; done means @mcp.prompt accepts the metadata without a TypeError and list_prompts returns it as _meta.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100