modelcontextprotocol / modelcontextprotocol/python-sdk

Add option to skip output validation for mcp client

Open
#2,626 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs decision P3
Dominant language
Python
Stars
24.3k
Forks
4k
Avg merge
1d 1h
Merged PRs (30d)
31

Description

Description

MCP Client session currently validates the output generated by MCP servers agains the reported json schema, and raises ValidationError.
This means that MCP server tools that have a not well maintained output schema, but are otherwise functional, are unusable.
The request is to add an option either at the ClientSession interface and/or the call_tool method so skip validation and return the result even if it does not conform to the output schemma

References

https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/session.py#L319-L349

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/mcp/client/session.py at lines 319-349 and trace where MCP tool output is checked against its reported JSON schema and raises ValidationError. Determine whether the opt-out belongs on ClientSession, call_tool, or both. Done means callers can skip output validation and receive results from tools whose output does not match the schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.