Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,54 @@ const aj = arcjet({
});
```

## MCP Server

Endpoint: `https://api.arcjet.com/mcp`
Transport: Streamable HTTP
Auth: OAuth (browser-based, automatic on first connection)

### Tools

- `list-teams` — Returns teams the authenticated user belongs to.
- `list-sites(teamId)` — Returns sites within a team.
- `get-site-key(siteId)` — Returns the `ARCJET_KEY` for a site. Use this to
configure the Arcjet SDK.

### Typical workflow

1. Connect to the MCP server using one of the methods below.
2. Call `list-teams` to get available teams.
3. Call `list-sites` with a team ID to find the site.
4. Call `get-site-key` to retrieve the `ARCJET_KEY`.
5. Set `ARCJET_KEY` in the project environment (e.g. `.env.local`).

### Connect

Any MCP client supporting the latest MCP specification (Streamable HTTP +
OAuth) can connect to `https://api.arcjet.com/mcp`.

Claude Code:
```bash
claude mcp add arcjet --transport http https://api.arcjet.com/mcp
```

VS Code (Copilot) `.vscode/mcp.json`:
```json
{ "servers": { "arcjet": { "type": "http", "url": "https://api.arcjet.com/mcp" } } }
```

Cursor `.cursor/mcp.json`:
```json
{ "mcpServers": { "arcjet": { "type": "streamable-http", "url": "https://api.arcjet.com/mcp" } } }
```

Windsurf `mcp_config.json`:
```json
{ "mcpServers": { "arcjet": { "serverUrl": "https://api.arcjet.com/mcp" } } }
```

Full documentation: https://docs.arcjet.com/mcp-server

## Reference guides

### Features
Expand Down
171 changes: 171 additions & 0 deletions src/content/docs/mcp-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
title: "Arcjet MCP server"
description: "Connect AI assistants like Claude, Cursor, VS Code Copilot, and ChatGPT to your Arcjet account using the Model Context Protocol (MCP)."
prev: false
next: false
---

import { Aside, Code, TabItem, Tabs } from "@astrojs/starlight/components";
import Comments from "/src/components/Comments.astro";

