Skip to main content
Glama
agentpages-mcp

agentpages-mcp

agentpages-mcp

A small MCP server that lets an AI assistant publish a static website through the AgentPages API.

AgentPages is the service: it stores and serves static sites behind an HTTP API (POST /v1/sites). This repository is only a client for it. It gives an MCP client (Claude Code, Claude Desktop, Gemini CLI, ...) one tool, create_website, which sends the model's files to AgentPages and returns the public URL.

  • 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). See Hosted mode.

  • One tool: create_website(files), where each file is {path, content, encoding} and encoding is "utf8" (default) or "base64".

  • The tool description tells the model the AgentPages 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": AgentPages 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.

Install and run

Requires Python 3.12 and uv.

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

Configuration is read from the environment only:

Variable

Example

Notes

AGENTPAGES_API_URL

http://localhost:8000

Base URL, no trailing slash

AGENTPAGES_API_KEY

ap_...

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

AGENTPAGES_API_URL=http://localhost:8000 AGENTPAGES_API_KEY=... uv run agentpages-mcp

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

uv run pytest -q

A local AgentPages to try it against

In a checkout of the agentpages repo:

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

Related MCP server: webserver-mcp

Client configuration

Replace /path/to/agentpages-mcp with the absolute path of this checkout, and the URL and key with your own.

Claude Code

claude mcp add agentpages -e AGENTPAGES_API_URL=http://localhost:8000 -e AGENTPAGES_API_KEY=your-key -- uv run --directory /path/to/agentpages-mcp agentpages-mcp

Claude Desktop

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

{
  "mcpServers": {
    "agentpages": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/agentpages-mcp", "agentpages-mcp"],
      "env": {
        "AGENTPAGES_API_URL": "http://localhost:8000",
        "AGENTPAGES_API_KEY": "your-key"
      }
    }
  }
}

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

Gemini CLI

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

{
  "mcpServers": {
    "agentpages": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/agentpages-mcp", "agentpages-mcp"],
      "env": {
        "AGENTPAGES_API_URL": "http://localhost:8000",
        "AGENTPAGES_API_KEY": "your-key"
      }
    }
  }
}

Hosted mode (HTTP)

agentpages-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 AgentPages, 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 <AgentPages key> header and forwards it to the API. The server has no key of its own: it refuses to start in --http mode if AGENTPAGES_API_KEY is set, so nobody can ever publish with a shared key.

  • Listing tools works without a key; calling create_website without one returns unauthorized: ... as a tool error.

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

AGENTPAGES_API_URL=http://localhost:8000 uv run agentpages-mcp --http --port 8080

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

Connecting to a hosted server

Replace the URL with your server's and your-key with your own AgentPages key.

Claude Code:

claude mcp add --transport http agentpages https://agentpages-mcp.example.com/mcp --header "Authorization: Bearer your-key"

Gemini CLI (~/.gemini/settings.json):

{
  "mcpServers": {
    "agentpages": {
      "httpUrl": "https://agentpages-mcp.example.com/mcp",
      "headers": { "Authorization": "Bearer ${AGENTPAGES_API_KEY}" }
    }
  }
}

Cursor, VS Code and other clients that accept a URL plus headers work the same way. Chat apps that only offer OAuth sign-in (claude.ai, ChatGPT, the Gemini app) are not supported yet: see Out of scope.

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: http://localhost:8001/s/k3j9x2/
id: ...
slug: k3j9x2
version: 1

AgentPages 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.

  • 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 tools.

  • OAuth sign-in for hosted mode (needed by chat apps such as claude.ai, ChatGPT and the Gemini app).

  • 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

Available Tools

1 tool
create_websiteA

Publish a static website on AgentPages and return its public URL.

Pass every file of the site in files. Each file has a path (relative, e.g. "index.html" or "css/style.css"), its content, and an encoding: "utf8" for text files (the default) or "base64" for binary files such as images.

Limits (the API rejects anything else):

  • 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.

  • At most 10 sites per API key.

Sandbox rules (sites are served in a sandbox with an opaque origin):

  • Only classic <script src="..."> works. No ES modules (type="module", import).

  • No fetch/XHR of the site's own files: inline any data in a JS file or the HTML.

  • No localStorage, sessionStorage or cookies.

  • No external network resources: no CDNs, web fonts, remote images or APIs. Ship everything as files in the site, or inline it.

On an error the tool returns ": " from the API (for example index_missing, path_invalid, payload_too_large, validation_error). Fix the files and call the tool again.

Inputs: files (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool there is no possible overlap or misselection; the tool's purpose (publish a static site) is unmistakable from its name and description.

    Naming Consistency5/5

    The single name `create_website` follows a clean verb_noun snake_case convention, so there is no inconsistency to speak of.

    Tool Count3/5

    The surface is a single tool for a domain (hosted site management) that the description itself implies has more state, e.g. a 10-site-per-key quota. It is thin rather than wrong, and the one tool is heavyweight enough to justify its place.

    Completeness2/5

    Only create/publish is exposed: there is no list_sites, get_site, update/redeploy, or delete_site, so an agent that hits the 10-site limit or needs to fix a published site has no path forward. Coverage of the site lifecycle is significantly incomplete.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers