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
| Tool | What it does |
|---|---|
pagesmith_list_projects | List all projects with URLs |
pagesmith_pull | Download project files to a workspace |
pagesmith_push | Push changes, build preview, auto-fix errors |
pagesmith_deploy | Rebuild preview without file changes |
pagesmith_publish | Deploy to production |
pagesmith_prompt | AI editing via natural language |
pagesmith_history | View commit history |
pagesmith_content_list | List content collections or posts |
pagesmith_content_get | Read a single post |
pagesmith_content_create | Create a new post |
pagesmith_content_update | Update an existing post |
pagesmith_content_delete | Delete a post |
pagesmith_domains | Manage custom domains |
pagesmith_secrets | Manage 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
BlogLayoutand go insrc/content/blog/ - Sites are static by default (
output: 'static'), with per-page SSR opt-in viaexport const prerender = false - Styling uses Tailwind CSS
This prevents common mistakes like using the wrong layout or breaking the Astro configuration.
Environment Variables
| Variable | Description |
|---|---|
PAGESMITH_API_KEY | Your API key (required) |
PAGESMITH_API_URL | Custom 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)