Skip to main content

Prerequisites

Before you can configure and use Replit with Connect AI, you must first do the following:
  • Install the Replit IDE.
  • Connect a data source to your Connect AI account. See Sources for more information.
  • Generate a Personal Access Token (PAT) on the Settings page. Copy this down, as it acts as your password during authentication.
  • Base64-encode your Connect AI credentials in the following format: Base64("email:PAT").
  • Obtain an OpenAI API key: https://platform.openai.com/.

Connect Replit to the Connect AI MCP

1
Open the official Replit MCP learning template available here. This template includes a preconfigured MCP runtime environment and sample configuration.
2
In Replit, click Remix. Replit does the following:
  • Creates a editable copy of the project.
  • Installs MCP dependencies.
  • Initializes the environment.
Wait for the environment to fully load before continuing.
3
Inside the project is a file named mcp-server-config.json. Copy and paste the following into this file. Replace the authorization header with the Base64-encoded credentials obtained in the prerequisites.
{
  "systemPrompt": "You are a helpful AI assistant.

Today's date is {today_datetime}.",
  "llm": {
    "provider": "openai",
    "model": "gpt-4o-mini"
  },
  "mcpServers": {
    "cdata-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.cloud.cdata.com/mcp",
        "--header",
        "Authorization": "Basic BASE64_ENCODED_EMAIL:PAT" //Authorization obtained in prerequisites
      ]
    }
  }
}
4
Replit requires an LLM key to run MCP workflows. In the Replit Chat, when asked for an LLM key, provide your OpenAI API key. Replit stores this key securely in the Secrets Manager.
5
You can now open the Replit Chat panel and issue MCP commands.For example, enter the prompt "List all MCP tools." The output looks like the following:
Replit Test Output
6
To test whether Replit can communicate with the CData MCP successfully, enter the prompt: "Show me all available catalogs." Replit should return a list of catalogs from Connect AI.
7
You can now query your connected data source(s) in Connect AI using the Replit’s LLM.