-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
cliIssues and PRs specific to cli modeIssues and PRs specific to cli modeenhancementNew feature requestNew feature requestv2
Description
Problem
When using npx @modelcontextprotocol/inspector --cli --method tools/list, the inspector silently accepts invalid JSON Schema constructs that MCP clients like Claude Code reject. This makes debugging MCP server issues extremely difficult.
Example: Invalid schema accepted by inspector but rejected by Claude Code
The Go SDK's jsonschema package generates true for interface{} types:
{
"name": "info",
"outputSchema": {
"type": "object",
"properties": {
"data": true, // Invalid - should be a type definition
"topic": { "type": "string" }
}
}
}The inspector's tools/list returns this without any warning, but Claude Code rejects it with:
[ERROR] MCP server "my-server" Failed to fetch tools: [
{
"code": "custom",
"path": ["tools", 7, "outputSchema", "properties", "data"],
"message": "Invalid input"
}
]
Other problematic patterns not caught:
"type": ["null", "boolean"]- nullable type syntax- Bare
truefor any-type fields (from Go'sinterface{}) - Missing required
typefields
Proposed Solution
Add a --strict flag (or make it default) that validates tool schemas against JSON Schema Draft-07/2020-12 and reports actionable errors:
$ npx @modelcontextprotocol/inspector --cli --method tools/list --strict ./my-server
Error: Invalid JSON Schema in tool "info"
Path: outputSchema.properties.data
Issue: Bare 'true' is not a valid type definition
Suggestion: Use {"type": "object", "additionalProperties": true} for dynamic types
Error: Invalid JSON Schema in tool "get_tree"
Path: inputSchema.properties.show_ids.type
Issue: Array type syntax ["null", "boolean"] may not be supported by all clients
Suggestion: Use {"type": "boolean"} with "nullable": true, or make field optionalBenefits
- Faster debugging - Catch schema issues before deploying to MCP clients
- Better DX - Clear error messages with fix suggestions
- Ecosystem health - Encourage well-formed schemas across MCP servers
Related
outputSchemadoes not fully support JSON Schema #552 -outputSchemadoes not fully support JSON Schema (similar validation gap)- Support JSON Schema
allOf,oneOf, etc. #496 - Support JSON SchemaallOf,oneOf, etc.
Metadata
Metadata
Assignees
Labels
cliIssues and PRs specific to cli modeIssues and PRs specific to cli modeenhancementNew feature requestNew feature requestv2