[BUG] mcp serve: tools advertise outputSchema but return no structuredContent
Resolved 💬 4 comments Opened Feb 10, 2026 by hwaxxer Closed Mar 11, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running as an MCP server, some tools advertise a outputSchema but return structuredContent: null for successful tools/call responses, for example Bash. This causes every session.call_tool with those tools to error.
This has been reported in #11354 but ignored for over 3 months and the issue is now closed.
What Should Happen?
The python MCP SDK enforces that tools with outputSchema must return structuredContent (see https://github.com/modelcontextprotocol/python-sdk/blob/v1.24.0/src/mcp/client/session.py#L416)
Error Messages/Logs
Tool Bash has an output schema but did not return structured content
Steps to Reproduce
Run:
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main() -> None:
params = StdioServerParameters(
command="npx",
args=["-y", "@anthropic-ai/claude-code@2.1.38", "mcp", "serve"],
)
async with (
stdio_client(params) as (read_stream, write_stream),
ClientSession(read_stream, write_stream) as session,
):
await session.initialize()
try:
result = await session.call_tool("Bash", {"command": "echo hi"})
print(result)
except Exception as e:
print("Exception: ", e)
if __name__ == "__main__":
asyncio.run(main())
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.119
Claude Code Version
2.1.37
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