feat(MCP): [4/5] add RedisVL MCP CLI#544
feat(MCP): [4/5] add RedisVL MCP CLI#544vishal-bala wants to merge 4 commits intofeat/RAAE-1398/upsert-toolfrom
Conversation
🛡️ 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: 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".
rbs333
left a comment
There was a problem hiding this comment.
LGTM! figure this goes after the other stuff
… feat/RAAE-1399-mcp-cli
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.
| else: | ||
| result = server.run(transport="stdio") | ||
| if inspect.isawaitable(result): | ||
| await result |
There was a problem hiding this comment.
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.


Summary
spec/MCP.mdincomplete in practice and left users without a supported way to run RedisVL as an MCP server.rvl mcpcommand, wiring in lazy optional-dependency handling, and rounding out the MCP server/config/tooling surface with tests and documentation updates.Testing
uv run python -m pytest tests/unit/test_cli_mcp.py -quv run python -m pytest tests/unit/test_mcp -quv run rvluv run rvl mcp --helpuv run rvl mcp --config /tmp/redisvl_mcp_smoke/config.yamlagainst a live Redis containeruvx --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 cutNote
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 mcpsubcommand that runs the RedisVL MCP server over stdio, including--config(required) and optional--read-onlyhandling.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.