You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCP servers that derive their JSON Schemas from Rust types via schemars emit non-standard format values like uint32, uint64, uint8, and uint. When opencode registers these tools, AJV (the JSON Schema validator) outputs warnings for each unknown format:
unknown format "uint64" ignored in schema for path "/properties/pid"
unknown format "uint32" ignored in schema for path "/properties/width"
...
These warnings cannot be suppressed — --log-level ERROR does not help because they come from AJV's console.warn() bypassing opencode's logger.
Affected MCP servers
computer-use-linux (schemars-derived schemas for Rust u32/u64/u8 types)
Provide a mechanism to suppress/silence schema validation warnings from MCP tool registration
Both
Why upstream fixes aren't enough
While individual MCP servers can (and should) configure schemars to use SchemaSettings::draft07() to avoid emitting these formats, this is a systemic issue that will keep appearing for any Rust MCP server using default schemars config.
While waiting for a fix on the OpenCode side, here's a practical workaround for anyone using a Rust-based MCP server: wrap the binary in a Node.js JSON-RPC filter that strips the non-standard format values before OpenCode's AJV sees them.
Point your opencode.jsonccommand at this script instead of the binary. The filter intercepts JSON-RPC stdout and removes all Rust integer format annotations before OpenCode validates the schema.
Tested on tmux-mcp-rs v0.4.0 — eliminates all unknown format "uint64" warnings on startup.
The cleanest fix would still be option 1 from the issue (strip in OpenCode's MCP tool registration layer), since this workaround has to be applied per-MCP-server.
Reproduced on OpenCode 1.18.14 for macOS arm64 with a Rust/schemars-based MCP server. The repeated AJV console.warn() messages were written into the TUI and visually corrupted it; --log-level did not suppress them.
A narrowly scoped local workaround now proxies only this MCP's JSON-RPC stream and recursively removes unsupported integer formats (uint, uint8/16/32/64, int8/16/32/64) only inside successful result.tools responses. It leaves non-tool messages byte-identical and preserves recognized formats.
Acceptance evidence:
direct enumeration: 54 tools, 0 unsupported integer formats after normalization, 29 double formats preserved;
three full OpenCode MCP enumerations: exit 0, 25 servers each, affected MCP connected;
PTY TUI smoke: remained alive past startup, clean exit, no schema-warning flood.
This confirms the systemic client-side normalization approach requested here works without changing the MCP implementation or disabling schema validation.
Client-side workaround: schema-sanitizing stdio shim (keeps the server enabled)
For anyone hitting this with a Rust/schemars MCP server (I hit it with cua-driver), a local stdio wrapper can strip the non-standard uint32/uint64format annotations before AJV sees them — without disabling the server, losing tools, or hiding real errors.
#!/bin/zshset -o pipefail
# adjust to your cua-driver binary path~/.local/bin/cua-driver mcp "$@"|
/usr/bin/jq --unbuffered --compact-output ' if ((.result.tools? // null) | type) == "array" then walk( if type == "object" and ((.format? == "uint32") or (.format? == "uint64")) then del(.format) else . end ) else . end'
Only touches tools/list responses (result.tools) and only removes format fields whose value is exactly uint32/uint64. Tool names, descriptions, parameters, required fields, calls, and results are untouched.
These are the same annotations AJV was already ignoring, so no validation behavior changes — it just stops the console.warn noise.
Verified: opencode mcp list shows the server connected with zero unknown format warnings.
Trade-off: adds a jq dependency on the MCP stdio path; if the wrapper ever fails, the server reports disconnected rather than misbehaving.
Band-aid until opencode strips non-standard formats at the MCP boundary, but it keeps the full tool surface functional.
Reproduced on opencode 1.18.30 (macOS 26.6.2 arm64) with cua-driver 0.26.0 (Rust/schemars MCP server, 34 tools with outputSchema). opencode mcp list prints 81 warning lines covering 26 unique schema paths, so it reproduces outside the TUI too.
Root cause is in the SDK's output-schema validation path, not the AI SDK jsonSchema() conversion:
Ajv ignores unknown formats but its default logger calls console.warn during compilation, so --log-level doesn't help and the raw lines hit the terminal.
Verified fix: supply a jsonSchemaValidator through the SDK's documented ClientOptions seam, using an Ajv with the SDK's defaults plus logger: false:
With that, warning output goes to 0, while known formats (uuid, date-time, ...) and type validation are unchanged. I can open a PR with a unit test if this approach is acceptable.
Confirmed on OpenCode 1.18.32 (macOS) with the Firebase MCP server enabled. On TUI startup, repeated raw unknown format "google-duration" ignored in schema at path "#/properties/versionRetentionPeriod" warnings (also #/properties/retention) are painted over the alternate-screen UI, including the input area. This is the same class of failure as the schemars uint64 case tracked here; the format differs, but Ajv is ignoring it and warning through console.warn. #48331 is still open and its logger: false validator should cover this Firebase case as well. The older Firebase-specific report #15161 was auto-closed without a fix.
Closing as resolved for opencode v2: verified against the current v2 tip (2.0.23, fad352c) — JSON Schemas are no longer Ajv-compiled during MCP registration (input schemas are never compiled, output schemas compile lazily only when a tool is first called), and the managed server's stderr is captured, so the unknown format warnings no longer pollute the TUI. Reopen if it resurfaces.
Activity
github-actions commentedon Jun 5, 2026
This issue might be a duplicate of existing issues. Please check:
BzNdevOps commentedon Jun 14, 2026
Workaround (client-side Node.js proxy wrapper)
While waiting for a fix on the OpenCode side, here's a practical workaround for anyone using a Rust-based MCP server: wrap the binary in a Node.js JSON-RPC filter that strips the non-standard format values before OpenCode's AJV sees them.
Point your
opencode.jsonccommandat this script instead of the binary. The filter intercepts JSON-RPC stdout and removes all Rust integer format annotations before OpenCode validates the schema.Tested on
tmux-mcp-rsv0.4.0 — eliminates allunknown format "uint64"warnings on startup.The cleanest fix would still be option 1 from the issue (strip in OpenCode's MCP tool registration layer), since this workaround has to be applied per-MCP-server.
lightcloud00 commentedon Aug 6, 2026
Reproduced on OpenCode 1.18.14 for macOS arm64 with a Rust/schemars-based MCP server. The repeated AJV
console.warn()messages were written into the TUI and visually corrupted it;--log-leveldid not suppress them.A narrowly scoped local workaround now proxies only this MCP's JSON-RPC stream and recursively removes unsupported integer formats (
uint,uint8/16/32/64,int8/16/32/64) only inside successfulresult.toolsresponses. It leaves non-tool messages byte-identical and preserves recognized formats.Acceptance evidence:
doubleformats preserved;This confirms the systemic client-side normalization approach requested here works without changing the MCP implementation or disabling schema validation.
Ayoola commentedon Aug 18, 2026
Client-side workaround: schema-sanitizing stdio shim (keeps the server enabled)
For anyone hitting this with a Rust/schemars MCP server (I hit it with
cua-driver), a local stdio wrapper can strip the non-standarduint32/uint64formatannotations before AJV sees them — without disabling the server, losing tools, or hiding real errors.Wrapper script (
~/.config/opencode/cua-driver-mcp,chmod 755):Then point the
mcpentry at the wrapper:Notes:
tools/listresponses (result.tools) and only removesformatfields whose value is exactlyuint32/uint64. Tool names, descriptions, parameters, required fields, calls, and results are untouched.console.warnnoise.opencode mcp listshows the server connected with zerounknown formatwarnings.jqdependency on the MCP stdio path; if the wrapper ever fails, the server reports disconnected rather than misbehaving.Band-aid until opencode strips non-standard formats at the MCP boundary, but it keeps the full tool surface functional.
arkaydeus commentedon Sep 10, 2026
Reproduced on opencode 1.18.30 (macOS 26.6.2 arm64) with cua-driver 0.26.0 (Rust/schemars MCP server, 34 tools with
outputSchema).opencode mcp listprints 81 warning lines covering 26 unique schema paths, so it reproduces outside the TUI too.Root cause is in the SDK's output-schema validation path, not the AI SDK
jsonSchema()conversion:@modelcontextprotocol/[email protected]Client.listTools()eagerly compiles every tooloutputSchemathroughAjvJsonSchemaValidator(cacheToolMetadata). Input schemas are never Ajv-compiled, which is why fix(mcp): strip non-standard JSON Schema formats to suppress AJV warnings #12815/fix(opencode): sanitize unknown MCP schema formats before jsonSchema() #20747 (stripping formats beforejsonSchema()) can't suppress these warnings.console.warnduring compilation, so--log-leveldoesn't help and the raw lines hit the terminal.Verified fix: supply a
jsonSchemaValidatorthrough the SDK's documentedClientOptionsseam, using an Ajv with the SDK's defaults pluslogger: false:With that, warning output goes to 0, while known formats (uuid, date-time, ...) and type validation are unchanged. I can open a PR with a unit test if this approach is acceptable.
fix(tui): route console output to log file to protect TUI display
vpeschenkov commentedon Sep 24, 2026
Confirmed on OpenCode 1.18.32 (macOS) with the Firebase MCP server enabled. On TUI startup, repeated raw
unknown format "google-duration" ignored in schema at path "#/properties/versionRetentionPeriod"warnings (also#/properties/retention) are painted over the alternate-screen UI, including the input area. This is the same class of failure as the schemarsuint64case tracked here; the format differs, but Ajv is ignoring it and warning throughconsole.warn. #48331 is still open and itslogger: falsevalidator should cover this Firebase case as well. The older Firebase-specific report #15161 was auto-closed without a fix.Ploppy3 commentedon Oct 5, 2026
Closing as resolved for opencode v2: verified against the current v2 tip (2.0.23, fad352c) — JSON Schemas are no longer Ajv-compiled during MCP registration (input schemas are never compiled, output schemas compile lazily only when a tool is first called), and the managed server's stderr is captured, so the
unknown formatwarnings no longer pollute the TUI. Reopen if it resurfaces.