Pagesmith

MCP Server

Connect Claude Code, Cursor, and other AI tools to Pagesmith with the MCP server.

The Pagesmith MCP server lets AI coding tools manage your sites directly. Claude Code, Cursor, Windsurf, and any MCP-compatible tool can list projects, pull files, push changes, deploy, and publish — all through natural language.

Setup with Claude Code

claude mcp add pagesmith \
  -e PAGESMITH_API_KEY=ps_live_your_key_here \
  -- npx @pagesmith-ai/mcp

Replace ps_live_your_key_here with your API key from API Keys settings.

That’s it. Start a new Claude Code session and ask it to work with your Pagesmith sites.

Setup with Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{
  "mcpServers": {
    "pagesmith": {
      "command": "npx",
      "args": ["@pagesmith-ai/mcp"],
      "env": {
        "PAGESMITH_API_KEY": "ps_live_your_key_here"
      }
    }
  }
}

What You Can Do

Once connected, ask your AI tool things like:

  • “List my Pagesmith projects”
  • “Pull the my-site project and show me the homepage”
  • “Add a testimonials section to the homepage”
  • “Create a blog post about our product launch”
  • “Push these changes with the message ‘update hero section’”
  • “Deploy my site”
  • “Connect example.com as a custom domain”

The AI tool has full context about Pagesmith’s project structure (Astro, Tailwind, content collections) and will use the right tools automatically.

Available Tools

ToolWhat it does
pagesmith_list_projectsList all projects with URLs
pagesmith_pullDownload project files to a workspace
pagesmith_pushPush changes, build preview, auto-fix errors
pagesmith_deployRebuild preview without file changes
pagesmith_publishDeploy to production
pagesmith_promptAI editing via natural language
pagesmith_historyView commit history
pagesmith_content_listList content collections or posts
pagesmith_content_getRead a single post
pagesmith_content_createCreate a new post
pagesmith_content_updateUpdate an existing post
pagesmith_content_deleteDelete a post
pagesmith_domainsManage custom domains
pagesmith_secretsManage integration secrets

How It Works

The MCP server runs locally on your machine and communicates with the Pagesmith API over HTTPS. Your AI tool sends commands to the MCP server via the standard MCP protocol (stdio), and the server translates them into API calls.

AI Tool (Claude Code / Cursor)
    ↕ MCP protocol (stdio)
Pagesmith MCP Server (local)
    ↕ HTTPS
Pagesmith API (pagesmith.ai)

Your project (Git + build pipeline)

The server provides context about Pagesmith’s Astro project structure, so the AI knows:

  • Pages go in src/pages/
  • Components go in src/components/
  • All pages use BaseLayout (includes navigation and footer)
  • Blog posts use BlogLayout and go in src/content/blog/
  • Sites are static by default (output: 'static'), with per-page SSR opt-in via export const prerender = false
  • Styling uses Tailwind CSS

This prevents common mistakes like using the wrong layout or breaking the Astro configuration.

Environment Variables

VariableDescription
PAGESMITH_API_KEYYour API key (required)
PAGESMITH_API_URLCustom API URL (optional, for staging or self-hosted)

Requirements

  • Node.js 20 or later
  • An API key from a Pro plan account (or admin-granted access)