mcpdata Request an invite

Answers / Connect your AI

How do I connect Claude Desktop to a database?

Recipe verified on Ran on the public demo (read-only) Tested: the address and key header below, with an MCP client; Claude Desktop's settings as Anthropic documents them
Short answer

Add a database's MCP server to Claude Desktop's config file. For mcpdata that's a remote server (https://[you].mcpdata.org/mcp) with your API key, reached through the mcp-remote bridge; after a restart, Claude can list your tables and query them.

Steps

  1. Open the config file. In Claude Desktop: Settings, Developer, Edit Config. It opens claude_desktop_config.json.
  2. Add the server. This one points at the public demo (read-only, synthetic data); for your own instance use its address and your key:
    {
      "mcpServers": {
        "mcpdata-demo": {
          "command": "npx",
          "args": ["-y", "mcp-remote", "https://demo.mcpdata.org/mcp", "--header", "Authorization:${AUTH}"],
          "env": { "AUTH": "Bearer cdb_live_PkVoldus8qcE-hqffjajNZzQwiA7rTHMoR4RLSAxsCE" }
        }
      }
    }
  3. Restart Claude Desktop. The mcpdata tools appear in the tools menu of a new chat.
  4. Ask your question. Give your AI this prompt:
    Using mcpdata, which tables can you see, and how many rows does each have?
What your AI does: the tool call it makes for this prompt, and what came back
list_tables() → 3 tables: Demo.Orders, Demo.Products, Demo.Customers
What you should get · the recipe's real result from its last run
tablerowslast_updated
Demo.Orders10,005,0002026-10-27 20:05:07.103000
Demo.Products2,0002026-10-27 19:50:37.321000
Demo.Customers200,0002026-10-27 19:50:36.983000

Synthetic data: the demo's orders are generated, not real customers.

The assistant needs mcpdata connected (step 1) to run the query.

Why this works

Claude Desktop's config file starts local programs. mcp-remote is a small program (run with npx, so it needs Node.js) that connects to a remote MCP server and passes your key as a header. Try it first with the public demo's address and key, shown here; then swap in your own instance.

Related questions