IntegrationsYour own code
HTTP server
Run Artiwright's MCP server over HTTP, as a service your agents and apps connect to.
Over stdio, each app starts its own Artiwright. Over HTTP, one Artiwright server runs as a service and any number of agents connect to it by URL. Use it for a hosted agent, a team, or an app written in a language without an Artiwright package.
Prerequisites
Section titled “Prerequisites”Node.js 22.13 or newer (prerequisites), or Docker (see Docker).
Start the server
Section titled “Start the server”-
Choose a token. Clients must send it; without it the server answers
401. -
Start it:
ARTIWRIGHT_MCP_TOKEN=choose-a-long-random-token npx -y artiwright@latest mcp --http --root /srv/artiwrightIt prints where it listens:
artiwright MCP server on http://127.0.0.1:8765/mcp (sessions in /srv/artiwright), token required -
Check it answers:
curl -s -X POST http://127.0.0.1:8765/mcp \-H "Authorization: Bearer choose-a-long-random-token" \-H "Content-Type: application/json" \-H "Accept: application/json, text/event-stream" \-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'The reply includes
"serverInfo":{"name":"artiwright",…}.
Options
Section titled “Options”| Option | Default | What it does |
|---|---|---|
--http |
off | Serve Streamable HTTP instead of stdio |
--port <n> |
8765 |
Port to listen on |
--host <address> |
127.0.0.1 |
Address to listen on; 0.0.0.0 for every interface (needs ARTIWRIGHT_MCP_TOKEN) |
--root <folder> |
./artiwright-sessions |
Sessions and finished files (or ARTIWRIGHT_ROOT) |
--theme <name or file> |
none | Theme for new documents |
ARTIWRIGHT_MCP_TOKEN |
none | When set, requests need Authorization: Bearer <token>. Without one, the server listens only on this machine and serves only requests that come from it and are addressed to it (Host and Origin must be localhost), so a web page can’t reach the server |
The endpoint is always /mcp.
How it behaves
Section titled “How it behaves”- Stateless requests. Each request gets a fresh server; the documents live in the session folder, so any request can continue any session.
- Sessions. Tools take a
sessionargument. Use one per conversation (for example your chat’s id) so turns edit the same documents. - Files are sent, not read by path. Over HTTP the server doesn’t read files from its disk on a client’s behalf.
Clients send a file’s contents (base64) to
artiwright_open. - Finished files are written under
<root>/<session>/outputs/on the server.artiwright_finalizereturns their path; serve them to your users from there.
Connect a client
Section titled “Connect a client”claude mcp add --transport http artiwright https://artiwright.example.com/mcp --header "Authorization: Bearer YOUR_TOKEN"{ "mcpServers": { "artiwright": { "url": "https://artiwright.example.com/mcp", "headers": { "Authorization": "Bearer ${env:ARTIWRIGHT_TOKEN}" } } } }[mcp_servers.artiwright]url = "https://artiwright.example.com/mcp"bearer_token_env_var = "ARTIWRIGHT_TOKEN"{ "mcpServers": { "artiwright": { "serverUrl": "https://artiwright.example.com/mcp", "headers": { "Authorization": "Bearer YOUR_TOKEN" } } } }Agent frameworks connect the same way through their MCP clients, with the URL and the Authorization header.
Deploy it safely
Section titled “Deploy it safely”- Put it behind HTTPS (a reverse proxy or your platform’s load balancer) and keep
--host 127.0.0.1unless the proxy needs another address. - Use a long random token, keep it in a secret store, and rotate it like any other credential.
- For untrusted or multi-tenant use, run it in a container with outbound networking turned off.
DockerThe server as a container image.
Sandbox and securityWhat agent code can and can't do.