The Arcjet MCP server lets AI assistants access your Arcjet account through the
[Model Context Protocol (MCP)](https://modelcontextprotocol.io), an open
standard for connecting AI tools to external services.

Connect your AI coding tools to Arcjet to:

- **List teams** you belong to.
- **List sites** within a team.
- **Get site keys** (`ARCJET_KEY`) for use in your projects.

The MCP server is available at:

```
https://api.arcjet.com/mcp
```

It implements the latest
[MCP Authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization)
and
[Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http)
specifications with OAuth-based authentication.

## Supported clients

Any client that supports the latest [MCP
specification](https://modelcontextprotocol.io/specification/2025-06-18) with
[Streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http)
and [OAuth authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization)
is supported. This includes:

- [ChatGPT](#chatgpt)
- [Claude Code](#claude-code)
- [Claude Desktop](#claude-desktop)
- [Cursor](#cursor)
- [VS Code with Copilot](#vs-code-with-copilot)
- [Windsurf](#windsurf)
- Many others that implement the MCP specification.

## Setup

### ChatGPT

1. In ChatGPT, go to **Settings**.
2. Navigate to **Connectors** and select **Add connection**.
3. Enter `https://api.arcjet.com/mcp` as the server URL.
4. Select **OAuth** for authentication.
5. Click **Create**.

ChatGPT handles the OAuth flow automatically.

### Claude Code

```bash
claude mcp add arcjet --transport http https://api.arcjet.com/mcp
```

Claude Code will open a browser for OAuth authentication on first connection.
Once authenticated, you can use the `/mcp` command to verify the connection.

### Claude Desktop

<Aside type="note">
Remote MCP connections are available on Claude Desktop for users on [Pro, Max,
Team, and Enterprise
plans](https://support.anthropic.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp).
</Aside>

1. Open **Settings** in the sidebar.
2. Navigate to **Connectors** and select **Add custom connector**.
3. Configure the connector:
- **Name:** `Arcjet`
- **URL:** `https://api.arcjet.com/mcp`

### Cursor

Add to `.cursor/mcp.json` in your project:

```json
{
"mcpServers": {
"arcjet": {
"type": "streamable-http",
"url": "https://api.arcjet.com/mcp"
}
}
}
```

After adding the server, Cursor will show a **Needs login** prompt. Click it to
authorize Cursor to access your Arcjet account.

### VS Code with Copilot

Add to your `.vscode/mcp.json` in your project or user settings:

```json
{
"servers": {
"arcjet": {
"type": "http",
"url": "https://api.arcjet.com/mcp"
}
}
}
```

Or add it via the command palette:

1. Open the Command Palette (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on
Windows/Linux or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on macOS).
2. Run **MCP: Add Server**.
3. Select **HTTP**.
4. Enter the URL: `https://api.arcjet.com/mcp`
5. Enter the name: `Arcjet`
6. Select **Workspace** or **User** depending on your preference.

VS Code will prompt you to authenticate via OAuth on first use.

### Windsurf

Add to your `mcp_config.json` file:

```json
{
"mcpServers": {
"arcjet": {
"serverUrl": "https://api.arcjet.com/mcp"
}
}
}
```

For more details, see the
[Windsurf MCP documentation](https://docs.windsurf.com/windsurf/cascade/mcp#adding-a-new-mcp-plugin).

## Available tools

Once connected, the following tools are available to your AI assistant:

| Tool | Description |
| --- | --- |
| `list-teams` | Lists teams the authenticated user belongs to. |
| `list-sites` | Lists sites within a specified team. |
| `get-site-key` | Returns the SDK key (`ARCJET_KEY`) for a specific site. |

## Authentication

The MCP server uses OAuth for authentication. When you first connect from any
supported client, you will be redirected to sign in with your Arcjet account.
Once authenticated, your AI assistant can securely access your account resources.

## Security

- **Verify the endpoint** — always confirm you are connecting to
`https://api.arcjet.com/mcp`.
- **Review tool calls** — enable confirmation prompts in your AI client so you
can review actions before they execute.
- **Trusted clients only** — only connect from AI clients you trust. Connecting
grants the AI tool the same access as your Arcjet account.

<Comments />
15 changes: 15 additions & 0 deletions src/lib/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ export const main = [
},
],
},
{
label: "For Agents",
collapsed: false,
items: [
{
label: "MCP Server",
link: "/mcp-server",
},
{
label: "llms.txt",
link: "https://docs.arcjet.com/llms.txt",
attrs: { target: "_blank", class: "external-link" },
},
],
},
{
label: "Advanced",
collapsed: false,
Expand Down
48 changes: 48 additions & 0 deletions tests/llms-txt.test.ts-snapshots/llms-chromium-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,54 @@ const aj = arcjet({
});
```

## MCP Server

Endpoint: `https://api.arcjet.com/mcp`
Transport: Streamable HTTP
Auth: OAuth (browser-based, automatic on first connection)

### Tools

- `list-teams` — Returns teams the authenticated user belongs to.
- `list-sites(teamId)` — Returns sites within a team.
- `get-site-key(siteId)` — Returns the `ARCJET_KEY` for a site. Use this to
configure the Arcjet SDK.

### Typical workflow

1. Connect to the MCP server using one of the methods below.
2. Call `list-teams` to get available teams.
3. Call `list-sites` with a team ID to find the site.
4. Call `get-site-key` to retrieve the `ARCJET_KEY`.
5. Set `ARCJET_KEY` in the project environment (e.g. `.env.local`).

### Connect

Any MCP client supporting the latest MCP specification (Streamable HTTP +
OAuth) can connect to `https://api.arcjet.com/mcp`.

Claude Code:
```bash
claude mcp add arcjet --transport http https://api.arcjet.com/mcp
```

VS Code (Copilot) `.vscode/mcp.json`:
```json
{ "servers": { "arcjet": { "type": "http", "url": "https://api.arcjet.com/mcp" } } }
```

Cursor `.cursor/mcp.json`:
```json
{ "mcpServers": { "arcjet": { "type": "streamable-http", "url": "https://api.arcjet.com/mcp" } } }
```

Windsurf `mcp_config.json`:
```json
{ "mcpServers": { "arcjet": { "serverUrl": "https://api.arcjet.com/mcp" } } }
```

Full documentation: https://docs.arcjet.com/mcp-server

## Reference guides

### Features
Expand Down
Loading