Skip to content

fix(setup): default Claude Desktop to compact MCP schemas - #3486

Closed
YongxinFu wants to merge 8 commits into
morluto:mainfrom
YongxinFu:fix/3408-claude-desktop-input-schemas
Closed

YongxinFu wants to merge 8 commits into
morluto:mainfrom
YongxinFu:fix/3408-claude-desktop-input-schemas

Conversation

@YongxinFu

@YongxinFu YongxinFu commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Fixes #3408.

  • Default Claude Desktop to compact MCP input schemas only when no profile has been selected.
  • Preserve stored and explicitly supplied full or compact profiles; explicit setup values retain precedence over stored values.
  • Share the conditional default with Kimi, and align setup preview, documentation, and configuration lifecycle tests.

Problem and expected behavior

Issue #3408 reports that Windows Claude Desktop rejects array/object tool parameters with shared-reference schemas. The owner-reported native Desktop repeat on 2026-10-16 accepted the structured browser parameter calls. Setup now selects that compatible default when no profile is configured. A stored or caller-selected full profile remains full, including during registration refresh.

Change and scope

clientRegistrationEnvironment owns validation and merges stored values with explicit setup values. clientConfigurationDesired adds REA_MCP_INPUT_SCHEMA_PROFILE=compact for Claude Desktop or Kimi only when the validated value is undefined. No schema representation, canonical validation, or provider capability changes. The merge from main preserves its reorganized MCP tests and our browser parameter assertions. It also includes a formatter-only change to an upstream AdbProvider expression so the repository format gate passes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: client registration environment assembly in SetupClientConfiguration.
  • Contribution scope fit and linked maintainer decision: existing integration fix; preserves caller choices as requested in the maintainer review.
  • CLI and MCP/tool-catalog contract: Claude Desktop defaults to compact advertisements when unset; explicit profiles and canonical server validation are preserved.
  • Provider, bridge, target-format, or platform compatibility: Claude Desktop registration; Kimi retains its existing conditional default. Other clients are unaffected.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: the owner-reported 2026-10-16 browser verification inspected an explicitly allowlisted example.com page through loopback CDP; policy filtering and the attach-time observation boundary were preserved.
  • Generated metadata, package, or installation impact: no generated metadata or package files changed.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services. (The manual browser check loaded example.com; the setup change itself only writes the local client configuration.)
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Six Desktop configuration scenarios cover an omitted profile, stored full/compact choices, and explicit setup overrides in both directions. Each verifies unrelated environment/server preservation, backups, and repeat-run idempotency.
  • Compact MCP tests validate advertised schemas, structured parameter types, and rejection of canonical-invalid arguments.
  • Owner-reported native repeat (2026-10-16): list_browser_targets returned one allowed example.com page target; inspect_web_page accepted the same array-valued allowed_origins and returned Example Domain.
  • Remaining proof gaps: full CI and package functional verification. The native browser workflow was successfully repeated; other native client/provider workflows remain outside this verification.

Validation performed

  • Windows x64 with pinned Node 24.18.0 and npm 11.16.0.
  • npm run check — passed (typecheck, format, lint, knip, metadata, module boundaries, architecture guards).
  • npm run test:focused -- src/application/Setup.configuration.test.ts src/application/Setup.planning.test.ts tests/boundary/filesystem/claudeDesktopClientConfiguration.test.ts tests/boundary/filesystem/kimiClientConfiguration.test.ts tests/boundary/filesystem/clientConfigurationEnvironment.test.ts tests/boundary/filesystem/clientConfigurationLayeredEnvironment.test.ts tests/boundary/mcp/compactInputSchemaMcp.test.ts — 124 passed, 10 failed. All six Desktop profile cases and all eleven compact MCP tests passed. The same ten failures were reproduced with production files restored to pre-fix 5e745d4dc: nine existing Windows path/launcher expectations and one temporary-symlink EPERM.
  • npm pack --dry-run --json --silent — passed, 1713 packaged entries.
  • npm run verify:package — after syncing main, repository skill verification passed; package archive checking stopped because python3 resolves to an unavailable Microsoft Store alias (exit 9009). Package functional verification did not complete.
  • npm run verify:package:windows — the last attempt stopped at its prerequisite check: this checkout lacks the built native/windows/build/manifest.json.
  • Native Claude Desktop on Windows (owner-reported repeat, 2026-10-16), Chrome 155.0.8059.41 / CDP 1.3 — both browser calls succeeded after starting the loopback debug browser. Endpoint: http://127.0.0.1:9222; both calls used allowed_origins: ["https://example.com"]. list_browser_targets returned target 762A812D03AB96A5A592A00CED8F1912 at https://example.com/ (two non-page targets excluded). inspect_web_page returned title Example Domain, 35 DOM nodes and 38 accessibility nodes, with an observation window of 2026-10-16T00:26:28.495Z to 00:26:29.026Z. Policy-filtered details remained omitted (not_approved / disallowed_origin), and activity before attach was outside the observation. This evidence was supplied by the human owner; it was not independently reproduced by this editing agent.
  • Pre-commit formatting/lint and pre-push check:fast — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Rerun rea setup --client claude_desktop to add the default when unset. Existing explicit full profiles require an intentional edit to compact and a client restart.
  • Real client/OS coverage: owner-reported native Desktop browser workflow successfully repeated on Windows on 2026-10-16, alongside current configuration lifecycle and canonical MCP tests. This covers the two structured browser calls; other providers and native full-profile acceptance were not verified.
  • Package or release metadata impact: none; package functional checks remain limited by the host prerequisites above.
  • Security, privacy, process, or containment review: preserves explicit caller choices and unrelated configuration; no new target interaction capability.

