# MCP Astra DB

Use the [MCP server component](https://guidenai.gitbook.io/broxi/advanced/mcp-connect) to connect Broxi to a [Datastax Astra DB MCP server](https://guidenai.gitbook.io/broxi/advanced/mcp-astra-db).

1. Install an LTS release of [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
2. Create an [OpenAI](https://platform.openai.com/) API key.
3. Create an [Astra DB Serverless (Vector) database](https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html#create-vector-database), if you don't already have one.
4. 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](https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html#database-token).
5. Create a Simple agent starter project.
6. Remove the **URL** tool and replace it with an [MCP server](https://guidenai.gitbook.io/broxi/advanced/mcp-connect) component. The flow should look like this:![MCP stdio component](https://docs.langflow.org/assets/images/mcp-server-component-1335e50a6b27980cadb99acc22273562.png)
7. In the **MCP server** component, in the **MCP command** field, add the following code. Replace the values for `ASTRA_TOKEN` and `ASTRA_ENDPOINT` with the values from your Astra database.

```javascript
env ASTRA_DB_APPLICATION_TOKEN=ASTRA_TOKEN ASTRA_DB_API_ENDPOINT=ASTRA_ENDPOINT npx -y @datastax/astra-db-mcpnpx -y @datastax/astra-db-mcp
```

8. In the **Agent** component, add your **OpenAI API key**.
9. Open the **Playground**, and then ask the agent, `What collections are available?`

Since BroxiAI 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.

```
The available collections in your database are:
collection_002
hardware_requirements
load_collection
nvidia_collection
software_requirements
```
