Skip to content

[MCP] memory server tools fail to load: outputSchema uses JSON Schema draft-07, validator only supports 2020-12 #39908

Closed as not planned

Description

@anmarui74

Description

The MCP memory server (@modelcontextprotocol/server-memory) tools cannot be used. Every memory tool (search_nodes, create_entities, add_observations, etc.) fails with a schema validation error and is not registered.

Error

Tool 'search_nodes' has an invalid outputSchema: JSON Schema declares an unsupported dialect ("$schema": "http://json-schema.org/draft-07/schema#"). The default validator supports JSON Schema 2020-12 only; pass a pre-configured Ajv instance to AjvJs

Root cause

The official @modelcontextprotocol/server-memory generates its tool schemas with zod-to-json-schema, which by default stamps "$schema": "http://json-schema.org/draft-07/schema#". OpenCode's MCP client validates tool schemas with Ajv configured for JSON Schema 2020-12 only, so any server declaring an explicit draft-07 dialect is rejected before the tool is loaded.

The MCP spec (2025-11-25) honors the declared dialect when present (absent means 2020-12), so the validator should dispatch on the declared dialect instead of rejecting pre-wire. There is already a fix in the reference TypeScript SDK (modelcontextprotocol/typescript-sdk test outputSchemaDialect.test.ts) that does exactly this — the draft-07 Filesystem-server shape validates instead of failing pre-wire.

Environment

  • OpenCode version: 1.18.8 (reported as latest)
  • OS: Linux (Arch/Manjaro, X11)
  • MCP server: @modelcontextprotocol/server-memory (npx latest)

Steps to reproduce

  1. Add to opencode.json:
    "memory": {"type": "local", "command": ["npx", "-y", "@modelcontextprotocol/server-memory"], "enabled": true}
  2. Start OpenCode.
  3. Try to invoke any memory tool (e.g. search_nodes) or inspect the tool list.

Expected

Memory server tools load and validate correctly despite the draft-07 dialect declaration, mirroring the reference SDK behavior (dispatch on declared dialect).

Impact

The knowledge-graph memory feature is completely unusable in OpenCode. The graph data is still persisted on disk; only the tool interface fails.

Activity

  1. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Both are now closed; if the underlying fix hasn't landed in the latest release, please reopen or track there.

  2. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions