Repository avatar
Other Tools
v1.0.0
active

agentack-mcp

io.github.mrprogrammingx/agentack-mcp

MCP server for Agentack. Use the create_website tool to publish a website and receive its live URL.

Documentation

agentack-mcp

A small MCP server that lets an AI assistant publish a static website through the AgenTack API (source).

AgenTack is the service: it stores and serves static sites behind an HTTP API (POST /v1/sites), and its dashboard is at agentack.app. This repository is only a client for it. It gives an MCP client (Claude Code, Claude Desktop, Gemini CLI, ...) three tools: create_website, which sends the model's files to AgenTack and returns the public URL, rename_website, which changes a site's name (and so its address), and account_status, which shows the key's limits and usage.

  • Transports: stdio (default; runs on the user's machine with their key in the environment) and Streamable HTTP (--http; a hosted server where each caller sends their own key as an Authorization: Bearer header, or signs in with an email magic link over OAuth). See Hosted mode.
  • Three tools:
    • create_website(files, name), where each file is {path, content, encoding} and encoding is "utf8" (default) or "base64". name is optional (see Site names): without one, AgenTack names the site after the page's <title>.

    • rename_website(site, new_name): site is the site's id, its current name or its URL; returns the new URL. The old address redirects to the new one for 90 days.

    • account_status(), no arguments: the key's kind (trial, kept or standard), sites and updates used of its limits, upload limits and rules, and how to have trial limits lifted, all from AgenTack's GET /v1/account. Its description tells the model to call it before publishing when unsure, and after a trial_limit or site_limit_reached error, instead of guessing. Example answer:

      Kept free key: 3 of 3 sites used, 4 of 10 updates used.
      Upload limits: at most 20 files per site, 512 KiB per file, 2 MiB per site.
      Trial rules apply (no scripts; allowed file types: css, html, ...).
      This key has the free-trial limits. To have them lifted, email help@example.com.
      
  • The tool description tells the model the AgenTack limits and sandbox rules, so it writes a valid site on the first try.
  • No client-side validation beyond "files is a non-empty list": AgenTack is the single source of truth. Its errors come back to the model as <code>: <message> tool errors (for example index_missing: ...), so the model can fix the files and retry.

Quick start (hosted, nothing to install)

In claude.ai, ChatGPT or the Gemini app: add https://mcp.agentack.app/mcp as a custom connector and sign in with your email when asked. See Connecting from chat apps.

In Claude Code, Gemini CLI, Cursor or VS Code, with a key:

  1. Get an AgenTack API key: a free trial key on agents.agentack.site ("Try it free"), or a permanent one from the operator.

  2. Add the hosted server to your client by URL, https://mcp.agentack.app/mcp, with your key as a Bearer header. Claude Code:

    claude mcp add --transport http agentack https://mcp.agentack.app/mcp --header "Authorization: Bearer your-key"
    

    Gemini CLI, Cursor and VS Code each use a different config format: see Connecting to a hosted server.

  3. Ask: "Create a one-page website for a coffee shop and publish it."

Install and run

Requires Python 3.12 and uv.

Run it without cloning (what the client configs below use):

uvx --from git+https://github.com/mrprogrammingx/agentack-mcp agentack-mcp --help

Or clone it to develop:

git clone https://github.com/mrprogrammingx/agentack-mcp.git
cd agentack-mcp
uv sync

Configuration is read from the environment only:

VariableExampleNotes
AGENTACK_API_URLhttp://localhost:8000Base URL, no trailing slash
AGENTACK_API_KEYap_...Bearer key

If either is missing, the tool returns a clear error (the server still starts). The key is never logged or returned.

Run the server (it speaks MCP over stdin/stdout, so you normally let your MCP client start it):

AGENTACK_API_URL=http://localhost:8000 AGENTACK_API_KEY=... uv run agentack-mcp

Run the tests (no network needed; the API is mocked with respx):

uv run pytest -q

A local AgenTack to try it against

In a checkout of the agentack repo:

docker compose up -d
docker compose exec -T api agentack create-key --name mcp

Client configuration

These run the server locally over stdio, with your key in its environment. Replace the URL and key with your own. To run a checkout instead of the published code, replace uvx --from git+https://github.com/mrprogrammingx/agentack-mcp agentack-mcp with uv run --directory /path/to/agentack-mcp agentack-mcp.

Claude Code

claude mcp add agentack -e AGENTACK_API_URL=http://localhost:8000 -e AGENTACK_API_KEY=your-key -- uvx --from git+https://github.com/mrprogrammingx/agentack-mcp agentack-mcp

Claude Desktop

In claude_desktop_config.json (Settings > Developer > Edit Config):

{
  "mcpServers": {
    "agentack": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/mrprogrammingx/agentack-mcp", "agentack-mcp"],
      "env": {
        "AGENTACK_API_URL": "http://localhost:8000",
        "AGENTACK_API_KEY": "your-key"
      }
    }
  }
}

