feat(MCP): [2/5] Add search-records tool to RedisVL MCP#539
feat(MCP): [2/5] Add search-records tool to RedisVL MCP#539vishal-bala merged 24 commits intofeat/RAAE-1395-redisvl-mcpfrom
search-records tool to RedisVL MCP#539Conversation
…h-tool # Conflicts: # tests/integration/test_mcp/test_server_startup.py
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8f5e3d7cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
rbs333
left a comment
There was a problem hiding this comment.
Looks cool!
In general I think it would be good for you to create an end-to-end sort of example from a pretend customer perspective that demonstrates all this functionality so that the value can be better conceptualized.
For instance, if we integrated this in to rain what would it look like? How would we do it? And what could now do that we couldn't do before.
I think this could be added to the redis-ai-resources or a blog and shared with the team to get everyone on board.
search-records tool to RedisVL MCPsearch-records tool to RedisVL MCP
…to feat/RAAE-1397/search-tool # Conflicts: # redisvl/mcp/server.py
…tool # Conflicts: # redisvl/mcp/config.py # redisvl/mcp/errors.py # redisvl/mcp/server.py # tests/integration/test_mcp/test_server_startup.py # tests/unit/test_mcp/test_config.py # tests/unit/test_mcp/test_errors.py
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2170d84. Configure here.
> Builds on top of #539 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Introduces a new MCP write path that validates, embeds, and loads user-supplied records into Redis, which could impact data integrity and performance if misused despite added validation and limits. > > **Overview** > Adds a new MCP tool, `upsert-records`, that accepts a batch of records, validates request shape and schema conformance, optionally generates missing vector embeddings via the configured vectorizer (with async/sync and batch fallbacks), and upserts them into the configured index while returning the resulting keys. > > Tool registration is wired into `RedisVLMCPServer` (disabled when `read_only`), exposed via `redisvl.mcp.tools.__all__`, and covered by new unit + integration tests including vector serialization for HASH storage, request/runtime limit enforcement, non-mutation of inputs, and error mapping that flags `partial_write_possible` on backend failures. > > Separately, `mcp/filters.py` is adjusted to use `typing.Union`/`List`/`Dict` annotations (dropping newer `|` syntax) without changing filter behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8aef518. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
) This PR is an aggregation of changes reviewed in the following PRs: - #531 - #532 - #539 - #540 - #544 - #547 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new MCP server surface area that performs schema inspection, embedding, and optional write operations against Redis, increasing operational and correctness risk despite extensive validation and tests. Optional dependency gating and Python-version checks reduce impact on core installs but the new server path could affect Redis access patterns and resource lifecycle. > > **Overview** > Adds an optional **RedisVL MCP server** that binds to one existing Redis Search index and exposes a stable tool contract for `search-records` and (unless *read-only*) `upsert-records`, driven entirely by a YAML config. > > Introduces new MCP configuration/settings loading with env var substitution, schema inspection plus `schema_overrides`, reserved-field and capability validation (including native vs fallback hybrid search), plus guarded concurrency/timeouts and deterministic error mapping. Updates the `rvl` CLI and docs/README/installation to support `redisvl[mcp]` (Python 3.10+) and adds comprehensive unit/integration tests; also tweaks filter type hints and ignores `.codex/`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6e2fe5b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->

This PR implements a tool for searching records in a configured index for the RedisVL MCP.
Note
Medium Risk
Adds a new MCP search tool and extends server startup/config validation, including runtime probing for native hybrid search; issues could affect MCP server startup or query behavior across Redis/redis-py versions.
Overview
Adds an MCP
search-recordstool that executes vector, fulltext, or hybrid searches against the configured index, with pagination, field projection, and normalized result formatting (stableid/score/score_type).Extends MCP YAML config with a required
searchsection (type+ validatedparams) and validates hybrid configs against runtime capabilities by probing redis/redis-py for native hybrid support during server startup.Introduces a structured filter DSL (
and/or/not, field ops likeeq/gte/in/exists) mapped to RedisVLFilterExpressions with a newINVALID_FILTERerror code; adds comprehensive unit/integration coverage and minor typing fixes inredisvl.query.filter.Reviewed by Cursor Bugbot for commit 078b779. Bugbot is set up for automated code reviews on this repo. Configure here.