Skip to content

feat(MCP): Implement the base framework for a RedisVL MCP server#532

Open
vishal-bala wants to merge 6 commits intofeat/RAAE-1395-redisvl-mcpfrom
feat/RAAE-1396/mcp-framework
Open

feat(MCP): Implement the base framework for a RedisVL MCP server#532
vishal-bala wants to merge 6 commits intofeat/RAAE-1395-redisvl-mcpfrom
feat/RAAE-1396/mcp-framework

Conversation

@vishal-bala
Copy link
Collaborator

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

This PR implements the base framework for a RedisVL MCP server. In this iteration, the goal is to introduce the scaffolding for the MCP server to the extent that the server is runnable but does not have any meaningful functionality.


Note

Medium Risk
Introduces a new MCP server surface area that manages Redis index lifecycle and vectorizer initialization with concurrency/timeouts; failures here could impact startup/shutdown behavior and dependency handling when the mcp extra is used.

Overview
Adds a new optional redisvl.mcp package (guarded behind a new mcp extra) that can start and manage an MCP server process around RedisVL: YAML-driven config loading (with ${VAR}/${VAR:-default} env substitution), runtime limits validation, and vectorizer class resolution.

Implements RedisVLMCPServer startup/shutdown lifecycle to create/validate an AsyncSearchIndex, build a configured vectorizer off-thread, enforce request concurrency/timeouts via a semaphore, and fail fast on vector-dimension mismatches; adds deterministic exception mapping via map_exception.

Updates import-sanity tests to skip redisvl.mcp when optional deps aren’t installed, and adds unit/integration tests covering config parsing/validation, settings env overrides, error mapping, and server startup/shutdown cleanup behavior.

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

@vishal-bala vishal-bala changed the base branch from main to feat/RAAE-1395-redisvl-mcp March 12, 2026 10:15
@jit-ci
Copy link

jit-ci bot commented Mar 12, 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 Ensure MCP server always disconnects index during shutdown feat(MCP): Implement the base framework for a RediVL MCP server Mar 12, 2026
@vishal-bala vishal-bala self-assigned this Mar 12, 2026
@vishal-bala vishal-bala added the auto:minor Increment the minor version when merged label Mar 12, 2026
Copy link

@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: cf0f0895a2

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

@vishal-bala vishal-bala requested review from nkanu17 and rbs333 March 12, 2026 12:01
@vishal-bala vishal-bala changed the title feat(MCP): Implement the base framework for a RediVL MCP server feat(MCP): Implement the base framework for a RedisVL MCP server Mar 13, 2026
Copy link

@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 2 potential issues.

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.

def vector_field_dims(self) -> Optional[int]:
"""Return the configured vector dimension when the field exposes one."""
attrs = self.vector_field.attrs
return getattr(attrs, "dims", None)
Copy link

Choose a reason for hiding this comment

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

Repeated schema reconstruction on every property access

Low Severity

The vector_field and vector_field_dims properties each call to_index_schema(), which fully reconstructs and re-validates an IndexSchema via model_validate on every access. The model validator _validate_runtime_mapping also calls to_index_schema(). Any code path accessing vector_field_dims (e.g., _validate_vectorizer_dims during startup) triggers two redundant schema constructions. Caching the result or computing these values once during validation would avoid the repeated work.

Additional Locations (1)
Fix in Cursor Fix in Web

return await asyncio.wait_for(
awaitable,
timeout=self.config.runtime.request_timeout_seconds,
)
Copy link

Choose a reason for hiding this comment

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

Unawaited coroutine leak in early guard path

Low Severity

run_guarded accepts an Awaitable[Any] parameter. If the caller passes a coroutine and the early guard (self.config is None or self._semaphore is None) raises RuntimeError, the coroutine is never awaited. Python emits a RuntimeWarning: coroutine was never awaited in this case, which can obscure the actual error during debugging.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant