feat(mcp): bearer-tokened MCP server exposing search to agents#296
Draft
salmonumbrella wants to merge 3 commits into
Draft
feat(mcp): bearer-tokened MCP server exposing search to agents#296salmonumbrella wants to merge 3 commits into
salmonumbrella wants to merge 3 commits into
Conversation
Results ranked by relevance instead of date-only: subject > sender > body (setweight A-D + ts_rank_cd), prefix matching as you type, quoted phrases, served by a GIN index over a trigger-maintained search_fts column. Backfill runs as a resumable background drainer (fast-DDL migrations 0035-0037, no boot-blocking rewrite); not-yet-backfilled rows fall back to the previous query path. Body text is materialized by a provider-gated background IMAP drainer with circuit breakers, poison-message forward progress, and progress reporting. Filter-only queries stay date-ordered. No infrastructure changes - runs on stock postgres:16-alpine. Split 1/3 of maathimself#283. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tor) Explicit opt-in embeddings pipeline against any OpenAI-compatible /v1/embeddings endpoint (key encrypted at rest, host-validated, masked on read). Fingerprinted generations (config change => clean rebuild), a crash-safe fill worker, per-dimension HNSW partial indexes, re-embedding of late-arriving bodies. Query side adds hybrid BM25+ANN reciprocal-rank fusion behind an in-input Semantic toggle; lexical stays the default, with silent fallback while the index builds. Settings UI with explicit privacy copy and live Test/Build progress, in all 7 locales. Migrations 0038-0039. Includes the search-eval harness that produced the published quality numbers, and its explain/total diagnostics seams. Infra: compose moves postgres:16-alpine -> pgvector/pgvector:pg16 (same PG16 major). Run REINDEX DATABASE once after the first boot: the musl -> glibc collation change can misorder existing text btree indexes; the app logs a loud warning when it detects this. Split 2/3 of maathimself#283, stacked on the weighted-FTS PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Streamable-HTTP /mcp endpoint (SHA-256-hashed tokens minted in Profile, Origin-validated, rate-limited) exposing 12 tools including semantic_search_messages and search_in_message. Every call is scoped to the token owner's accounts; deletion is staged-only. Adds the MCP-only search seams (trusted account scoping, body-scope FTS leg, strictVector, loadVector), the chunk-excerpt read path, migrations 0040-0041, and one new backend dependency: @modelcontextprotocol/sdk. Split 3/3 of maathimself#283, stacked on the semantic-embeddings PR. The stacked tree is byte-identical to the reviewed maathimself#283 head (3773150). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
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.
Split 3/3 of #283, stacked on #294 → #295 — the diff shows their commits until they merge; review the last commit only (
feat(mcp): bearer-tokened MCP server exposing search to agents). I'll rebase as the stack lands. One new backend dependency:@modelcontextprotocol/sdk.Summary
/mcpendpoint: SHA-256-hashed bearer tokens minted in Profile, Origin-validated, rate-limited. 12 tools includingsemantic_search_messagesandsearch_in_message; every call is scoped to the token owner's accounts; deletion is staged-only (migrations 0040–0041).strictVector,loadVector, and the chunk-excerpt read path (chunkmatch/textExcerpt)./mcpproxy blocks (SSE-friendly, no buffering); token minting UI in Profile, in all 7 locales.With this PR merged, the combined tree is byte-identical to the reviewed #283 head (
3773150) modulo the rebase onto current main — the three-way split re-partitions that exact tree, it does not rewrite it.Testing
Contributor License Agreement
By submitting this pull request I confirm that:
🤖 Generated with Claude Code