Source: https://usedataowl.com/docs/mcp-introduction
Markdown source: https://usedataowl.com/docs/mcp-introduction.md
Description: Authenticate Claude Desktop, Claude Code, Cursor, or Windsurf via OAuth or API token to query your live website traffic and revenue data.

# Get Started with the DataOwl Model Context Protocol (MCP) Server

Connect your AI assistant to DataOwl to ask about traffic, revenue, goals, errors and AI crawlers in plain English. You need a DataOwl account with at least one website.

## Choose how to connect

Choose **one** method. Both use Streamable HTTP at the same URL:

```text
https://usedataowl.com/api/mcp
```

- **[Sign in with OAuth](#connect-with-oauth)**: recommended for clients that offer it, including Claude Code, Codex and Cursor. You pick websites and permissions on DataOwl; the client handles its token. No key to create or copy.
- **[Use an API token](#connect-with-an-api-token)**: for clients that ask for a Bearer token. Create a scoped account token and add it to the client's configuration.

Both methods offer the same [tools](/docs/mcp-tools), all read-only.

## Connect with OAuth

### 1. Add DataOwl to your client

**Claude Code:** add the server, then run `/mcp` inside Claude Code and choose **Authenticate**:

```sh
claude mcp add --transport http datasense https://usedataowl.com/api/mcp
```

**Codex:** add the server and complete the browser sign-in:

```sh
codex mcp add datasense --url https://usedataowl.com/api/mcp
```

**Cursor, VS Code, Windsurf and others:** add a remote MCP server with the URL above and choose OAuth or Sign in. Clients register themselves (dynamic registration and client ID metadata documents are both supported).

### 2. Sign in and approve access

1. Sign in on DataOwl with your account.
2. Select the websites this client may access.
3. Review the permissions. Read permissions are selected by default; visitor names and emails (`visitors:details`) are off unless you turn them on.
4. Select **Allow access** to return to your client.

The client gets a token for that connection and refreshes it on its own. Your DataOwl session and website keys are never shared with it.

### 3. Try it

> List my websites, then show visitors and revenue for the last 7 days and the top referrers.

Manage or revoke the connection in [**API & MCP → Connected apps**](/dashboard/api).

## Connect with an API token

### 1. Create an account token

1. Open [**API & MCP**](/dashboard/api) in the dashboard.
2. Under **New access token**, choose **All websites** or **Specific websites**.
3. Keep only the permissions you need. For analytics, `websites:read` and `analytics:read` are enough.
4. Name it, select **Create token**, and copy the `ds_at_` value. It's shown once.

A website key (`ds_sk_`, from a website's **Settings → API**) works too, with access to that one website.

### 2. Add it to your client

Send it as `Authorization: Bearer …`. Keep it in the client's settings or an environment variable, never in source control or a chat.

**Claude Code:**

```sh
claude mcp add --transport http datasense https://usedataowl.com/api/mcp \
  --header "Authorization: Bearer ds_at_xxx"
```

**Codex:** export the token as `DATASENSE_TOKEN`, then:

```sh
codex mcp add datasense \
  --url https://usedataowl.com/api/mcp \
  --bearer-token-env-var DATASENSE_TOKEN
```

**Cursor** (`mcp.json`), with `DATASENSE_TOKEN` in Cursor's environment:

```json
{
  "mcpServers": {
    "datasense": {
      "url": "https://usedataowl.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:DATASENSE_TOKEN}"
      }
    }
  }
}
```

**Other clients:** enter the URL and Bearer token in their remote MCP settings. Clients that only run local stdio servers need a bridge such as [mcp-remote](https://github.com/geelen/mcp-remote).

### 3. Try it and manage access

Ask your client to list your websites. Delete the token in [API & MCP](/dashboard/api) to revoke it.

## How access is limited

Every call checks the credential, the permission the tool needs, and that you still own the website. A website ID in a request is a target to check, not proof of access: a connection approved for Website A can't read Website B.

OAuth connections only reach the websites you approved; websites added later aren't shared automatically. OAuth access tokens last an hour and refresh for up to 30 days, and a connection needs fresh consent after 90 days. Account tokens last until you delete them. The DataOwl mobile app is the exception: it signs in to your whole account without a consent screen, sees websites you add later, and stays signed in until you sign out or revoke it here.

## Safety

- **Start small.** Give a client only the websites and permissions it needs.
- **Read-only.** MCP can't change settings, delete data or create credentials.
- **Keep credentials private.** Anyone with a valid token can use its access until it expires or is revoked. Never put tokens in URLs, repositories or chat messages.
- **Rate limits.** 60 requests a minute per credential; a `429` means back off and retry.

For scopes and OAuth details, see the [OAuth reference](/docs/mcp-oauth).

## Next steps

- [MCP overview and example questions](/mcp)
- [MCP tool reference](/docs/mcp-tools)
- [OAuth permissions and protocol reference](/docs/mcp-oauth)
- [API authentication and scopes](/docs/api/authentication)
