Skip to content

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

Open
vishal-bala wants to merge 4 commits intofeat/RAAE-1398/upsert-toolfrom
feat/RAAE-1399-mcp-cli
Open

feat(MCP): [4/5] add RedisVL MCP CLI#544
vishal-bala wants to merge 4 commits intofeat/RAAE-1398/upsert-toolfrom
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 async CLI entrypoint that loads optional MCP dependencies at runtime and manages server startup/run/shutdown; failures here affect how users launch MCP but do not change core indexing logic.

Overview
Adds a new rvl mcp subcommand that runs the RedisVL MCP server over stdio, including --config (required) and optional --read-only handling.

The new CLI path lazily imports redisvl.mcp (so the base CLI works without MCP extras), validates Python >= 3.10, and provides clearer error messaging and shutdown behavior for async server lifecycles.

Introduces unit tests covering dispatch, help text, version/dependency failures, read-only flag propagation, and startup/run error handling.

Written by Cursor Bugbot for commit e705fbb. This will update automatically on new commits. Configure here.

@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 CLI Command Line Interface auto:minor Increment the minor version when merged labels 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".

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.

else:
result = server.run(transport="stdio")
if inspect.isawaitable(result):
await result
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Double startup causes "already running" error at runtime

High Severity

_serve explicitly calls server.startup() before run_async(transport="stdio"), but FastMCP's run_async will invoke the _server_lifespan context manager passed during construction, which also calls self.startup(). The guard in _begin_startup raises RuntimeError("MCP server is already running") when lifecycle state is already RUNNING, so the server immediately errors out and never actually serves. All tests use fake servers that lack run_async, so they always exercise the else branch and never trigger the lifespan-mediated double-startup path that production code follows.

Fix in Cursor Fix in Web

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