Claude Desktop may not see your shell's PATH; if uvx is not found, use its absolute path (which uvx) as command.

Gemini CLI

In ~/.gemini/settings.json (or .gemini/settings.json in a project):

{
  "mcpServers": {
    "agentack": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/mrprogrammingx/agentack-mcp", "agentack-mcp"],
      "env": {
        "AGENTACK_API_URL": "http://localhost:8000",
        "AGENTACK_API_KEY": "your-key"
      }
    }
  }
}

Hosted mode (HTTP)

agentack-mcp --http serves MCP over Streamable HTTP at /mcp (stateless, JSON responses) and a health check at /healthz. It is meant to run next to AgenTack, so users can add it by URL instead of installing anything.

  • Each caller's own key. The tool reads the key from the request's Authorization: Bearer <AgenTack key> header and forwards it to the API. The server has no key of its own: it refuses to start in --http mode if AGENTACK_API_KEY is set, so nobody can ever publish with a shared key.
  • Or OAuth sign-in (optional, see OAuth vs raw key): with the OAuth settings, the server is also an OAuth authorization server, and chat apps connect by URL. Their users sign in with an email magic link and publish with their own key.
  • Without OAuth settings, listing tools works without a key, and calling a tool without one returns unauthorized: ... as a tool error. With OAuth on, every request to /mcp needs a Bearer, listing tools included: an OAuth access token or a raw key. Without one the answer is 401 with WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource/mcp", which is how chat apps find out they should start the OAuth flow.
  • MCP_ALLOWED_HOSTS (comma-separated) limits the accepted Host headers, for example to the public hostname. Other hosts get 421.
  • Request bodies up to 6 MiB are accepted; the API enforces its own 5 MiB limit.
  • Keys are never logged or returned.

Run it locally:

AGENTACK_API_URL=http://localhost:8000 uv run agentack-mcp --http --port 8080

Deploying with Docker next to AgenTack (Cloudflare Tunnel, no host ports): docs/DEPLOY.md.

Connecting to a hosted server

The public server is https://mcp.agentack.app/mcp. For your own deployment, use its URL instead. Replace your-key with your AgenTack API key.

Each client names the URL field differently, so copy the snippet for your client: a Gemini CLI config pasted into Cursor, for example, does not connect.

ClientWhereURL field
Claude Codeclaude mcp add--transport http + URL
Gemini CLI~/.gemini/settings.jsonhttpUrl
Cursor~/.cursor/mcp.json (or .cursor/mcp.json in a project)url
VS Code.vscode/mcp.jsonservers with "type": "http" and url

Claude Code:

claude mcp add --transport http agentack https://mcp.agentack.app/mcp --header "Authorization: Bearer your-key"

Gemini CLI (~/.gemini/settings.json). ${AGENTACK_API_KEY} is read from your environment:

{
  "mcpServers": {
    "agentack": {
      "httpUrl": "https://mcp.agentack.app/mcp",
      "headers": { "Authorization": "Bearer ${AGENTACK_API_KEY}" }
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "agentack": {
      "url": "https://mcp.agentack.app/mcp",
      "headers": { "Authorization": "Bearer your-key" }
    }
  }
}

VS Code (.vscode/mcp.json). VS Code asks for the key once and stores it, so it is never written in the file:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "agentack-key",
      "description": "AgenTack API key",
      "password": true
    }
  ],
  "servers": {
    "agentack": {
      "type": "http",
      "url": "https://mcp.agentack.app/mcp",
      "headers": { "Authorization": "Bearer ${input:agentack-key}" }
    }
  }
}

