dev → main: MCP SDK v2 port, create-gate thresholds in Settings #186

Merged
bvandeusen merged 2 commits from dev into main 2026-09-24 07:31:51 -04:00
Owner
  • MCP Python SDK v2 (#2196): the server moves from FastMCP to MCPServer; mcp[cli]>=2.2, lock regenerated (only mcp and its dependencies moved). The stateless and DNS-rebinding settings now live on streamable_http_app. The strict-args guard raises ToolError. Per-user identity is unchanged on both v2 request paths.
  • Create-gate thresholds are settings (#4385): five kb_gate_* per-user settings with Settings fields, clamped and fail-open. The claim lease stays a constant, with the reason written at it.

Last dev run 7446 green, image built. After redeploy: a real session must list and call tools, including a write, to confirm the v2 transport and per-user identity. Reverting c26b7f2 goes back to v1.

🤖 Generated with Claude Code

- **MCP Python SDK v2 (#2196):** the server moves from FastMCP to `MCPServer`; `mcp[cli]>=2.2`, lock regenerated (only mcp and its dependencies moved). The stateless and DNS-rebinding settings now live on `streamable_http_app`. The strict-args guard raises `ToolError`. Per-user identity is unchanged on both v2 request paths. - **Create-gate thresholds are settings (#4385):** five `kb_gate_*` per-user settings with Settings fields, clamped and fail-open. The claim lease stays a constant, with the reason written at it. Last dev run 7446 green, image built. **After redeploy:** a real session must list and call tools, including a write, to confirm the v2 transport and per-user identity. Reverting c26b7f2 goes back to v1. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 2 commits 2026-09-24 07:31:46 -04:00
feat(dedup): the create gate's similarity bars are settings (#4385, rule 25)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 10s
CI & Build / TypeScript typecheck (push) Successful in 57s
CI & Build / integration (push) Successful in 56s
CI & Build / Python tests (push) Successful in 1m38s
CI & Build / Build & push image (push) Successful in 38s
4502f0a1ae
gate_bars(user_id, note_type) resolves the block bar and, for notes and
tasks, the overlap floor from kb_gate_* settings, with the old constants
as defaults. Fail-open on an unreadable value; a block bar clamps at 0.80
and the overlap floor at 0.70 and never above the bar. Five fields in
Settings beside the duplicate-report floors.

CLAIM_LEASE stays a constant, with the reason written at it: a per-user
lease would make one shared task live to one reader and dead to another.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(mcp): port the server to MCP Python SDK v2 (FastMCP → MCPServer) (#2196)
CI & Build / Python lint (push) Successful in 4s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 53s
CI & Build / Python tests (push) Successful in 1m37s
CI & Build / Build & push image (push) Successful in 31s
c26b7f248e
- server.py: `mcp.server.mcpserver.MCPServer`; StrictArgsFastMCP becomes
  StrictArgsMCPServer, whose call_tool takes and forwards v2's `context`
  and raises ToolError (the SDK logs anything else as an unexpected crash;
  the message reaches the caller either way).
- stateless_http and transport_security moved from the constructor to
  `streamable_http_app(...)` in mount_mcp, with their reasons.
- Per-request user identity is unchanged: the contextvar set around the
  ASGI call reaches the handler on both v2 paths (legacy stateless spawns
  from the request task; the 2026-07-28 modern path opens its task group
  inside the request).
- pyproject: mcp[cli]>=2.2, no ceiling (installs are --locked). uv.lock
  regenerated with --upgrade-package mcp in the ci-python image: only mcp
  and its own dependencies moved (106 → 110 packages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvandeusen merged commit 779efb2e74 into main 2026-09-24 07:31:51 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#186