Author readiness

Human owner: @YongxinFu

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Default managed Claude Desktop registrations to compact input schemas so structured parameter types are advertised without local references. Apply the profile after existing settings so it remains enabled while preserving other environment entries.

Refs morluto#3408
@YongxinFu
YongxinFu marked this pull request as ready for review October 14, 2026 13:07
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Claude Desktop setup now defaults REA_MCP_INPUT_SCHEMA_PROFILE to compact when neither the saved configuration nor the caller selects a profile.

  • Claude Desktop setup picks compact schemas when no profile is set.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Saved environment] --> C[Merge environment]
  B[Explicit setup values] --> C
  C --> D[Validate values]
  D --> E{Profile absent?}
  E -->|Claude Desktop or Kimi| F[Add compact profile]
  E -->|Profile already selected| G[Keep selected profile]
  F --> H[Inspect or write registration]
  G --> H
Loading

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@YongxinFu

Copy link
Copy Markdown
Author

@morluto Could you approve the pending workflows for this PR?

# Conflicts:
#	src/application/SetupClientConfiguration.ts
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Merged latest main into this branch to resolve the SetupClientConfiguration.ts conflict. No rebase or force-push was used. Main added a Kimi default that sets REA_MCP_INPUT_SCHEMA_PROFILE=compact only when no profile is set. Both defaults now share one registrationEnvironment: Claude Desktop is always forced to compact, overriding older profile overrides as this PR intends, and Kimi keeps main's set-only-when-absent behavior. Validation: Setup configuration and planning tests (43 passed), plus the claudeDesktop, kimi, environment and layered-environment client-configuration boundary tests and the compact input-schema MCP test (86 passed). Typecheck and lint pass via the pre-push hook.

@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Compared this PR with main fc712b375 during the fixed/superseded backlog audit.

The updated docs now record native Claude Desktop 2.37337.1 verification with an array-valued allowed_origins call; this is stronger evidence than the earlier source-only mitigation. This audit did not independently reproduce that session.

One contract issue remains in the current diff: registrationEnvironment applies Claude Desktop's compact profile after the validated environment, overriding an explicitly selected full profile, and the new tests expect that overwrite. Preserve a stored or caller-selected profile; use compact as the default only when no choice exists, as the current Kimi path does. Any deliberate migration of an existing explicit choice should be separately presented and approved by the caller. Update the plan text and tests to match that ownership rule, then verify the affected native client alongside canonical MCP validation.

PR head reviewed: 5e745d4dc. This is a source comparison; no new PR-branch tests or provider runs were performed for this comment.

Retain the browser schema type assertions in main's reorganized test. Apply the repository formatter to the upstream AdbProvider expression required by the static gate.
@YongxinFu

Copy link
Copy Markdown
Author

@morluto Your feedback has been addressed, and both native Claude Desktop calls passed. Could you re-review and approve the pending workflows? Latest head: 042ec16.

…op-input-schemas

# Conflicts:
#	src/adb/AdbProvider.ts

Copy link
Copy Markdown
Author

@morluto I've addressed your feedback and updated the PR. Could you please take another look?

const registrationEnvironment =
client.name === "kimi" &&
(client.name === "claude_desktop" || client.name === "kimi") &&
environment.value.REA_MCP_INPUT_SCHEMA_PROFILE === undefined

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Preserve explicit Windows profile keys before adding the Desktop default

This raw uppercase lookup treats a stored Windows rea_mcp_input_schema_profile: 'full' as absent. Reproduced through configureClientConfiguration at this head: an existing Claude Desktop env containing only that setting is rewritten as {rea_mcp_input_schema_profile:'full', REA_MCP_INPUT_SCHEMA_PROFILE:'compact'}. The backup succeeds, but the saved registration now has competing aliases.

Before this change, the Windows snapshotEnvironment path (src/main.ts:43 and src/process/snapshotEnvironment.ts) canonicalizes the lowercase key and honors full. For a Node-based Windows host, child_process lexicographically chooses the first case-insensitive env key, so the newly added uppercase compact is the only variant passed to REA (Node contract); later canonicalization cannot recover full. Writer output was reproduced on macOS; native Windows/Claude execution was not run, so that launch consequence is source-derived.

Please resolve effective environment identity and explicit precedence at the shared registration-environment owner before choosing a default, and avoid emitting conflicting case aliases. Add a Windows mixed-case full/compact regression alongside the uppercase explicit-profile tests.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Thanks for this. Main now defaults every client to compact input schemas (aa51e4343, #5975; src/config/mcpInputSchemaProfile.ts:18), so Claude Desktop already gets the compact profile. The remaining failure in #3408 (clients that send JSON text) is tracked in #3525. Closing as superseded.

@N0zoM1z0 N0zoM1z0 closed this Nov 14, 2026
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Array and object tool parameters rejected when REA runs as a local MCP server in Claude Desktop (Windows)

4 participants