# MCP server for Claude and ChatGPT

> Connect Claude, ChatGPT or another AI assistant to Datacenter with a read key, then ask how your site did last week in plain words.

Source: https://datacenter.so/docs/mcp
Section: Developers

Datacenter has a remote MCP server. MCP (Model Context Protocol) is the open standard AI assistants use to read other tools. Once it is connected, ask your assistant things like:

- "How did shop.example.com do last week compared with the week before?"
- "Which campaigns brought sales this month?"
- "What is my ROAS on Meta for the last 30 days?"
- "Which short link got the most clicks this week?"

The assistant reads the numbers through Datacenter and answers from them. A normal key only reads: it cannot change a site, a goal, a link or a setting. A key you make with **Can set up sites** can also add a site and make its Events API key, so an AI coding tool can install Datacenter for you (below).

The MCP server is on paid plans: Solo, Studio, Agency and Custom. [Datacenter for AI assistants](https://datacenter.so/ai) has the short version, more questions to ask, and where AI tools find Datacenter's docs as Markdown.

## 1. Make a read key

Open **Settings**, then **API**, and make a key. Pick **All sites**, or one site if the assistant should only see that one. Copy the key. It is shown once. See [Read API](https://datacenter.so/docs/api) for more on keys.

## 2. Connect your assistant

The server lives at:

```text
https://datacenter.so/mcp
```

It takes the key as `Authorization: Bearer st_rk_...`. Apps that only take an address can use the key in the address instead:

```text
https://datacenter.so/mcp/st_rk_...
```

Treat that address like a password. Anyone who has it can read what the key reads.

### Claude (claude.ai and the desktop app)

1. Open **Settings**, then **Connectors**.
2. Choose **Add custom connector**.
3. Name it **Datacenter**. For the URL, paste the address with your key: `https://datacenter.so/mcp/st_rk_...`
4. Leave the OAuth fields empty and press **Add**.
5. In a chat, turn on Datacenter from the tools menu, then ask a question.

On Team and Enterprise plans, an owner may need to add the connector for the organization first.

### Claude Code

```bash
claude mcp add --transport http datacenter https://datacenter.so/mcp \
  --header "Authorization: Bearer st_rk_..."
```

### ChatGPT

Custom MCP servers in ChatGPT need developer mode, which OpenAI offers on some plans. Turn it on under **Settings**, **Apps and Connectors**, **Advanced**. Then create a connector with the address that has your key in it, and choose no authentication. OpenAI may name these menus differently on your plan.

### Cursor, VS Code and other MCP clients

Most clients take a JSON entry like this:

```json
{
  "mcpServers": {
    "datacenter": {
      "url": "https://datacenter.so/mcp",
      "headers": { "Authorization": "Bearer st_rk_..." }
    }
  }
}
```

A client that only runs local servers can reach it through `mcp-remote`:

```json
{
  "mcpServers": {
    "datacenter": {
      "command": "npx",
      "args": ["mcp-remote", "https://datacenter.so/mcp", "--header", "Authorization: Bearer st_rk_..."]
    }
  }
}
```

## Tools

| Tool | What it reads |
|---|---|
| `list_sites` | Your sites: id, name, address and time zone |
| `get_stats` | Visitors, visits, pageviews, bounce rate, visit duration, conversions and conversion rate, with the span before; optionally per hour, day or month |
| `get_breakdown` | Top sources, referrers, UTM values, pages, countries, devices, browsers or goals |
| `get_goals` | Goals with conversions and conversion rate |
| `get_attribution` | Conversions and revenue credited by source, campaign, ad, ad set, platform or short link, under the site's attribution model or one you name |
| `get_ad_spend` | Ad spend, credited revenue and ROAS by platform, campaign, ad set or ad |
| `get_links` | Short links with clicks |
| `get_install_steps` | The exact tag for a site, where it goes for its builder, and how to send Signup and Purchase from your server. It never holds a key |
| `check_tag` | Reads your live home page now: is the tag there, once, for the right site. Up to 30 checks an hour per key |
| `get_setup_status` | The tag seen, the first visit, and the first Signup, Purchase or Lead, with every event name received so far |
| `add_site` | Setup keys only. Adds a site, the same way as **Add site**, within your plan's limit and with the same defaults. Pass your time zone, or it uses UTC |
| `create_events_key` | Setup keys only. Makes an Events API key for a site and gives it to the tool once. Datacenter keeps only its hash |

Every tool but `add_site` and `create_events_key` is marked read-only, and those two are listed only for a key with **Can set up sites**. Dates work as in the [read API](https://datacenter.so/docs/api#dates-and-time-zones): whole local days in the site's time zone, unless the assistant passes another.

## Let your AI coding tool install Datacenter

Connected in Claude Code, Cursor or another coding tool, the same server can set Datacenter up in the project you are working on. Ask it:

> Install Datacenter on shop.example.com in this project, send signups and sales from the server, then check that it works.

It calls `get_install_steps`, adds the tag, writes the server code, then uses `check_tag` once you deploy and `get_setup_status` after you sign up once on the live site.

With a normal key it cannot add a site or make a key: add the site at [Set up your site](https://app.datacenter.so/start) first, and when it asks, make the Events API key yourself on the site's **Integrations** page and store it as a secret. Never paste a key into the chat.

### Let it do all of it: Can set up sites

In **Settings**, **API**, tick **Can set up sites** when you make the key (all sites only). The tool can then:

- add the site with `add_site`, from nothing, with your time zone and Datacenter's usual defaults;
- make the site's Events API key with `create_events_key`. The key is in that one answer and never again; the tool is told to write it straight into your hosting's secrets or a `.env` kept out of git.

All you do is deploy. Each time a setup key adds a site or makes a key, we email you, and **Settings**, **API** lists it under **What setup keys did**. Adding sites is limited to 5 an hour per key and keys to 10 an hour. Revoke the key and both stop at once.

No MCP? **Set it up with AI** on step 2 of [Set up your site](https://app.datacenter.so/start) copies the same instructions as one prompt.

## Good to know

- Each request counts toward the key's 120 requests a minute, shared with the read API.
- Source names, page paths and campaign names come from visitors and ad platforms. The server tells the assistant to treat them as data, never as instructions.
- No visitor emails, names or phone numbers are ever sent to the assistant.
- To disconnect, remove the connector in your assistant and revoke the key in **Settings**, **API**.

## Docs your assistant can read

Datacenter's docs come as plain Markdown too, so an assistant can read them without a browser:

- [/llms.txt](https://datacenter.so/llms.txt): a short map of the site, linking to the Markdown copies.
- [/llms-full.txt](https://datacenter.so/llms-full.txt): every docs article, guide, platform page and glossary term in one file.
- Any docs, guide or glossary page with `.md` on the end, such as [/docs/mcp.md](https://datacenter.so/docs/mcp.md). A request that asks for `text/markdown` in its `Accept` header gets the same.

## For developers

The server speaks MCP over Streamable HTTP: JSON-RPC 2.0 in a `POST`, one JSON answer back, no server-sent events and no session. It supports protocol versions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05, and the methods `initialize`, `ping`, `tools/list` and `tools/call`. `GET` answers 405.

```bash
curl https://datacenter.so/mcp \
  -H "Authorization: Bearer $DATACENTER_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_stats","arguments":{"site_id":"3f9a1c2e7b4d8a06","period":"7d"}}}'
```