Connecting from chat apps (OAuth sign-in)

claude.ai, ChatGPT and the Gemini app can't send a header: they connect by URL and sign you in. Use the URL https://mcp.agentack.app/mcp (or your own deployment's). The menus move from time to time; look for "custom connector" or "MCP server".

  • claude.ai (also Claude Desktop and mobile, which share the connectors): Settings → Connectors → Add custom connector. Name AgenTack, URL as above, no client ID or secret. Then Connect.
  • ChatGPT: Settings → Apps & Connectors → Advanced settings → turn on Developer mode, then Create a connector with the URL as above and authentication OAuth. Pick it in a chat from the tools menu.
  • The Gemini app: where your plan lets you add a remote MCP server by URL, add the URL as above with OAuth sign-in.

The app opens a sign-in page: " will publish websites with your AgenTack account", and an email field. You get an email "Sign in to AgenTack" with a link that works once, for 15 minutes, in the same browser. Open it, choose Sign in, and a "You're signed in" page shows your key's limits (for example "This key can publish up to 3 sites (trial rules apply)"), then continues to the app after 3 seconds, or at once with Continue. There is no password. Keys made by sign-in start with the free-trial limits; ask the assistant for your account status to see them, and how to have them lifted.

Your account is your email: the first sign-in creates an AgenTack key for it (a kept key: it never expires but has the free-trial limits; ask the operator to lift them). If the email already kept a trial site ("Keep it" on AgenTack), signing in links those sites to the account. Each later sign-in from another app reuses the same key.

OAuth vs raw key

OAuth sign-inRaw key (Authorization: Bearer ap_…)
Clientsclaude.ai, ChatGPT, the Gemini app, MCP Inspector, any client with MCP OAuthClaude Code, Gemini CLI, Cursor, VS Code, scripts
What you holdNothing: the app holds a 1-hour access token and a 30-day refresh tokenThe key, in the client's config
KeyOne kept key per email, created and stored (encrypted) by the serverAny key you have: trial, kept or standard
RevokingDisconnect in the app (or /revoke); the operator can delete the accountRevoke the key in AgenTack

Both work against the same URL at once: a Bearer starting with ap_ is a raw key, passed to AgenTack as before; anything else must be an access token this server issued.

How the OAuth server works

  • Endpoints: /.well-known/oauth-authorization-server, /.well-known/oauth-protected-resource/mcp (and the same document at /.well-known/oauth-protected-resource), /register (dynamic client registration), /authorize, /token, /revoke. Issuer: MCP_PUBLIC_URL; resource: MCP_PUBLIC_URL/mcp.
  • Authorization code with PKCE (S256 only). Codes last 5 minutes and work once (a replayed code revokes what it issued). Access tokens are opaque and last 1 hour; refresh tokens last 30 days and rotate on every use, and presenting a used one revokes the whole chain. Only SHA-256 hashes of codes and tokens are stored.
  • Registration: redirect URIs must be https, or http on localhost/127.0.0.1; at most 10 registrations per IP per hour. /authorize needs an exact redirect-URI match.
  • Sign-in: always the same "Check your email" page (it never tells whether an account exists); 3 links per email and 10 per IP per hour. The link page only shows a button (mail scanners open links); the POST uses it up. Pages have no scripts, a strict CSP, a CSRF token on every form, Cache-Control: no-store and Referrer-Policy: no-referrer.
  • The server gets an account's key from AgenTack's internal endpoint (on the Docker network only, with a shared secret) and stores it encrypted (AES-GCM) in SQLite; later sign-ins reuse it. Emails are personal data: never logged, stored only as an HMAC once a link is used, and agentack-mcp delete-account EMAIL deletes an account.
