Skip to content

Commit ab3c097

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 <noreply@anthropic.com>
1 parent f3cd20c commit ab3c097

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
@@ -201,6 +201,8 @@ class Implementation(BaseModel):
201201
"""Describes the name and version of an MCP implementation."""
202202

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

@@ -382,6 +384,8 @@ class Resource(BaseModel):
382384
"""The URI of this resource."""
383385
name: str
384386
"""A human-readable name for this resource."""
387+
title: str | None = None
388+
"""A human-readable title for this resource."""
385389
description: str | None = None
386390
"""A description of what this resource represents."""
387391
mimeType: str | None = None
@@ -407,6 +411,8 @@ class ResourceTemplate(BaseModel):
407411
"""
408412
name: str
409413
"""A human-readable name for the type of resource this template refers to."""
414+
title: str | None = None
415+
"""A human-readable title for the type of resource this template refers to."""
410416
description: str | None = None
411417
"""A human-readable description of what this template is for."""
412418
mimeType: str | None = None
@@ -584,6 +590,8 @@ class Prompt(BaseModel):
584590

585591
name: str
586592
"""The name of the prompt or prompt template."""
593+
title: str | None = None
594+
"""A human-readable title for the prompt."""
587595
description: str | None = None
588596
"""An optional description of what this prompt provides."""
589597
arguments: list[PromptArgument] | None = None
@@ -766,6 +774,8 @@ class Tool(BaseModel):
766774

767775
name: str
768776
"""The name of the tool."""
777+
title: str | None = None
778+
"""A human-readable title for the tool."""
769779
description: str | None = None
770780
"""A human-readable description of the tool."""
771781
inputSchema: dict[str, Any]

0 commit comments

Comments
 (0)