Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

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

  • Add --database-url option to mcp serve command (also supports REDIS_URL env var)
  • Add DatabaseTools::new_from_url() constructor for URL-based connections
  • Update get_database_tools() to prefer URL over profile when both available
  • Update MCP documentation with both connection approaches (URL and profile-based)
  • Add unit test for database_url configuration

Usage

# Via command line
redisctl mcp serve --database-url redis://localhost:6379

# Via environment variable
REDIS_URL=redis://localhost:6379 redisctl mcp serve

# With authentication
redisctl mcp serve --database-url redis://:password@localhost:6379

# TLS connection
redisctl mcp serve --database-url rediss://default:password@host:6379

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.

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:
- Add --database-url option to 'mcp serve' command (supports REDIS_URL env)
- Add DatabaseTools::new_from_url() constructor for URL-based connections
- Update get_database_tools() to prefer URL over profile when both available
- Update MCP documentation with both connection approaches
- Add unit test for database_url configuration

The URL format follows the standard Redis URL scheme:
redis[s]://[[username:]password@]host[:port][/db]
@joshrotenberg joshrotenberg merged commit 6bc5972 into main Jan 19, 2026
22 checks passed
@joshrotenberg joshrotenberg deleted the feat/mcp-database-url branch January 19, 2026 23:01
@joshrotenberg joshrotenberg mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants