Skip to content

Commit a67a2d7

Browse files
feat: add title field to MCP type schemas
Add optional title field to core MCP types: - Tool: For human-readable tool display names - Resource: For human-readable resource display names - ResourceTemplate: For human-readable template display names - Prompt: For human-readable prompt display names - Implementation: For human-readable implementation display names The title field provides a way to display user-friendly names in UIs while keeping programmatic names stable. All fields are optional to maintain backwards compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 029f434 commit a67a2d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mcp/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ class Implementation(BaseModel):
200200
"""Describes the name and version of an MCP implementation."""
201201

202202
name: str
203+
title: str | None = None
204+
"""A human-readable title for the implementation."""
203205
version: str
204206
model_config = ConfigDict(extra="allow")
205207

@@ -389,6 +391,8 @@ class Resource(BaseModel):
389391
"""The URI of this resource."""
390392
name: str
391393
"""A human-readable name for this resource."""
394+
title: str | None = None
395+
"""A human-readable title for this resource."""
392396
description: str | None = None
393397
"""A description of what this resource represents."""
394398
mimeType: str | None = None
@@ -419,6 +423,8 @@ class ResourceTemplate(BaseModel):
419423
"""
420424
name: str
421425
"""A human-readable name for the type of resource this template refers to."""
426+
title: str | None = None
427+
"""A human-readable title for the type of resource this template refers to."""
422428
description: str | None = None
423429
"""A human-readable description of what this template is for."""
424430
mimeType: str | None = None
@@ -606,6 +612,8 @@ class Prompt(BaseModel):
606612

607613
name: str
608614
"""The name of the prompt or prompt template."""
615+
title: str | None = None
616+
"""A human-readable title for the prompt."""
609617
description: str | None = None
610618
"""An optional description of what this prompt provides."""
611619
arguments: list[PromptArgument] | None = None
@@ -813,6 +821,8 @@ class Tool(BaseModel):
813821

814822
name: str
815823
"""The name of the tool."""
824+
title: str | None = None
825+
"""A human-readable title for the tool."""
816826
description: str | None = None
817827
"""A human-readable description of the tool."""
818828
inputSchema: dict[str, Any]

0 commit comments

Comments
 (0)