Fix MCP extra args rejection and bank ID resolution priority#351
Merged
nicoloboschi merged 2 commits intomainfrom Feb 12, 2026
Merged
Fix MCP extra args rejection and bank ID resolution priority#351nicoloboschi merged 2 commits intomainfrom
nicoloboschi merged 2 commits intomainfrom
Conversation
743e3ce to
17c1a3b
Compare
Two fixes to the MCP middleware: 1. Strip unknown tool arguments: LLMs frequently add extra fields like "explanation" to tool calls. FastMCP's Pydantic TypeAdapter rejects these with "Unexpected keyword argument". The middleware now intercepts tools/call requests and removes unknown fields before they reach validation. 2. Bank ID resolution priority: Path now takes priority over header. Previously X-Bank-Id header was checked first, meaning /mcp/my-bank/ with X-Bank-Id: other-bank would silently use other-bank in multi-bank mode. Now the URL path is authoritative — single-bank mode connections cannot be overridden by headers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add all mental model tools (create, list, get, update, delete, refresh) - Add list_banks and create_bank tool docs - Document single-bank vs multi-bank modes - Fix bank selection priority: path > header > default - Add Accept header to curl example - Add timestamp param to retain, max_tokens to recall Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2ef9d3f to
8a9f58f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
explanation) that LLMs add totools/callrequests before they reach FastMCP's Pydantic validationX-Bank-Idheader, making single-bank mode authoritativeTest plan
🤖 Generated with Claude Code