Commit cf621f6
feat(mcp): multi-index MCP server support (RAAE-1603) (#646)
## Overview
Rolls up the **RedisVL MCP multi-index server** epic
([RAAE-1603](https://redislabs.atlassian.net/browse/RAAE-1603)) into
`main`. A single MCP server can now expose **one or more** configured
Redis index bindings — with discovery (`list-indexes`), explicit
per-call routing (an optional `index` argument on
`search-records`/`upsert-records`), and per-index write policy — while
existing **single-index configs and callers behave exactly as before**.
## This is a roll-up — every change was already reviewed and merged
This PR introduces **no new code**. It is the aggregate of a stacked
series of per-ticket PRs, each reviewed and squash-merged into the
`feature/raae-1603-mcp-multi-index` collector branch:
- [#629](#629) — RAAE-1604:
config + runtime refactor (immutable `BindingRuntime`, per-binding
startup/teardown, `resolve_binding` routing, single global concurrency
semaphore)
- [#630](#630) — RAAE-1605:
`list-indexes` discovery tool
- [#631](#631) — RAAE-1606:
`search-records` index routing
- [#632](#632) — RAAE-1607:
`upsert-records` index routing + per-index write policy
- [#633](#633) — RAAE-1608:
concept/how-to/README docs
Each stacked PR was reviewed (human + Cursor Bugbot) and its threads
resolved before merge; this branch is the sum of those merges plus a
sync with `main`.
## Synced with `main`
The branch is up to date with `main`, including the recently merged MCP
security work — **Host/Origin header validation
([#643](#643 and the
**nltk drop
([#645](#645 — pulled
in via merge, so this PR's diff contains **only** the epic's own changes
(main's commits are in the merge base).
## Security review
A security review of the epic diff was run (auth scope enforcement,
read-only/write policy, index routing, info leakage, injection,
config/vectorizer resolution). **No findings** — tokenless HTTP is
rejected upstream by the SDK auth middleware, scopes and read-only
policy are enforced at both registration and per-call, routing is
confined to configured bindings, and `redis_name` is never exposed by
`list-indexes`.
## Verification
- Full MCP unit + integration suite: **283 passed / 1 skipped** on
`redis:8.2` (now runs without nltk).
- `mypy` clean; `black`/`isort` clean.
- Backward compatibility covered by dedicated tests (single-binding
defaults, omitted-`index` behavior, unchanged response contract aside
from the additive `index` echo).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
[RAAE-1603]:
https://redislabs.atlassian.net/browse/RAAE-1603?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes MCP server startup, routing, and write boundaries across
bindings; single-index behavior is preserved but multi-index
misconfiguration or routing errors could affect production assistants.
>
> **Overview**
> **Multi-index MCP server** — One process can expose several logical
index bindings from YAML `indexes`, each with its own schema inspection,
search config, vectorizer, and runtime limits. Startup is
all-or-nothing: any binding failure prevents the server from starting.
>
> **Routing and discovery** — New **`list-indexes`** tool enumerates
logical ids, filterable fields, `upsert_available`, and optional limits
(without exposing `redis_name`). **`search-records`** and
**`upsert-records`** accept an optional **`index`** argument; responses
echo the resolved id. With a single binding, omitting `index` still
works; with multiple bindings, omitting or using an unknown id returns
`invalid_request`.
>
> **Write policy** — Global `--read-only` / `REDISVL_MCP_READ_ONLY` plus
per-binding **`read_only: true`** combine into
**`effective_read_only`**. `upsert-records` is registered only if at
least one binding is writable; writes to a read-only binding fail with
**`forbidden`** before Redis is touched.
>
> **Implementation** — Config drops the “exactly one index” rule and
adds **`description`** / **`read_only`** on bindings. Server state moves
to per-binding **`BindingRuntime`** and **`resolve_binding()`**; removed
single-index helpers like `get_index()`. Search tool descriptions omit
per-schema hints when multiple indexes are configured and point clients
to `list-indexes`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
553e55f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 826d12c commit cf621f6
20 files changed
Lines changed: 1939 additions & 409 deletions
File tree
- docs
- concepts
- user_guide/how_to_guides
- redisvl/mcp
- tools
- tests
- integration/test_mcp
- unit/test_mcp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
| 575 | + | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | | - | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
56 | 71 | | |
57 | | - | |
| 72 | + | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
| |||
71 | 86 | | |
72 | 87 | | |
73 | 88 | | |
74 | | - | |
| 89 | + | |
75 | 90 | | |
76 | | - | |
| 91 | + | |
77 | 92 | | |
78 | | - | |
79 | | - | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
| |||
88 | 105 | | |
89 | 106 | | |
90 | 107 | | |
91 | | - | |
| 108 | + | |
92 | 109 | | |
93 | | - | |
94 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
95 | 113 | | |
96 | 114 | | |
97 | 115 | | |
98 | 116 | | |
| 117 | + | |
99 | 118 | | |
100 | | - | |
| 119 | + | |
101 | 120 | | |
102 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
103 | 138 | | |
104 | 139 | | |
105 | 140 | | |
| |||
0 commit comments