Fix Claude tool schema compatibility - #398
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change adds schema-aware redaction for ChangesSchema redaction and compatibility validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MCPClient
participant MiftahServer
participant runAudited
participant SchemaRedactor
MCPClient->>MiftahServer: Request tools/list
MiftahServer->>runAudited: Execute with schema-aware result redactor
runAudited->>SchemaRedactor: Redact tool metadata and schemas
SchemaRedactor-->>runAudited: Preserve schema structure and normalize true
runAudited-->>MCPClient: Return sanitized tools/list
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mcp/server/miftah-server.ts`:
- Around line 3710-3718: Update redactClientVisibleSchema for the
jsonSchemaMapKeywords branches and the corresponding properties, $defs,
dependencies, default, and examples handling so each copied object key passes
through the existing scalar redaction logic while preserving ordinary names such
as tokens. Add a regression fixture using API_TOKEN as a schema property key and
verify configured-secret, bearer, and provider-token values are redacted from
the client-visible schema.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 21fb2d14-05da-49ee-b949-76982c628c59
📒 Files selected for processing (5)
CHANGELOG.mdsrc/mcp/server/miftah-server.tstests/fixtures/fake-upstream-bundled.mjstests/fixtures/fake-upstream-runtime.mjstests/mcp-wrapper.test.ts
What changed
trueto equivalent{}for Claude Desktop proxy compatibilityfalseconstraints and ordinary boolean valuesRoot cause
The generic audited-result redactor treated names inside JSON Schema
propertiesmaps as ordinary structured-data keys. Names such astokens,passwordProtection, andpage_tokentherefore caused their schema definitions to be replaced with"[REDACTED]", invalidatingtools/listbefore any upstream tool call. Separately, Claude Desktop's local proxy converter rejects valid schema-valued booleantruein exposed output schemas.User impact
Claude Desktop can discover the affected Vercel, Firebase, and Stripe tool catalogs through Miftah. MongoDB behavior is unchanged; it was verified healthy during diagnosis.
Validation
Closes #397
Summary by CodeRabbit