feat: add outputSchema support for local MCP tools - #10901
Open
chkuang-g wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for outputSchema in local MCP tools, updating the ServerTool interface, the tool builder function, and associated tests. The reviewer feedback suggests simplifying the ServerTool interface by removing the unused OutputSchema generic parameter to avoid a phantom type parameter, and updating the tool function signature accordingly.
joehan
requested changes
Aug 7, 2026
### Description Introduced the `outputSchema` property to the MCP `ServerTool` interface and the `tool()` builder function, enabling local tools to declare typed output schemas. Since the `@modelcontextprotocol/sdk` natively supports `outputSchema`, remote server schemas are automatically validated and forwarded. ### Scenarios Tested - Verified that local tools constructed using `tool()` builder accept and compile with `outputSchema`. - Verified that `outputSchema` gets processed and cleaned correctly in unit tests. - Verified that `OneMcpServer.listTools()` successfully parses and retains the `outputSchema` returned by remote servers. ### Sample Commands npx mocha src/mcp/tool.spec.ts src/mcp/onemcp/onemcp_server.spec.ts
chkuang-g
force-pushed
the
chkuang/mcp-output-schema
branch
from
August 7, 2026 17:39
8972250 to
bbc3ad6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduced the
outputSchemaproperty to the MCPServerToolinterface and thetool()builder function, enabling local tools to declare typed output schemas. Since the@modelcontextprotocol/sdknatively supportsoutputSchema, remote server schemas are automatically validated and forwarded.Scenarios Tested
tool()builder accept and compile withoutputSchema.outputSchemagets processed and cleaned correctly in unit tests.OneMcpServer.listTools()successfully parses and retains theoutputSchemareturned by remote servers.Sample Commands
npx mocha src/mcp/tool.spec.ts src/mcp/onemcp/onemcp_server.spec.ts