feat(mcp): add --database-url CLI option for direct Redis connections #574
+138
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add support for connecting to Redis databases via URL without requiring a profile. This is useful for ad-hoc connections to standalone Redis instances that aren't configured as profiles.
Changes
--database-urloption tomcp servecommand (also supportsREDIS_URLenv var)DatabaseTools::new_from_url()constructor for URL-based connectionsget_database_tools()to prefer URL over profile when both availableUsage
The URL format follows the standard Redis URL scheme:
redis[s]://[[username:]password@]host[:port][/db]Why
Users may want to use the MCP server with a Redis database that isn't managed by Redis Enterprise or Cloud (e.g., a local Redis instance, self-hosted Redis, or third-party managed Redis). This allows quick connections without needing to set up a profile first.