# MCP (/docs/cloud/mcp)

<Component />

Every cloud release also serves an MCP endpoint at `/mcp`, so agents can discover and query the datasets you published.
Cloud hosts the MCP server and handles authentication, so you don't run one yourself, whether you published from
TypeScript or Python.

There are two ways to connect:

- **Your MCP client, signed in as you.** For team members using Claude, Claude Code, Cursor or VS Code.
- **One project, with an API key.** For headless agents, CI, or a client that can't sign in.

## Connect your MCP client [#connect-your-mcp-client]

Your organisation has one MCP URL for every project. Copy the MCP server URL from **Connect** in hypequery
(**Endpoints › MCP server**), add it to your client, and sign in with your hypequery account. There's no key to create or paste. The client can do what your role
allows, and no more.

The steps below write the URL as `<your MCP URL>`.

### Claude [#claude]

1. In claude.ai or Claude Desktop, open **Settings › Connectors**.
2. Choose **Add custom connector**, name it `hypequery` and paste your MCP URL.
3. Choose **Connect** and sign in with your hypequery account.

Claude connects from Anthropic's servers, so it can't reach a `localhost` URL. To try a local server, use Claude Code.

### Claude Code [#claude-code]

Run this in your project:

<CodeBlock>
```bash
claude mcp add --transport http hypequery <your MCP URL>
```
</CodeBlock>

Then, in Claude Code, run `/mcp`, choose `hypequery` and sign in with your hypequery account.

### Cursor [#cursor]

Add the server to `~/.cursor/mcp.json` to use it in every project, or to `.cursor/mcp.json` in one project:

<CodeBlock>
```json
{
  "mcpServers": {
    "hypequery": {
      "url": "<your MCP URL>"
    }
  }
}
```
</CodeBlock>

Sign in with your hypequery account when Cursor asks.

To share a one-click install link with your team instead, use Cursor's install link format. `config` is the
Base64 encoding of `{"url":"<your MCP URL>"}`:

<CodeBlock>
```text
cursor://anysphere.cursor-deeplink/mcp/install?name=hypequery&config=<base64 of {"url":"<your MCP URL>"}>
```
</CodeBlock>

### VS Code [#vs-code]

Run **MCP: Add Server** from the Command Palette, choose **HTTP** and paste your MCP URL. Or add the server to
`.vscode/mcp.json`:

<CodeBlock>
```json
{
  "servers": {
    "hypequery": {
      "type": "http",
      "url": "<your MCP URL>"
    }
  }
}
```
</CodeBlock>

Sign in with your hypequery account when VS Code asks.

### Other clients [#other-clients]

Add a remote server that uses Streamable HTTP, with this configuration, and sign in with your hypequery account when
the client asks:

<CodeBlock>
```json
{
  "mcpServers": {
    "hypequery": {
      "type": "http",
      "url": "<your MCP URL>"
    }
  }
}
```
</CodeBlock>

## One project, with an API key [#one-project-with-an-api-key]

For headless agents, CI, or a client that can't sign in, connect to one project's MCP endpoint with a
[runtime API key](/docs/cloud/api-keys) that has MCP access. Print a client configuration with:

<CodeBlock>
```bash
npx --yes --package=@hypequery/cli hypequery deployment:status --mcp-config
```
</CodeBlock>

It looks like this:

<CodeBlock>
```json
{
  "mcpServers": {
    "hypequery": {
      "type": "http",
      "url": "https://<environment-slug>.hypequery.app/mcp",
      "headers": { "Authorization": "Bearer ${HYPEQUERY_API_KEY}" }
    }
  }
}
```
</CodeBlock>

The key is a placeholder your MCP client expands from its environment. The CLI never writes a credential into the
configuration it prints. Set `HYPEQUERY_API_KEY` in the client's environment or secret manager.

### Sign in with OAuth [#sign-in-with-oauth]

MCP clients that support OAuth can also connect to one project's endpoint without an API key. The client discovers
cloud's authorization server from the endpoint, and an organisation owner or admin approves it. When approving, they
choose which tenants (1 to 32) the client may query, and the client's access is limited to exactly those tenants.

### Tenants [#tenants]

Hosted MCP follows the same [tenant rules](/docs/cloud/api-keys#tenant-authority) as REST. A key with several
permitted tenants selects one with the `x-hypequery-tenant-id` header. Tool arguments and chat messages cannot change
the tenant a query runs as.

### Check the endpoint [#check-the-endpoint]

<CodeBlock>
```bash
HYPEQUERY_API_KEY=... npx --yes --package=@hypequery/cli hypequery mcp --self-test --url https://<environment-slug>.hypequery.app/mcp
```
</CodeBlock>

The self-test initializes a session and lists the available tools without calling one. A `401` means the API key was
refused.

To build an agent into your own app, see [AI SDK](/docs/cloud/ai-sdk). For the tools agents get, and what they can and
cannot do, see [Connect: MCP](/docs/mcp/overview) and [MCP safety](/docs/mcp/safety).