Skip to content

Commit e9b0dc5

Browse files
fix: add completion to server capabilities
1 parent 62131de commit e9b0dc5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mcp/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ type ServerCapabilities struct {
467467
Experimental map[string]any `json:"experimental,omitempty"`
468468
// Present if the server supports sending log messages to the client.
469469
Logging *struct{} `json:"logging,omitempty"`
470+
// Present if the server supports autocompletion for prompt and resource template arguments.
471+
Completion *struct{} `json:"completion,omitempty"`
470472
// Present if the server offers any prompt templates.
471473
Prompts *struct {
472474
// Whether this server supports notifications for changes to the prompt list.

server/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ func (s *MCPServer) handleInitialize(
589589
capabilities.Logging = &struct{}{}
590590
}
591591

592+
if s.capabilities.completions != nil && *s.capabilities.completions {
593+
capabilities.Completion = &struct{}{}
594+
}
595+
592596
result := mcp.InitializeResult{
593597
ProtocolVersion: s.protocolVersion(request.Params.ProtocolVersion),
594598
ServerInfo: mcp.Implementation{

0 commit comments

Comments
 (0)