← Back to Pull requests

fix: support MCP json schema tools #4553

Closed
unknown closed this pull request without merging on Sep 05, 2026 14:13 UTC
View on GitHub
unknown unknown commented on Sep 02, 2026 08:16 UTC
Author

Summary

Fixes #4334

Maka Desktop now accepts MCP proxy tools that expose ai.jsonSchema() wrappers instead of requiring every tool schema to be a Zod instance.

This change covers both parts of the failure:

  • capability refresh now projects MCP tool schemas into the protocol-accepted schema vocabulary before publishing

  • native tool invocation preserves JSON Schema arguments as opaque input and forwards them to the MCP-backed implementation; the existing Zod path remains locally parsed
  • The MCP server remains the sole authority for validating the complete JSON Schema, including its dialect and composition keywords. Runtime Host owns the protocol projection and keeps malformed dynamic MCP tools isolated from healthy capabilities.

    Verification

    Ran locally:

  • npm --workspace @maka/mcp run build

  • npm --workspace @maka/computer-use run build

  • npm --workspace @maka/desktop run build:main

  • node --test packages/runtime/dist/__tests__/mcp-tools.test.js apps/desktop/dist/main/__tests__/runtime-host-native-capabilities.test.js apps/desktop/dist/main/__tests__/runtime-host-desktop-candidate.test.js apps/desktop/dist/main/__tests__/mcp-runtime-e2e.test.js (64 passed, 0 failed)

  • npx biome check on the changed files

  • git diff --check
  • The isolated local worktree could not complete the full Runtime/Runtime Host build because its existing dependency graph is incomplete. GitHub CI for 105a79fc79fe11b2971e90fb89260b82c80b5be0 has already passed Build and Typecheck; the remaining CI stages are still running.

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope:

  • Codex — helped implement the fix, add regression coverage, run verification, and draft this PR description.
  • Checklist

  • Tests cover the change and fail without it

  • Lint and format checks pass locally

  • GitHub CI Build and Typecheck pass
  • Does this PR entail a change in behavior?

  • Yes — MCP proxy tools are now accepted in the desktop capability flow and invoke successfully at runtime

  • No
  • Diff: 263 lines (+197 / -66) across 3 files Reviewer: liugddx Review duration: 4676m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 263 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4553"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.3% (MEDIUM) · Higher = larger blast radius
    39.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.5% · Safe to merge
    15.5%
    Repository