Proposal to Add Completion Capability to MCP Specification #122
Replies: 1 comment
-
Even if this was implemented in the {
"name": "write_short_story",
"description": "Produces a short story in a specified genre, in the style of a particular author.",
"arguments": [
{
"name": "genre",
"description": "The story's genre (e.g., 'fantasy', 'science-fiction', 'romance', etc.)",
"required": false
},
{
"name": "author",
"description": "An author whose style you want to emulate (e.g., 'Tolkien', 'Lovecraft', or 'Jane Austen')",
"required": false
}
]
} Let's say the server supports completions for Maybe we could get away with always returning an empty list, but this would lead to lots of unnecessary requests. If we returned But this actually touches on a more general issue: The completion feature seems to be closely mirroring the LSP counterpart. The problem is that LSP servers are almost exclusively running locally. This won't be the case for MCP. The docs mention that implementations should handle rate limiting, but thinking about how this will play out in practice makes me wonder. Right now there is no MCP error code for this scenario, so the transport layers would need to bubble this up into the applications (which becomes messy). |
Beta Was this translation helpful? Give feedback.
-
Pre-submission Checklist
Your Idea
I've observed that the current Model Context Protocol (MCP) specification does not provide a mechanism for servers to indicate whether they support completions. As a result, when a client requests completions from a server that doesn't implement this feature, the server responds with a "Method not found" error (
-32601
).Current Behavior:
resources
,prompts
, andtools
during initialization.completions
.-32601
error.Short-Term Solution:
To address this issue, clients can implement error handling that track the
-32601
error. When this error is encountered, the client can disable further completion requests for the affected template or prompt, preventing repeated unsuccessful attempts.Long-Term Recommendation:
For a more robust and scalable solution, I propose incorporating completions into the capability negotiation process. This enhancement would allow clients and servers to agree on supported features upfront, eliminating the need for error-based detection.
Proposed Capability Addition:
Benefits:
Scope
Beta Was this translation helpful? Give feedback.
All reactions