Integrate Model Context Protocol clients with Astra DB Serverless

query_builder 30 min

Model Context Protocol (MCP) extends the capabilities of Large Language Models (LLMs) by allowing them to interact with external systems as agents.

MCP is a standardized protocol designed for sharing context between language models and tools. MCP clients can access tools and data from MCP servers based on natural language queries, enabling language models to execute functions agentically on your behalf. You don’t need to write any code because the MCP client manages those interactions for you.

This guide demonstrates how you can use Astra DB MCP servers and an MCP client to create and manage Astra DB Serverless (Vector) databases without writing any code.

Prerequisites

Add an astra-db-mcp server to your MCP client

Use an Astra DB MCP server to interact with Astra DB through an MCP client.

The following examples demonstrate how to add an astra-db-mcp server to Claude for Desktop and Cursor, but there are other MCP clients available.

  • Claude for Desktop

  • Cursor

In Claude for Desktop, you can configure an astra-db-mcp server in the same way as other MCP servers. For more information about this process and the claude_desktop_config.json file, see the MCP Claude for Desktop quickstart.

  1. Open Claude for Desktop, and then go to the program settings. For example, on the MacOS menu bar, click Claude, and then select Settings.

  2. In the Settings dialog, click Developer, and then click Edit Config. This creates a claude_desktop_config.json file if you don’t already have one.

  3. Open the claude_desktop_config.json file in a text editor, and then add the astra-db-mcp server configuration:

    {
      "mcpServers": {
        "astra-db-mcp": {
          "command": "npx",
          "args": ["-y", "@datastax/astra-db-mcp"],
          "env": {
            "ASTRA_DB_APPLICATION_TOKEN": "APPLICATION_TOKEN",
            "ASTRA_DB_API_ENDPOINT": "API_ENDPOINT"
          }
        }
      }
    }

    Replace APPLICATION_TOKEN and API_ENDPOINT with your database’s API endpoint and a valid application token. For more information, see Prerequisites.

  4. Restart Claude for Desktop.

  5. In the input box, click MCP tools to view the tools included with the astra-db-mcp server.

    If MCP tools is missing or the astra-db-mcp server tools aren’t listed, see MCP Claude for Desktop troubleshooting.

    For more information about the available tools, see the Astra DB MCP server repository.

  6. To test the server and use the astra-db-mcp tools, use natural language queries to interact with Claude in Claude for Desktop.

    Based on your queries, Claude determines when to call astra-db-mcp tools, asks you for additional input, and asks permission before running tools. If necessary, Claude asks permission before running a tool. This can range from simple, single-tool queries to more complex queries that require multiple tools and leverage other LLM functionality. For examples, see the Astra DB MCP demo video.

  7. To verify changes to your database, open the Astra Portal, select your database, and then click Data Explorer.

    For example, if you ask Claude to create a collection, you can confirm that the collection is listed in the Astra Portal.

  8. To connect to other databases, change the application token and API endpoint in your astra-db-mcp server configuration.

In Cursor, you can configure an astra-db-mcp server in the same way as other MCP servers. For more information, see the Cursor MCP documentation.

  1. Open Cursor, and then go to Cursor Settings.

  2. Click MCP, and then click Add New MCP Server.

  3. For Name, enter a human-readable name for the server, such as astra-db.

  4. For Type, select command to use the stdio library.

  5. For Command, enter the following shell script that will run the astra-db-mcp server and use the specified environment variables to connect to your database:

    env ASTRA_DB_APPLICATION_TOKEN=APPLICATION_TOKEN ASTRA_DB_API_ENDPOINT=API_ENDPOINT npx -y @datastax/astra-db-mcp

    Replace APPLICATION_TOKEN and API_ENDPOINT with your database’s API endpoint and a valid application token. For more information, see Prerequisites.

  6. Click Add.

  7. In the MCP Servers list, hover over the available tools to get information about the astra-db-mcp tools.

    If your server doesn’t automatically appear in the MCP Servers list, restart Cursor.

    If the Tools list doesn’t automatically populate, click Refresh.

    For more information about the available tools, see the Astra DB MCP server repository.

  8. To test the server and use the astra-db-mcp tools, open the Composer chat window, select Agent, and then use natural language queries to interact with Composer Agent.

    Based on your queries, Agent determines when to call astra-db-mcp tools, asks you for additional input, and asks permission before running tools. This can range from simple, single-tool queries to more complex queries that require multiple tools and leverage other LLM functionality. For examples, see the Astra DB MCP demo video.

  9. To verify changes to your database, open the Astra Portal, select your database, and then click Data Explorer.

    For example, if you ask Agent to create a collection, you can confirm that the new collection is listed in the Astra Portal.

  10. To connect to other databases, change the application token and API endpoint in your astra-db-mcp server configuration.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com