OpenArtifacts

openartifacts.sh / templates / mcp-server

Remote MCP server

Bun 1.3 + TypeScript, official MCP SDK 1.30.1 · size small · 5 files, 29.1 kB

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

VariableRequiredWhat it does
MCP_TOKENnoWhen 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

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):

Starting it needs an hour of awake time in credit ($0.03), and an account runs one service per $1 of balance.

Files

Every file, as JSON you can edit and publish: GET /v1/templates/mcp-server.


← all templates · openartifacts.sh · docs.md · skill.md