Skip to content

Conversation

@jlowin
Copy link
Owner

@jlowin jlowin commented Jul 29, 2025

This PR adds meta parameter support to all FastMCP component types (tools, resources, templates, and prompts), allowing developers to attach custom metadata to their MCP components.

Changes

Before

# No component types supported meta parameter
@mcp.tool()
def my_tool(): pass

@mcp.resource("resource://data")
def get_data(): pass

@mcp.prompt()
def my_prompt(): pass

After

# All component types now support meta parameter
@mcp.tool(meta={"version": "1.0", "author": "test"})
def my_tool(): pass

@mcp.resource("resource://data", meta={"version": "2.0", "team": "data"})
def get_data(): pass

@mcp.resource("resource://{param}", meta={"version": "2.1", "template": "dynamic"}) 
def get_template(param: str): pass

@mcp.prompt(meta={"version": "1.5", "purpose": "analysis"})
def my_prompt(): pass

Implementation

  • Added meta parameter to all server decorator methods (@mcp.tool, @mcp.resource, @mcp.prompt)
  • Updated all base classes and factory methods to support the meta parameter
  • Meta data is properly passed through to MCP clients and can be used for versioning, authorship, or other application-specific purposes
  • Updated documentation with examples and parameter descriptions

@jlowin jlowin added the feature Major new functionality. Reserved for 2-4 significant PRs per release. Not for issues. label Jul 29, 2025
@github-actions github-actions bot added documentation Updates to docs, examples, or guides. Primary change is documentation-related. tests and removed feature Major new functionality. Reserved for 2-4 significant PRs per release. Not for issues. labels Jul 29, 2025
@jlowin jlowin changed the title Add meta parameter support to resources, templates, and prompts Add meta parameter support to tools, resources, templates, and prompts Jul 29, 2025
@jlowin jlowin changed the title Add meta parameter support to tools, resources, templates, and prompts Add meta parameter support to tools, resources, templates, and prompts decorators Jul 29, 2025
@jlowin jlowin merged commit 3fc2510 into main Jul 29, 2025
10 checks passed
@jlowin jlowin deleted the meta-decorator branch July 29, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates to docs, examples, or guides. Primary change is documentation-related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants