openartifacts.sh / templates / mcp-server
Remote MCP server
A remote MCP server over Streamable HTTP at /mcp, built with the official TypeScript SDK on Bun. It ships three example tools: current_time, add_note and list_notes (notes persist in /data). Point Claude, ChatGPT or any MCP client at it, then replace the tools with your own.
It runs stateless: each POST gets a fresh server and a JSON response, with no session id to lose when the service sleeps and wakes.
Deploy it
One call publishes it as-is and boots it. It needs no environment variables. Files you send with the call replace the template's files of the same name, and fields you send override its oa.json. It is billed like any service.
With curl
# once: an account and its token
curl -sX POST "https://openartifacts.sh/v1/signup?ref=templates"
# the template, published and booted
curl -sX POST https://openartifacts.sh/v1/publish \
-H "Authorization: Bearer $OA_TOKEN" \
-F type=service -F template=mcp-server -F slug=my-tools
From an MCP client
publish_artifact {"type": "service", "template": "mcp-server",
"slug": "my-tools"}
With the CLI
npx @openartifacts/cli signup --ref templates # once
npx @openartifacts/cli deploy --template mcp-server --slug my-tools
# or edit first: the files, here, then a normal deploy
npx @openartifacts/cli init mcp-server
npx @openartifacts/cli deploy ./mcp-server --slug my-tools
Then: Connect a client to <url>/mcp, e.g. claude mcp add --transport http my-tools <url>/mcp. To require a token, set MCP_TOKEN (oa env set my-tools MCP_TOKEN=..., or PUT /v1/artifacts/my-tools/env).
Call it
Once it is healthy, the endpoint is <url>/mcp:
# Claude Code
claude mcp add --transport http my-tools <url>/mcp
# by hand: initialize, list the tools, call one
curl -s -X POST <url>/mcp -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":"1"}}}'
curl -s -X POST <url>/mcp -H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"current_time","arguments":{"timezone":"Europe/Berlin"}}}'
In ChatGPT, add it as a connector (Settings, then Connectors) with the URL <url>/mcp and no authentication. GET <url>/ describes the server and prints these commands with the real URL filled in.
Environment
| Variable | Required | What it does |
|---|---|---|
MCP_TOKEN | no | When set, /mcp answers 401 unless the request carries Authorization: Bearer <MCP_TOKEN>. Claude Code sends it with --header "Authorization: Bearer ...". ChatGPT connectors cannot send a fixed header, so leave it unset for them. |
Set it with oa env set <slug> MCP_TOKEN=... or PUT /v1/artifacts/<slug>/env {"env":{"MCP_TOKEN":"..."}}; the service restarts with it. Without a token anyone with the URL can call the tools, so keep the tools harmless or set the token.
Extend it
- Add a tool: one more
server.registerTool(name, {description, inputSchema}, handler)inbuildServer()inserver.ts.inputSchemais a map of zod schemas; the SDK validates arguments and advertises the JSON Schema intools/list. - Add a dependency:
bun add <package>locally (it updatespackage.jsonandbun.lock), then publish both files. Versions are pinned exactly, andbun.lockpins everything below them. - Keep state in
/data, written whole (a sibling file, then a rename), assaveNotesdoes. Everything else in the container is rebuilt on each boot.
Boot and wake
The first boot runs install (bun install: about 92 packages from the npm registry, a few seconds) and stores the result; every later boot restores it instead of installing, then bun run server.ts starts in well under a second. A request to a sleeping service waits for that, so the first call after a sleep takes a few seconds; the rest are immediate.
What it costs
Prices for small, the size this template needs (current prices on openartifacts.sh):
- Asleep: no runtime charge. The bundle and
/dataare stored at $0.05 per GB-month; this template is about 30 kB. - Awake: $0.03 per awake hour, billed per minute, plus $0.216 per vCPU-hour of CPU actually used. A call wakes it and it stays awake 600 seconds (
sleep_after_s) after the last one, so an occasional call costs about $0.005 plus a little CPU. - Busy all day: awake around the clock is $0.72 a day plus CPU.
Starting it needs an hour of awake time in credit ($0.03), and an account runs one service per $1 of balance.
Files
README.md3.5 kBbun.lock18.9 kBoa.json84 Bpackage.json180 Bserver.ts6.4 kB
Every file, as JSON you can edit and publish: GET /v1/templates/mcp-server.