github/github-mcp-server · info
unsupported ref type: %s
Error message
unsupported ref type: %s
What it means
CompleteRequest.Params.Ref.Type is neither ref/prompt nor ref/resource. The MCP spec defines exactly those two ref shapes for completion; any other string (typo, future ref type, custom value) lands in the default branch and is rejected.
Source
Thrown at pkg/github/server.go:206
return s
}
func CompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
return func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
if req == nil || req.Params == nil || req.Params.Ref == nil {
return nil, fmt.Errorf("missing required parameter: ref")
}
switch req.Params.Ref.Type {
case "ref/resource":
if strings.HasPrefix(req.Params.Ref.URI, "repo://") {
return RepositoryResourceCompletionHandler(getClient)(ctx, req)
}
return nil, fmt.Errorf("unsupported resource URI: %s", req.Params.Ref.URI)
case "ref/prompt":
return nil, nil
default:
return nil, fmt.Errorf("unsupported ref type: %s", req.Params.Ref.Type)
}
}
}
func MarshalledTextResult(v any) *mcp.CallToolResult {
data, err := json.Marshal(v)
if err != nil {
return utils.NewToolResultErrorFromErr("failed to marshal text result to json", err)
}
return utils.NewToolResultText(string(data))
}
View on GitHub (pinned to 0ea1f775a7)
Solutions
- Send only ref/prompt (with name) or ref/resource (with uri) refs
- Align client and server MCP protocol versions
- Handle the error client-side by skipping completion for that ref
Defensive patterns
Strategy: type-guard
Type guard
function isSupportedRefType(t string) boolean {
return t === "ref/prompt" || t === "ref/resource";
} Prevention
- Send only spec-defined ref types: ref/prompt, ref/resource
- Keep client and server MCP protocol versions aligned
- Add an exhaustiveness switch on ref type in client code so new types fail loudly in tests
When it happens
Trigger: Client sends ref/type=ref/tool or a custom string; newer MCP spec adds a ref type this server version does not know (version skew); handcrafted JSON requests.
Common situations: Client/server version drift after MCP spec additions; exploratory tooling probing the completion endpoint.
Related errors
- missing required parameter: ref
- App not connected
- failed to get repositories
- owner or repo not specified
- failed to get file tree
AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15).
Data as JSON: /api/errors/57ae627991d6eece.
Report an issue: GitHub.