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

Status Fixed / completed
Maintainer reply None cached
Activity 6 comments · opened Oct 21, 2025 · 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 ↗

6 Comments

ElKornacio · 10 months ago

<img width="247" height="89" alt="Image" src="https://github.com/user-attachments/assets/aa05adea-2bf5-4cdd-befd-1e06c175d528" />

I've noticed the same bug. Seems like it is something recent.

{
  "mcpServers": {
    "claude-code": {
      "type": "stdio",
      "command": "claude",
      "args": ["mcp", "serve"],
      "env": {}
    }
  }
}
ljagiello · 10 months ago

It's broken from 1.0.120, 1.0.119 is the last fully working version.

ko1ynnky · 10 months ago

Related to #8014

Slach · 9 months ago

@domdomegg could you add any pull request reference where claude mcp serve fixed?

domdomegg · 9 months ago

Apologies, accidentally linked some things internally. I've made a fix which should fix claude mcp serve in the next build of Claude Code.

Will keep this closed and track further updates in https://github.com/anthropics/claude-code/issues/8014, given this is a duplicate.

github-actions[bot] · 9 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.