VariableExampleNotes
MCP_PUBLIC_URLhttps://mcp.example.comIssuer and base of the sign-in links. https, no path.
MCP_DB_PATH/data/agentack-mcp.dbSQLite file (default shown).
MCP_ENCRYPTION_KEY32 random bytes, base64Encrypts stored keys. Secret.
RESEND_API_KEYre_…Sends the email through Resend's HTTP API. Secret.
MAIL_FROMAgenTack <noreply@example.com>On a domain verified in Resend.
AGENTACK_INTERNAL_URLhttp://api:8002AgenTack's internal key endpoint (default shown).
AGENTACK_INTERNAL_SECRETThe same value as AGENTACK_INTERNAL_SECRET in the AgenTack app. Secret.
MCP_CLIENT_IP_HEADERCF-Connecting-IPClient IP for rate limits, behind a proxy. Empty: the TCP peer.
MCP_MAIL_BACKENDresendconsole prints links instead (only for a localhost MCP_PUBLIC_URL).

OAuth is on only when MCP_PUBLIC_URL, MCP_ENCRYPTION_KEY, MAIL_FROM, AGENTACK_INTERNAL_SECRET and (for Resend) RESEND_API_KEY are all set. Otherwise HTTP mode starts with raw-key auth only and says so in the log. Setup, Resend domain verification and a local test with the MCP Inspector: docs/DEPLOY.md.

Example prompt

Create a one-page website for a coffee shop and publish it.

The assistant writes index.html (and any CSS, JS or images), calls create_website, and answers with the URL, for example:

Published: https://coffee-corner.agentack.site/
id: ...
name: coffee-corner
version: 1

Rename it to bean-there.

Renamed: https://bean-there.agentack.site/
id: ...
name: bean-there
version: 1
The old address https://coffee-corner.agentack.site/ redirects (301) to the new one for 90 days.

Site names

Every site lives at https://<name>.agentack.site/. The tools always show the url AgenTack returns and never build an address from a name, so sites with an older 16-character name (k3vq7m2xw4tpa5re) and addresses on another deployment work the same way.

  • A name is 3 to 30 characters: lowercase letters, digits and hyphens, starting with a letter, ending with a letter or a digit, no --. AgenTack checks it; this server doesn't.

  • create_website sends name only when it isn't empty. Without one, AgenTack names the site after the page's <title> (or its first <h1>), adding -2 to -9 if that is taken, else a random readable name like calm-river-4821. Free trial keys always get a random name.

  • Name errors come back as tool errors with AgenTack's message: name_invalid (the message states the rules), name_unavailable (taken, reserved or recently released) and name_not_allowed (free trial keys can't choose a name). After name_unavailable, the tool asks AgenTack (GET /v1/names/{name}) for an available name and adds it:

    name_unavailable: That site name is not available. ...
    Suggestion: "coffee-corner-2" is available.
    
  • rename_website finds the site among the key's sites (GET /v1/sites) by id, name or URL, then calls PATCH /v1/sites/{id}. The old address redirects (301) to the new one for 90 days. A site can be renamed 5 times in 24 hours; after that the error is rate_limited: ... (Retry-After: <seconds> seconds). The other errors are the three name errors, site_not_found and unauthorized.

AgenTack rules the tool description passes on

  • index.html is required at the root.
  • Allowed extensions: html, css, js, svg, png, jpg, jpeg, webp, ico, txt, json.
  • At most 100 files per site, 1 MiB per file after decoding, 5 MiB per request, 10 sites per key. These are the standard limits; a trial or kept key has lower ones, which account_status reports (nothing here hard-codes them).
  • Sites run in a sandbox with an opaque origin: only classic <script src> works; no ES modules, no fetching the site's own files, no localStorage, no cookies, and no external network resources.

Out of scope (for now)

  • Update, delete and list-sites tools (renaming is rename_website).
  • Sign-in with Google or a password, and a web dashboard login (sign-in is an email magic link only).
  • Instagram import.

Note on the MCP SDK

This uses the official mcp Python SDK 2.x, where FastMCP was renamed MCPServer (from mcp.server.mcpserver import MCPServer). It is the same decorator-based API.

License

MIT

Made by Amir Zare (amirzare.com).

No installation packages available.

Remote