A Model Context Protocol (MCP) server that provides read-only access to RethinkDB databases. This server enables AI assistants like Claude to safely query and explore RethinkDB data without the risk of accidental modifications.
- Read-only operations: Only allows data reading, no mutations - safe for AI assistants
- Four tools available:
list_databases- List all databaseslist_tables- List tables in a databasequery_table- Query data with filtering, ordering, and limitstable_info- Get table metadata (primary key, indexes, doc count)
- Easy integration with Claude Desktop and other MCP clients
- Secure connection support with username/password authentication
- Docker support - Pre-built image available on Docker Hub
- Go 1.23 or higher - Download Go (for building from source)
- RethinkDB - Running instance (local or remote)
- RethinkDB Installation Guide
- Default connection:
localhost:28015
- MCP Client (optional for testing):
- Claude Desktop app, or
- MCP Inspector:
npx @modelcontextprotocol/inspector
docker pull finn13/mcp-rethinkdb-server
# Run with default settings (connects to localhost:28015)
docker run -e RETHINKDB_HOST=host.docker.internal finn13/mcp-rethinkdb-server
# Run with custom settings
docker run \
-e RETHINKDB_HOST=your-host \
-e RETHINKDB_PORT=28015 \
-e RETHINKDB_USER=admin \
-e RETHINKDB_PASSWORD=secret \
finn13/mcp-rethinkdb-server# Clone the repository
git clone https://github.com/finn13/mcp-rethinkdb-server.git
cd mcp-rethinkdb-server
# Install dependencies
go mod tidy
# Build the binary
go build -o mcp-rethinkdb-server .Environment variables:
| Variable | Default | Description |
|---|---|---|
RETHINKDB_HOST |
localhost |
RethinkDB host |
RETHINKDB_PORT |
28015 |
RethinkDB port |
RETHINKDB_USER |
(none) | Optional username |
RETHINKDB_PASSWORD |
(none) | Optional password |
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"rethinkdb": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"RETHINKDB_HOST=host.docker.internal",
"finn13/mcp-rethinkdb-server"
]
}
}
}{
"mcpServers": {
"rethinkdb": {
"command": "/absolute/path/to/mcp-rethinkdb-server",
"env": {
"RETHINKDB_HOST": "localhost",
"RETHINKDB_PORT": "28015"
}
}
}
}Important: After updating the config, restart Claude Desktop completely.
# Default connection (localhost:28015)
./mcp-rethinkdb-server
# Custom host/port
RETHINKDB_HOST=myhost RETHINKDB_PORT=28015 ./mcp-rethinkdb-server
# With authentication
RETHINKDB_HOST=myhost RETHINKDB_USER=admin RETHINKDB_PASSWORD=secret ./mcp-rethinkdb-serverLists all databases in RethinkDB.
{
"name": "list_databases"
}Response:
{
"databases": ["test", "production", "analytics"]
}Lists all tables in a specific database.
{
"name": "list_tables",
"arguments": {
"database": "test"
}
}Response:
{
"database": "test",
"tables": ["users", "orders", "products"]
}Query data from a table with optional filtering, ordering, and limits.
{
"name": "query_table",
"arguments": {
"database": "test",
"table": "users",
"filter": {"status": "active"},
"limit": 50,
"order_by": "created_at"
}
}Response:
{
"database": "test",
"table": "users",
"count": 50,
"results": [...]
}Parameters:
database(required): Database nametable(required): Table namefilter(optional): Filter object for matching documentslimit(optional): Max results (default: 100, max: 1000)order_by(optional): Field to sort by
Get table metadata including primary key, indexes, and document count.
{
"name": "table_info",
"arguments": {
"database": "test",
"table": "users"
}
}Response:
{
"database": "test",
"table": "users",
"primary_key": "id",
"indexes": ["email", "created_at"],
"doc_count": 15420
}The MCP Inspector provides a web-based interface to test your server:
go build -o mcp-rethinkdb-server .
npx @modelcontextprotocol/inspector ./mcp-rethinkdb-serverOpen your browser to the URL shown (usually http://localhost:5173) to interact with the server.
Future improvements and features under consideration:
- Joins: Support for
eqJoin,innerJoin,outerJoinoperations - Aggregations: Add
group,ungroup,count,sum,avg,min,maxoperations - Map/Reduce: Support for
map,concatMap,foldfor complex transformations - Advanced Filtering: Support for
between,contains, nested field queries - Geospatial Queries: Support for
getIntersectingand geospatial indexes
- Schema Inspector: Tool to explore table schemas and relationships
- Index Management: View and analyze index usage and performance
- Query Builder: Interactive query construction with validation
- Changefeeds: Real-time data monitoring (read-only subscriptions)
- Query Caching: Cache frequently accessed queries
- Parallel Queries: Support multiple simultaneous queries
- Result Streaming: Stream large result sets efficiently
- Query Statistics: Execution time and resource usage metrics
- Interactive Examples: More comprehensive example queries
- Query Validation: Better error messages and query syntax validation
- Connection Pooling: Improved connection management
- TLS/SSL Support: Secure connections to RethinkDB
Problem: Server can't connect to RethinkDB
Solution:
- Verify RethinkDB is running:
rethinkdb --version - Check the host and port settings
- Test connection manually
Problem: Server not showing up in Claude
Solution:
- Verify the path/docker command in config is correct
- Restart Claude Desktop completely
- Check Claude logs:
~/Library/Logs/Claude/(macOS)
Problem: Permission denied when executing binary
Solution:
chmod +x /path/to/mcp-rethinkdb-serverProblem: Query returns fewer results than expected
Solution:
- Default limit is 100 documents
- Maximum limit is 1000 documents
- Use the
limitparameter to adjust
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
go test ./... - Commit:
git commit -am 'Add feature' - Push:
git push origin feature-name - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.