Astra DB — Claude Code MCP server: what it does, how to install
MCP server for Astra DB operations: vector search, collections, tables, and keyspace management through the agent.
no license updated 2026-10-29
Open on GitHubWhat Astra DB does
The server exposes over forty tools for document collections, vector search, structured tables, and keyspace administration. The agent can create collections with vector indexes and distance metrics, run natural language queries via serverless Vectorize embeddings, execute hybrid search with reranking, insert and update documents in batches, work with typed tables through Data API v2, manage keyspaces, and switch between them.
You need an Astra DB application token (ASTRA_DB_APPLICATION_TOKEN) and API endpoint (ASTRA_DB_API_ENDPOINT) from the database console after registration. Set ASTRA_DB_KEYSPACE to target a specific keyspace; if omitted, the server uses default_keyspace from library settings. Windows PowerShell requires wrapping the npx command with cmd /k.
The server handles MongoDB-style filter operators ($and, $or, $gt, $in, $exists), vector similarity metrics cosine, euclidean, and dot_product, field projection, sorting, and pagination.
What it helps with
- run vector similarity search on a collection with metadata filters
- create a table with a vector index and primary key
- query documents using natural language via Vectorize
- batch insert multiple records in one operation
- switch to another keyspace and list its tables
Example prompts for the agent
- Find five nearest vectors to
[0.1, 0.5, 0.3]inproductscollection usingcosinemetric - Create collection
articleswith 1536-dimensional vector field andeuclideanmetric - Run hybrid search on
docscollection: text 'database setup' plus query vector, rerank results
How to install Astra DB
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Astra DB
How to install Astra DB in Claude Code?
Open editor settings, locate the MCP servers section, and add an entry with command npx -y @datastax/astra-db-mcp, passing ASTRA_DB_APPLICATION_TOKEN and ASTRA_DB_API_ENDPOINT from your Astra DB console in the env block.
What does Astra DB do?
Connects the agent to an Astra DB database: creates collections and tables, searches by vectors and natural language, inserts and updates documents, manages keyspaces and indexes.
Which vector search metrics does Astra DB support?
The server works with cosine, euclidean, and dot_product metrics when creating vector indexes and running search queries.