You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RisingWave MCP Server is a comprehensive Model Context Protocol (MCP) server that lets you query and manage your RisingWave streaming database using natural language through AI assistants like VS Code Copilot and Claude Desktop.
Features
Real-time access to RisingWave tables, materialized views, and streaming data
Complete management of sources, sinks, connections, indexes, and UDFs
Streaming job monitoring with fragment, actor, and backfill tracking
User: Show me all tables in the public schema
Assistant: [calls show_tables]
User: What's in the orders table?
Assistant: [calls describe_table with table_name="orders"]
User: Get me the last 10 orders
Assistant: [calls run_select_query with query="SELECT * FROM orders ORDER BY created_at DESC LIMIT 10"]
Monitor Streaming Jobs
User: What's the backfill progress?
Assistant: [calls get_backfill_progress]
User: Show me the cluster status
Assistant: [calls show_cluster]
User: Are there any running jobs?
Assistant: [calls show_jobs]
Manage Objects
User: Create a materialized view that counts orders per customer
Assistant: [calls create_materialized_view with appropriate SQL]
User: Change the parallelism of mv_orders to 4
Assistant: [calls alter_mv_parallelism with mv_name="mv_orders", parallelism="4"]
User: Drop the old_source source
Assistant: [calls drop_source with source_name="old_source"]
Debug Performance
User: Explain this query: SELECT * FROM orders WHERE status = 'pending'
Assistant: [calls explain_query]
User: What's the storage usage for each table?
Assistant: [calls get_all_table_storage_stats]
User: Check for data skew in the orders table
Assistant: [calls check_vnode_distribution with table_name="orders", distribution_key="customer_id"]
Testing
The MCP server includes comprehensive testing tools:
1. Unit Tests (with mocked connections)
# Install test dependencies
pip install pytest
# Run all unit tests
pytest tests/test_tools.py -v
# Run specific test class
pytest tests/test_tools.py::TestSchemaTools -v
# Set connection stringexport RISINGWAVE_CONNECTION_STR="postgresql://root:root@localhost:4566/dev"# Run all integration tests
python tests/integration_test.py
# Run specific category
python tests/integration_test.py --category schema
python tests/integration_test.py --category cluster
python tests/integration_test.py --category streaming
# Verbose output
python tests/integration_test.py -v
Available test categories: schema, source, sink, cluster, management, session, streaming, storage, catalog, connection, secret, function, user, explain, query
3. Interactive MCP Inspector
# Start interactive mode
python tests/mcp_inspector.py
# List all tools
python tests/mcp_inspector.py --list
# List tools by category
python tests/mcp_inspector.py --list --category schema
# Run a specific tool
python tests/mcp_inspector.py --tool show_tables
# Run a tool with arguments
python tests/mcp_inspector.py --tool describe_table --args '{"table_name": "orders"}'
Interactive mode commands:
mcp> list # List all tools
mcp> list schema # List schema tools
mcp> run show_tables # Run a tool
mcp> run describe_table {"table_name": "orders"} # Run with args
mcp> help show_cluster # Show tool details
mcp> quit # Exit
4. Manual Testing with MCP CLI
If you have the MCP CLI installed:
# Test the server directlyecho'{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'| python src/main.py
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.