[BUG] `claude mcp serve` tools not displayed in MCP clients due to missing type field in outputSchema

Resolved 💬 6 comments Opened Oct 21, 2025 by ko1ynnky Closed Nov 4, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using claude mcp serve as an MCP server, the tools are not displayed in MCP clients (Claude Desktop, Cursor). The server shows as "connected" but the tools list appears empty with Tools: (none).

MCP clients show schema validation errors:

Error listing tools: [
  {
    "code": "invalid_literal",
    "expected": "object",
    "path": ["tools", 0, "outputSchema", "type"],
    "message": "Invalid literal value, expected \"object\""
  },
  {
    "code": "invalid_literal",
    "expected": "object",
    "path": ["tools", 5, "outputSchema", "type"],
    "message": "Invalid literal value, expected \"object\""
  }
]
Found 0 tools, 0 prompts, and 0 resources

What Should Happen?

All 16 tools (Task, Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Skill, SlashCommand, ExitPlanMode) should be displayed and usable in MCP clients.

Error Messages/Logs

Cursor MCP Log

2025-10-21 17:31:14.307 [error] Error listing tools: [
  {
    "code": "invalid_literal",
    "expected": "object",
    "path": ["tools", 0, "outputSchema", "type"],
    "message": "Invalid literal value, expected \"object\""
  },
  {
    "code": "invalid_literal",
    "expected": "object",
    "path": ["tools", 5, "outputSchema", "type"],
    "message": "Invalid literal value, expected \"object\""
  }
]
2025-10-21 17:31:14.307 [info] Found 0 tools, 0 prompts, and 0 resources

Claude Desktop Log

2025-10-21T08:17:35.430Z [claude_code] [info] Server started and connected successfully
2025-10-21T08:17:36.886Z [claude_code] [info] Message from client: {"method":"tools/list","params":{},"jsonrpc":"2.0","id":1}
2025-10-21T08:17:38.005Z [claude_code] [info] Message from server: {"jsonrpc":"2.0","id":1,"result":{"tools":[...]}}

(Server returns tools successfully, but UI shows "Tools: (none)")

Steps to Reproduce

  1. Add claude mcp serve to an MCP client configuration:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "claude_code": {
      "command": "/Users/username/.local/bin/claude",
      "args": ["mcp", "serve"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "claude_code": {
      "command": "/Users/username/.local/bin/claude",
      "args": ["mcp", "serve"]
    }
  }
}
  1. Restart the MCP client (Claude Desktop or Cursor)
  2. Check the tools list - it will show "Tools: (none)" or "Found 0 tools"
  3. Check logs - validation errors appear for tools[0] and tools[5]

Root Cause Analysis

The Task (tools[0]) and Read (tools[5]) tools have outputSchema using anyOf for Union types without a top-level type field:

{
  "anyOf": [...],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

While this is valid JSON Schema, MCP clients expect:

{
  "type": "object",
  "anyOf": [...],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Verified by analyzing the actual response:

$ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | claude mcp serve
# Returns 16 tools, but Task and Read have outputSchema without top-level "type"

Claude Model

Not applicable (this is a claude mcp serve schema issue, not a model behavior issue)

Is this a regression?

I don't know

Claude Code Version

2.0.24 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

  • Claude Desktop
  • Cursor
  • Terminal.app (macOS) - for direct testing

Additional Information

This issue affects all MCP clients that validate tool schemas strictly. The MCP server itself works correctly (verified via direct JSON-RPC communication), but the schema format is incompatible with client-side validation.

Suggested fixes:

  1. Add "type": "object" to the top level of outputSchema for Task and Read tools
  2. OR: Update the JSON Schema to ensure compatibility with strict validators

Workaround:
None available. claude mcp serve cannot currently be used with third-party MCP clients.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