Missing prompt-level _meta support in MCPServer.prompt() and Prompt model
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- api, backend-api-design
Rechercherichtung
Beginne bei MCPServer.prompt und dem übergeordneten Prompt-Modell und verfolge anschließend, wie list_prompts Prompt-Felder serialisiert. Bestätige, wie @mcp.tool meta akzeptiert und wie seine list-Operation _meta ausgibt; abgeschlossen ist es, wenn @mcp.prompt die Metadaten ohne einen TypeError akzeptiert und list_prompts sie als _meta zurückgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 24.3k
- Forks
- 4k
- Ø Merge
- 1 T. 19 Min.
- Gemergte PRs (30 T.)
- 29
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/python-sdk
-
v1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
modelcontextprotocol/python-sdk#3546 · 5 Kommentare ·
-
v1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
modelcontextprotocol/python-sdk#3545 · 1 Kommentar ·
-
v1 v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
modelcontextprotocol/python-sdk#3508 · 2 Kommentare ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
modelcontextprotocol/python-sdk#3504 ·
-
v1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
modelcontextprotocol/python-sdk#3492 · 1 Kommentar ·
Alle Issues in modelcontextprotocol/python-sdk
Ähnliche Issues
-
documentation help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
simonw/sqlite-utils#872 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100