Provides tools for interacting with Astra DB (DataStax Astra), enabling database operations and data management through DataStax's cloud-native database platform.
Astra MCP Server
A Model Context Protocol (MCP) server for interacting with Astra DB (DataStax Astra).
Running it as MCP Server with STDIO
To run the astra-mcp-server as MCP Server with STDIO, you can use the following command:
Running it as MCP Server with HTTP
To run the astra-mcp-server as MCP Server with STDIO, you can use the following command:
App options
--transport <transport>
: The transport to use for the MCP Server. Valid values arestdio
andhttp
. Default isstdio
.--astra_token <astra_token>
: The Astra token to use for the Astra DB connection. If not filled, the app will try to get the token from theASTRA_DB_APPLICATION_TOKEN
environment variable.--astra_endpoint <astra_endpoint>
: The Astra endpoint to use for the Astra DB connection. If not filled, the app will try to get the endpoint from theASTRA_DB_API_ENDPOINT
environment variable.--tags <tags>
: The tags to filter the tools for the MCP Server.
Catalog options
--catalog_file <catalog_file>
: The catalog file to use for the MCP Server. Default istools_config.json
. If not filled, the app will try to get the catalog from theASTRA_DB_CATALOG_COLLECTION
environment variable.--catalog_collection <catalog_collection>
: The catalog collection to use for the MCP Server. Default istool_catalog
. If not filled, the app will try to get the catalog from theASTRA_DB_CATALOG_COLLECTION
environment variable.
Options valid for the HTTP transport:
When running the app as HTTP, you can use the following options:
--host <host>
: The host to use for the MCP Server. Default is127.0.0.1
.--port <port>
: The port to use for the MCP Server. Default is8000
.--workers <workers>
: The number of worker processes to use for the MCP Server. Default is1
.--log-level <log_level>
: The log level to use for the MCP Server. Valid values aredebug
,info
,warning
, anderror
. Default isinfo
.--log-file <log_file>
: The log file to use for the MCP Server. Default islogs/astra_mcp_server.log
.
1. Set up environment variables
If you are running the app with some MCP Client that allows you to define environment variables, you can set the same variables in the MCP Client.
If you prefer, you can create a .env
file in app directory with the following variables:
Creating tools
Tools are created based on a json specification. It can be save to a file or to a Astra DB collection (preferable for production use cases).
A tools specifiction json needs the following fields:
Save the json document to the file or to the Astra DB collection. When the server is started, it will load the tools from the file or the Astra DB collection.
After storing on Astra DB, the tools will appear in the Astra DB collection like this:
Updating tools
To update the tools, you can update the json document and save it to the file or to the Astra DB collection.
Local Development
Alternative: Direct uvicorn (for development)
Using MCP Inspector (STDIO)
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with DataStax Astra DB through the Model Context Protocol. Provides database connectivity and operations for Astra DB instances via secure token-based authentication.