Connect an Astra DB MCP server to NebulaAIFlow
Use the MCP server component to connect NebulaAIFlow to a Datastax Astra DB MCP server.
- Install an LTS release of Node.js.
- Create an OpenAI API key.
- Create an Astra DB Serverless (Vector) database, if you don't already have one.
- Get your database's Astra DB API endpoint and an Astra DB application token with the Database Administrator role. For more information, see Generate an application token for a database.
- Create a Simple agent starter project.
- Remove the URL tool and replace it with an MCP server component.
The flow should look like this:
- In the MCP server component, in the MCP command field, add the following code.
Replace the values for
ASTRA_TOKEN
andASTRA_ENDPOINT
with the values from your Astra database.
_10env ASTRA_DB_APPLICATION_TOKEN=ASTRA_TOKEN ASTRA_DB_API_ENDPOINT=ASTRA_ENDPOINT npx -y @datastax/astra-db-mcpnpx -y @datastax/astra-db-mcp
- In the Agent component, add your OpenAI API key.
- Open the Playground, and then ask the agent,
What collections are available?
Since NebulaAIFlow is connected to your Astra DB database through the MCP, the agent chooses the correct tool and connects to your database to retrieve the answer.
_10The available collections in your database are:_10collection_002_10hardware_requirements_10load_collection_10nvidia_collection_10software_requirements