How datastax/astra-db-mcp works
Astra DB MCP Server exposes database operations as MCP tools: an MCP client requests an operation, the server dispatches it to a tool implementation, and the tool queries or changes Astra DB. The README documents collection/document management, vector and hybrid search, tables, keyspaces, administration, and client utilities. The sampled tools use a shared database connection; some query results are sanitized before returning. Tool dispatch is directly visible for selected operations in index.ts, but unsampled handlers are represented at subsystem level based on README capabilities.
Main entry points: index.ts MCP server · db.ts DB connection · sanitize.ts Result sanitizer · tools Record queries
Components 16
MCP runtime
- MCP server
index.ts - Tool schemas
tools.ts
Collections and documents
- Collection operations
tools - Document operations
tools
Search and ranking
- Record queries
tools - Vector search
tools/VectorSearch.ts - Hybrid and rerank
tools/HybridSearch.ts
Tables
- Table operations
tools
Keyspace and administration
- Keyspace operations
tools - Database metadata
tools/GetDatabaseInfo.ts - Model providers
tools/ListEmbeddingProviders.ts - Client utilities
tools
Shared services
- DB connection
util/db.ts - Result sanitizer
util/sanitize.ts
Other components
- MCP client
- Astra DB
Connections 26
- MCP client → MCP server: requests tools
README.md - MCP server → Collection operations: dispatches
index.ts - MCP server → Document operations: dispatches
index.ts - MCP server → Record queries: dispatches
index.ts - MCP server → Vector search: dispatches
index.ts - MCP server → Hybrid and rerank: dispatches
index.ts - MCP server → Table operations: dispatches
index.ts - MCP server → Keyspace operations: dispatches
index.ts - MCP server → Database metadata: dispatches
index.ts - MCP server → Model providers: dispatches
index.ts - MCP server → Tool schemas: advertises tools
index.ts - Collection operations → DB connection: uses
tools/CreateCollection.ts - Document operations → DB connection: uses
tools/CreateRecord.ts - Record queries → DB connection: queries
tools/FindRecord.ts - Vector search → DB connection: queries
tools/VectorSearch.ts - Hybrid and rerank → DB connection: queries
tools/HybridSearch.ts - Table operations → DB connection: queries
tools/QueryTable.ts - Keyspace operations → DB connection: uses
tools/CreateKeyspace.ts - Database metadata → DB connection: reads metadata
tools/GetDatabaseInfo.ts - Model providers → DB connection: lists providers
tools/ListEmbeddingProviders.ts - Client utilities → MCP client: assists setup
README.md - DB connection → Astra DB: connects
util/db.ts - Record queries → Result sanitizer: sanitizes results
tools/FindRecord.ts - Vector search → Result sanitizer: sanitizes results
tools/VectorSearch.ts - Hybrid and rerank → Result sanitizer: sanitizes results
tools/HybridSearch.ts - Table operations → Result sanitizer: sanitizes rows
tools/QueryTable.ts