Skip to content

Connect Claude via MCP

For the consumer Claude apps (claude.ai mobile/web), the skill can’t inject environment variables. Instead, expose gotifacts’ MCP connector: an OAuth 2.1-protected Model Context Protocol server at /mcp that exposes the full site lifecycle as tools (publish_site, update_site, unpublish_site, list_revisions, rollback_site, restore_site, purge_site). Claude’s “custom connector” UI authenticates remote MCP servers exclusively via OAuth, so this is the only path that works on mobile/web.

Set in your environment (see the configuration reference):

GOTIFACTS_MCP_ENABLED=true
# Who may grant connector consent. Keep this tight — it decides who can publish.
GOTIFACTS_MCP_ALLOWED_USERS=you@example.com

It requires GOTIFACTS_TRUSTED_PROXIES (the consent step is forward-auth’d) and falls back to GOTIFACTS_ADMIN_USERS if no allowlist is set.

The MCP endpoints split across the two planes:

EndpointForward-authWhy
/mcp/oauth/authorizeONbrowser consent, authenticated by your SSO
/mcp, /mcp/oauth/token, /mcp/oauth/register, /.well-known/oauth-*OFFcalled server-to-server by Claude (OAuth-guarded)

The nginx and Caddy guides show the exact patterns.

In Claude → Settings → Connectors → Add custom connector, enter https://<your-base-domain>/mcp. Use the canonical GOTIFACTS_BASE_DOMAIN here even if you serve alias domains — the OAuth issuer is always the canonical domain. Complete the SSO consent, where you pick:

  • a target — a group subtree or a single site, prefilled from GOTIFACTS_MCP_GROUP (default claude), and
  • the capabilities to allow (publish, patch, unpublish, rollback, purge).

The connector can never act outside what you granted. Then ask Claude to publish a page. publish_site handles both a single self-contained page (the html argument) and a multi-file site — an index.html plus separate CSS/JS/image assets — via a files array of {path, content, encoding} objects (encoding is utf8 or base64 for binary assets).

For the API MCP connector or Claude Code, the same server works with a token obtained through the OAuth flow.

Each consent creates a connection you can review and revoke. Admins see them in the portal’s Connections view, via GET /api/mcp/connections, or headless:

Terminal window
gotifacts mcp connections # list active connections
gotifacts mcp revoke --id <id> # revoke one — access is lost immediately

Tokens carry the same grant model as API keys: the consent screen is the gate that decides who may publish, and the chosen target + capabilities decide what. Dynamic Client Registration (RFC 7591) lets users add the connector by pasting the URL; it only issues a client_id and grants no access on its own. For the deeper rationale see the auth model.