GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep MCP servers whose tool output schema has no type by tlq5l · Pull Request #57832 · anomalyco/opencode

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Fixes #57643

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The MCP SDK validates the whole tools/list result and requires every outputSchema to have type: "object". A tool whose schema is only $defs plus a top-level anyOf (for example one generated by Rust schemars) fails that check, so every tool on the server is dropped.

typeOutputSchemas in packages/core/src/mcp/client.ts wraps the transport's onmessage before connect and adds type: "object" to any listed outputSchema that has no type. The tool and its schema stay, and so do the other tools.

Related #56116 (a result that breaks its schema still fails the call) is untouched.

How did you verify your code works?

Added a test with a raw stdio fixture that lists one plain tool and one anyOf tool, then calls the second. It fails on dev with the tools/list error from the issue and passes now. The core typecheck is clean. One existing test ("exposes every connection operation") times out here on dev too.

Ran live: opencode mcp list (dev build, the issue's repro server) -> ✗ anyof failed: Invalid result for tools/list ... expected "object" before, ✓ anyof connected after.

Screenshots / recordings

N/A

Checklist

  • Tested locally (agent-run with Claude Code; I take responsibility for it)
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #56116

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tlq5l
fix(core): keep MCP servers whose tool output schema has no type
4beee8f
Agent: claude
opencode-agent[bot]
opencode-agent Bot reviewed Oct 21, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I reproduced #57643 on the base: opencode mcp list against the issue's server fails with Invalid result for tools/list … expected "object". With this change the server shows connected. The new test fails on the base and passes here. test/mcp.test.ts has one other failure, which fails on the base too. The core typecheck is clean.

Public API: unchanged.

No blocking concerns. The onmessage wrapper keeps working when the SDK wraps or replaces the handler on connect, and initialize applies it to every transport it creates. Adding type: "object" is accurate because MCP structured content must be an object, and in the test the call result still passes the SDK's output schema check.

Related: #56116

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@opencodejr opencodejr Bot mentioned this pull request Oct 28, 2026
MCP/schema: validation hardening + anchor-form $ref retention (PR #48638 series) #49978
Closed
@tlq5l

tlq5l commented Oct 30, 2026

Copy link
Copy Markdown
Author

Closing: #58224 fixed #57643 another way. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tlq5l tlq5l closed this Oct 30, 2026
@github-actions github-actions Bot mentioned this pull request Oct 30, 2026
📊 AI CLI 工具社区动态日报 2026-10-31 litang9/big_model_radar#630
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MCP: outputSchema anyOf/oneOf rejected — valid JSON Schema combinators cause entire server to fail

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@tlq5l
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.