Skip to content

feat(MCP): [4/5] add RedisVL MCP CLI#544

Merged
vishal-bala merged 35 commits intofeat/RAAE-1395-redisvl-mcpfrom
feat/RAAE-1399-mcp-cli
Apr 8, 2026
Merged

feat(MCP): [4/5] add RedisVL MCP CLI#544
vishal-bala merged 35 commits intofeat/RAAE-1395-redisvl-mcpfrom
feat/RAAE-1399-mcp-cli

Conversation

@vishal-bala
Copy link
Copy Markdown
Collaborator

@vishal-bala vishal-bala commented Mar 26, 2026

Builds on top of #540

Summary

  • The repo did not have an end-to-end MCP entrypoint, which made the MCP design in spec/MCP.md incomplete in practice and left users without a supported way to run RedisVL as an MCP server.
  • That gap creates friction for local agent integrations: the server contract, config, filters, and tools existed as design and implementation work, but there was no polished CLI path and no clear packaging/runtime story for using it.
  • This change completes the MCP implementation by adding the rvl mcp command, wiring in lazy optional-dependency handling, and rounding out the MCP server/config/tooling surface with tests and documentation updates.
  • It also adds task-oriented help text for the new subcommand and keeps the base CLI usable without MCP extras installed.

Testing

  • uv run python -m pytest tests/unit/test_cli_mcp.py -q
  • uv run python -m pytest tests/unit/test_mcp -q
  • uv run rvl
  • uv run rvl mcp --help
  • Manual smoke check: started uv run rvl mcp --config /tmp/redisvl_mcp_smoke/config.yaml against a live Redis container
  • uvx --from 'redisvl[mcp]' rvl mcp --config ... currently resolves the published package, which does not yet include the new extra/CLI path, so that install-path check is not green until a release is cut

Note

Medium Risk
Adds a new MCP CLI entrypoint and introduces an upsert-records tool that can write data into Redis indexes (including embedding generation/serialization), which could impact data integrity and runtime behavior if misconfigured.

Overview
Adds a new rvl mcp subcommand that lazily loads optional MCP dependencies, enforces Python >=3.10, and runs the MCP server over stdio with improved help/usage and error handling.

Extends the MCP server to conditionally register a new upsert-records tool when not in read-only mode, and exports it via redisvl.mcp.tools. The upsert tool validates request shape and schema, optionally generates missing embeddings via the configured vectorizer (with async/sync fallbacks), serializes HASH vector fields to buffers, and annotates backend failures as potentially partial writes.

Includes comprehensive unit/integration tests covering CLI behavior, read-only tool registration, embedding/serialization behavior, and request validation; plus minor typing tweaks in mcp/filters.py to avoid newer annotation syntax.

Reviewed by Cursor Bugbot for commit 9433eec. Bugbot is set up for automated code reviews on this repo. Configure here.

…h-tool

# Conflicts:
#	tests/integration/test_mcp/test_server_startup.py
@vishal-bala vishal-bala changed the base branch from main to feat/RAAE-1398/upsert-tool March 26, 2026 14:18
@vishal-bala vishal-bala changed the title feat: add RedisVL MCP CLI and server support feat: add RedisVL MCP CLI Mar 26, 2026
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Mar 26, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@vishal-bala vishal-bala changed the title feat: add RedisVL MCP CLI feat(MCP): add RedisVL MCP CLI Mar 26, 2026
@vishal-bala vishal-bala added the CLI Command Line Interface label Mar 26, 2026
@vishal-bala vishal-bala added the auto:minor Increment the minor version when merged label Mar 26, 2026
@vishal-bala vishal-bala self-assigned this Mar 26, 2026
@vishal-bala vishal-bala marked this pull request as ready for review March 26, 2026 14:48
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9441c1d942

ℹ️ 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".

Comment thread redisvl/cli/mcp.py
Copy link
Copy Markdown
Collaborator

@rbs333 rbs333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! figure this goes after the other stuff

@vishal-bala vishal-bala changed the title feat(MCP): add RedisVL MCP CLI feat(MCP): [4/5] add RedisVL MCP CLI Apr 2, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread redisvl/cli/mcp.py Outdated
…tool

# Conflicts:
#	redisvl/mcp/config.py
#	redisvl/mcp/filters.py
#	redisvl/mcp/server.py
#	redisvl/mcp/tools/__init__.py
#	tests/unit/test_mcp/test_config.py
Base automatically changed from feat/RAAE-1398/upsert-tool to feat/RAAE-1395-redisvl-mcp April 8, 2026 12:33
@vishal-bala vishal-bala merged commit df02343 into feat/RAAE-1395-redisvl-mcp Apr 8, 2026
118 of 119 checks passed
@vishal-bala vishal-bala deleted the feat/RAAE-1399-mcp-cli branch April 8, 2026 12:52
vishal-bala added a commit that referenced this pull request Apr 10, 2026
)

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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:minor Increment the minor version when merged CLI Command Line Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants