Wide-column distributed database
## Apache Cassandra MCP Server: Distributed NoSQL Database The **Apache Cassandra MCP Server** integrates Cassandra into Google Antigravity, enabling distributed database operations with high availability, linear scalability, and fault tolerance directly from your development environment. ### Why Cassandra MCP? - **Linear Scalability**: Add nodes for linear performance increase - **High Availability**: No single point of failure - **Geographic Distribution**: Multi-datacenter replication - **Write Performance**: Optimized for high write throughput - **Proven Scale**: Powers Netflix, Apple, Instagram ### Key Features #### 1. CQL Queries ```python # Execute CQL query result = await mcp.execute( query=""" SELECT user_id, email, created_at FROM users WHERE partition_key = ? LIMIT 100 """, parameters=["partition_value"] ) for row in result["rows"]: print(f"User: {row['email']}") ``` #### 2. Data Operations ```python # Insert data await mcp.execute( query=""" INSERT INTO events (event_id, user_id, event_type, data, timestamp) VALUES (?, ?, ?, ?, toTimestamp(now())) """, parameters=[uuid4(), user_id, "page_view", json.dumps(data)] ) # Batch insert await mcp.batch([ {"query": "INSERT INTO events ...", "parameters": [...]}, {"query": "INSERT INTO events ...", "parameters": [...]}, {"query": "INSERT INTO events ...", "parameters": [...]} ]) ``` #### 3. Schema Operations ```python # Create keyspace await mcp.execute(""" CREATE KEYSPACE IF NOT EXISTS myapp WITH replication = { 'class': 'NetworkTopologyStrategy', 'datacenter1': 3 } """) # Create table await mcp.execute(""" CREATE TABLE IF NOT EXISTS myapp.events ( partition_key text, event_time timestamp, event_id uuid, data text, PRIMARY KEY ((partition_key), event_time, event_id) ) WITH CLUSTERING ORDER BY (event_time DESC) """) ``` #### 4. Cluster Operations ```python # Get cluster info info = await mcp.get_cluster_info() print(f"Cluster: {info['cluster_name']}") print(f"Nodes: {len(info['nodes'])}") # Get keyspaces keyspaces = await mcp.get_keyspaces() for ks in keyspaces: print(f"Keyspace: {ks['name']} - RF: {ks['replication_factor']}") ``` ### Configuration ```json { "mcpServers": { "cassandra": { "command": "npx", "args": ["-y", "@anthropic/mcp-cassandra"], "env": { "CASSANDRA_HOSTS": "node1.example.com,node2.example.com", "CASSANDRA_KEYSPACE": "myapp", "CASSANDRA_USERNAME": "cassandra", "CASSANDRA_PASSWORD": "your-password" } } } } ``` ### Use Cases **Time-Series Data**: Store high-volume event and sensor data. **User Activity**: Track user actions across distributed systems. **IoT Data**: Collect and query IoT device telemetry. **Messaging**: Build scalable messaging and notification systems. The Cassandra MCP enables distributed database operations within your development environment.
{
"mcpServers": {
"cassandra": {
"mcpServers": {
"cassandra": {
"env": {
"CASSANDRA_HOSTS": "localhost",
"CASSANDRA_KEYSPACE": "your_keyspace"
},
"args": [
"-y",
"cassandra-mcp-server"
],
"command": "npx"
}
}
}
}
}