Technical documentation

MCP connector

Connect Claude, Claude Desktop, Cursor or any MCP-compatible AI tool to your Artefact account so it can create, update and share password-protected HTML artefacts on your behalf.

DemoWatch: Connect Claude to Artefact in 60 seconds

Overview

Artefact exposes a remote Model Context Protocol server. Once connected, your AI tool can call the same actions you'd take in the dashboard — turn HTML into an artefact, list what you've shared, edit a title, send a magic-link invite — without leaving the chat.

MCP server URL
https://useartefact.com/api/mcp

Transport: Streamable HTTP (JSON-RPC over POST).·Auth: OAuth (Claude) or Bearer API token (everything else).

Prerequisites

  • An Artefact account — sign up free if you don't have one.
  • An MCP-capable client: Claude.ai (web), Claude Desktop, Cursor, or any other MCP client.
  • For non-Claude clients: an API token (you'll create one in Step 1).

1. Create an API token

Sign in and open Settings → API tokens & MCP. Click Create token, give it a label (e.g. Claude Desktop), and copy the value immediately — it's hashed at rest and shown only once.

Skip this if you only use Claude.ai or Claude Desktop's custom-connector OAuth flow.
Claude's Add custom connector dialog handles auth via OAuth — no token needed. You only need a token for Claude Desktop'sclaude_desktop_config.json file, Cursor, or any other MCP client.

2. Connect from Claude (web)

  1. In claude.ai, open Settings → Connectors.
  2. Click Add custom connector.
  3. Set Name to Artefact and Remote MCP server URL to:
    https://useartefact.com/api/mcp
  4. Click Add, then sign in to Artefact in the popup to authorise access.
  5. The connector flips to Connected. Done.

Anthropic's official walkthrough: Get started with custom connectors using remote MCP

Plan requirements
Custom connectors are available on Claude Free, Pro, Max, Team and Enterprise. Free accounts are limited to one custom connector.

3. Connect from Claude Desktop (config file)

If you'd rather wire Claude Desktop manually, edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Paste this block (replace YOUR_TOKEN with the value from Step 1), then fully quit and restart Claude:

{
  "mcpServers": {
    "artefact": {
      "url": "https://useartefact.com/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}

4. Other MCP clients (Cursor, agents, custom)

Any client that supports MCP Streamable HTTP can point at the same URL. Send the token as a Bearer header:

Authorization: Bearer YOUR_TOKEN

Smoke test from the terminal:

curl -X POST https://useartefact.com/api/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

A successful response returns the list of available tools as JSON-RPC.

Verify it works

Open a new chat in your AI tool and try a prompt like:

"Create an artefact from this HTML: <h1>Hello world</h1>. Title it 'Hello'. Then email the magic link to me at name@example.com."

The model should call create_artefact followed byshare_artefact_via_email, and reply with the share URL. Refresh your dashboard to see the new artefact.

Tool reference

ToolWhat it does
create_artefactTurn HTML into a new password-protected artefact. Returns the share URL and the generated guest password.
list_artefactsList the user's recent artefacts (id, slug, title, created date). Never returns passwords.
get_artefactFetch the current HTML and metadata of an artefact owned by the user. Use before update_artefact to diff or append rather than overwrite.
update_artefactReplace the HTML and optionally the title or description of an existing artefact owned by the user.
delete_artefactSoft-delete (revoke) or permanently delete an artefact.
share_artefact_via_emailSend magic-link email invites that bypass the guest password for specific recipients.

Troubleshooting

401 Unauthorized
The token is missing, mistyped, or has been revoked. Generate a new one inSettings → API tokensand update your client config. Note the Bearer prefix is required.
406 Not Acceptable
Your client isn't sending Accept: application/json, text/event-stream. Most MCP SDKs set this automatically — if you're calling the endpoint with raw fetch, add the header.
Tools don't appear in Claude
After adding a connector, start a brand-new chat — existing chats don't pick up new tools. In Claude Desktop, fully quit (not just close the window) and relaunch.
Want to disconnect a client
OAuth clients: Settings → Connected apps → Disconnect. API tokens: Settings → API tokens → Revoke. Both take effect immediately.

FAQ

What is MCP?+

The Model Context Protocol is an open standard from Anthropic that lets AI assistants call external tools over a uniform HTTP interface. The Artefact MCP server exposes the same actions you'd take in the dashboard — create, list, update, delete, share — as tools the model can invoke.

Which clients work?+

Anything that speaks MCP Streamable HTTP. That includes Claude.ai (web), Claude Desktop, Cursor, and most agent frameworks. The endpoint is a standard remote MCP server.

Do I need a token if I use Claude?+

No. Claude's custom connector flow uses OAuth — paste the MCP URL and approve. For Claude Desktop's config file, or for any other MCP client, you need an API token from Settings.

What can the AI do once connected?+

Create new password-protected artefacts from HTML, list your artefacts, update title / description / HTML, soft-delete or permanently delete, and send magic-link email invites that bypass the password for a specific recipient.

How do I revoke access?+

For OAuth clients (Claude.ai, Claude Desktop OAuth): Settings → Connected apps → Disconnect. For API tokens: Settings → API tokens & MCP → Revoke. Revocation is immediate.

Is it secure?+

Tokens are scoped to a single user, hashed at rest, and revokable at any time. Guest passwords are never exposed to the model — the AI sees only the share URL and the password it generated when creating the artefact.