Skip to content

"Failed to get tools" when MCP server returns outputSchema in tools/list response #21373

@amat27

Description

@amat27

Description

Description
opencode v1.3.17 fails to load tools from MCP servers whose tools/list response includes the outputSchema field on tool definitions. The server is marked as failed with "Failed to get tools".
outputSchema is a valid optional field in the MCP specification and is defined in the bundled SDK's ToolSchema.

Steps to Reproduce

  1. Set up any MCP server (stdio transport) that returns outputSchema on its tools in the tools/list response
  2. Configure it in opencode as a local MCP server
  3. Start opencode — the server fails with "Failed to get tools"

Observed Behavior

  • The MCP server starts, initialize handshake completes successfully
  • tools/list returns a valid response with all tools
  • opencode immediately closes the connection after receiving the response
  • Server is marked as failed

Expected Behavior
Tools should load successfully. Removing outputSchema from the response (via a wrapper script) resolves the issue — all tools load and work correctly.

Environment

  • opencode: v1.3.17
  • OS: Windows 11
  • MCP transport: stdio (local)
  • Server protocol version: 2025-06-18
  • Bundled @modelcontextprotocol/sdk: v1.27.1

Plugins

No response

OpenCode version

1.3.17

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

windows terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions