---
slug: hosted-mcp-server-oauth
title: "DataLayer's Hosted MCP Server: One URL, OAuth, No Install (Claude.ai, ChatGPT, Claude Code, Cursor)"
description: "DataLayer ships a hosted remote MCP server at api.datalayer.sh/mcp using Streamable HTTP and OAuth 2.1 with Dynamic Client Registration. Claude.ai, ChatGPT, Claude Code, and Cursor all connect with one URL and a single OAuth approval. Here's how it works and how to use it from each."
date: "2026-04-30"
author: DataLayer Team
tags: [MCP, OAuth, Claude.ai, ChatGPT, Hosted, Remote MCP]
readingTime: 8
---

# DataLayer's Hosted MCP Server: One URL, OAuth, No Install

The original DataLayer MCP server shipped as an npm package, `@datalayer-sh/mcp`. You installed it locally, set a `DATALAYER_API_KEY` environment variable, and pointed your client at the binary over stdio. It works. It still works.

But the world moved. The MCP spec finalized **Streamable HTTP** as the recommended remote transport (spec 2025-11-25). Claude.ai shipped **custom connectors**: paste a URL, click Approve, done. Anthropic standardized on **OAuth 2.1 + Dynamic Client Registration** as the recommended auth flow. Local install steps now feel like a relic.

So we built a hosted MCP server. It lives at:

```
https://api.datalayer.sh/mcp
```

That's the whole address. There's nothing to install. There's no `mcp.json` to write. You don't paste an API key into your agent. Your agent just talks to the URL, and a one-time OAuth click connects it to your DataLayer workspace.

This post explains what we built, why we built it the way we did, and how to use it.

---

## The 30-second setup

### Claude.ai

1. Open Claude.ai → **Settings → Connectors → Add custom connector**.
2. Paste `https://api.datalayer.sh/mcp` as the URL.
3. Click **Add**. Claude opens our consent screen.
4. Sign in (or sign up — 10 free credits, no card), click **Approve**.

That's it. Try: *"Find me five Series B SaaS companies in New York hiring engineers."* Claude calls `search_companies` and `company_jobs` and gives you the answer.

### ChatGPT

ChatGPT has full remote-MCP support behind a beta flag called **Developer Mode**. Once enabled, you can add `https://api.datalayer.sh/mcp` exactly like a Claude.ai connector — same OAuth flow, same 11 tools.

1. Open ChatGPT → **Settings → Connectors → Advanced settings**.
2. Toggle **Developer Mode** on. (You'll see a warning about beta — that's expected; remote MCP is rolling out.)
3. Back on the Connectors page, click **Create** (the new connector button).
4. Give it a name like `DataLayer`, paste `https://api.datalayer.sh/mcp` as the URL, and set **Authentication** to **OAuth**.
5. Confirm "I trust this application" and click **Create**.
6. ChatGPT opens our OAuth consent popup. Sign in to DataLayer, click **Approve**.

ChatGPT now sees the same 11 tools as Claude. Try the same prompt as above; it'll route through `search_companies` + `company_jobs`. (If you don't see the Connectors tab, you're on a plan or workspace that hasn't received the rollout yet — the underlying server works the same way the moment you do.)

### Claude Code

```bash
claude mcp add datalayer https://api.datalayer.sh/mcp --transport http
```

A browser opens for the OAuth handshake. Tokens are stored locally; refresh is automatic.

### Cursor

`~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "datalayer": {
      "url": "https://api.datalayer.sh/mcp"
    }
  }
}
```

Restart Cursor. The first call triggers OAuth.

### Headless / CI

Send `Authorization: Bearer sk_live_...` with your DataLayer API key. Same endpoint, no browser required.

---

## What's inside the URL

`POST /mcp` is a standard JSON-RPC 2.0 endpoint. It speaks the MCP protocol version `2025-11-25`. We return single JSON responses (no SSE), keeping things stateless — every request is a complete exchange.

When you call `tools/list`, the server returns the same eleven tools the legacy stdio package exposed:

- `enrich_company`, `enrich_person` — full profile lookups by domain, email, LinkedIn URL, or name+domain
- `lookup_company`, `lookup_person` — deterministic single-record lookups
- `search_companies`, `search_people` — filtered discovery across 60M companies and 300M contacts
- `company_employees`, `company_headcount`, `company_technographics`, `company_jobs` — deep company intel
- `find_intent_signals` — buying-intent scoring across web traffic, ad spend, hiring, and funding

Tool calls run through the same handlers and credit accounting as our REST API. A successful `enrich_company` deducts 1 credit. A 404 (not found) is free. A `find_intent_signals` query that returns 12 results costs 60 credits (5 per result). Your wallet, rate limits, and usage logs are all the same — the MCP endpoint is just a different surface on top of the same engine.

---

## Why OAuth 2.1 + Dynamic Client Registration

The MCP authorization spec (the one Claude.ai's connector UI is built against) is built on five RFCs: OAuth 2.1, Authorization Server Metadata (RFC 8414), Protected Resource Metadata (RFC 9728), Dynamic Client Registration (RFC 7591), and Resource Indicators (RFC 8707).

Together they encode a simple promise: a user with a browser should be able to grant an AI agent access to a remote MCP server without touching configuration files, copying API keys, or reading developer docs. Claude doesn't pre-register itself with us. We don't pre-register Claude with anyone. The two systems negotiate a relationship at runtime via DCR, then run a standard authorization-code flow with PKCE.

Here's what happens when you click "Add" in Claude.ai:

1. Claude POSTs to `https://api.datalayer.sh/mcp` with no token.
2. We respond `401 Unauthorized` with `WWW-Authenticate: Bearer resource_metadata="https://api.datalayer.sh/.well-known/oauth-protected-resource"`.
3. Claude fetches that metadata, which points at our authorization server (`https://api.datalayer.sh`).
4. Claude fetches `https://api.datalayer.sh/.well-known/oauth-authorization-server` to discover endpoints.
5. Claude POSTs to `/oauth/register` with its own redirect URIs, asking for a client ID.
6. Claude opens your browser at `/oauth/authorize?...&code_challenge=...&resource=https://api.datalayer.sh/mcp`.
7. You sign in with BetterAuth (or get bounced to `datalayer.sh/login`) and approve.
8. We redirect Claude back with an authorization code.
9. Claude exchanges the code at `/oauth/token` with its PKCE verifier and gets an access token + refresh token.
10. Claude retries the original `POST /mcp` with `Authorization: Bearer dl_at_...`. We map the token to your workspace, run the JSON-RPC, deduct credits, return the result.

This whole dance happens once. After that, the access token lasts an hour, the refresh token lasts 30 days, and Claude rotates them transparently.

---

## What about API keys?

We didn't kill them. They still work — just send `Authorization: Bearer sk_live_...` (or the legacy `X-API-Key: sk_live_...` header) on the same `/mcp` endpoint. We auto-detect: tokens prefixed `sk_` go through the existing Redis-backed key cache; tokens prefixed `dl_at_` go through the OAuth access-token table.

OAuth is the right answer for end users on Claude.ai and Cursor: no key to leak, no env var to set, revocation per-client from your dashboard. API keys are still the right answer for headless servers, cron jobs, and CI runners that don't have a browser to sign in with.

You can use both, side by side, on the same workspace. They share the same credit balance, the same rate limits, the same usage log.

---

## What we kept the same

**Credit semantics.** A 1-credit tool call deducts 1 credit on success and 0 on a 404. A 5-credit-per-result tool call deducts based on result count. Every billing rule from the REST API carries over verbatim.

**Rate limits.** Each authenticated principal (API key or OAuth token) gets its own bucket using the same Redis Lua script the REST API uses. OAuth clients default to 120 req/min — adjust per workspace if you need more.

**Usage logs.** Every MCP tool call lands in the same `usage_logs` table as REST. Endpoints are recorded as `mcp:enrich_company`, `mcp:search_people`, etc. so you can see exactly which calls came from the agent.

**Tool output.** The markdown formatters live in `api/src/lib/mcp-format.ts` and emit byte-identical output to the legacy stdio package's `lib/format.ts`. Switching transports doesn't change what your agent sees.

---

## What changed for the npm package

`@datalayer-sh/mcp` still exists. It still works. It still ships the same 11 stdio tools, talks to the same REST API, and uses the same `DATALAYER_API_KEY` env var. We didn't break anything.

But our docs now lead with the hosted server. If you're starting fresh in 2026, paste the URL into Claude.ai. The npm package is for the long tail: corporate environments where outbound HTTP from the agent is locked down, machines that need stdio-only transport, or scripts that already had `DATALAYER_API_KEY` plumbed through.

---

## Try it now

1. Sign up at [datalayer.sh](https://datalayer.sh) — 10 free credits, no card.
2. Pick a client:
   - **Claude.ai** → Settings → Connectors → Add custom connector
   - **ChatGPT** → Settings → Connectors → Advanced → enable Developer Mode → Create
   - **Claude Code** → `claude mcp add datalayer https://api.datalayer.sh/mcp --transport http`
   - **Cursor** → `~/.cursor/mcp.json` → `{ "mcpServers": { "datalayer": { "url": "https://api.datalayer.sh/mcp" } } }`
3. Paste `https://api.datalayer.sh/mcp` (with Authentication: OAuth in ChatGPT).
4. Approve.
5. Ask: *"Enrich stripe.com and tell me their tech stack."*

If it works, you've just used MCP the way it was meant to be used: an agent, a URL, an OAuth click, and real data. No install, no API key, no friction.

If it doesn't, [open an issue](https://github.com/datalayer-sh/mcp/issues) — we read every one.
