static-mcpify pulls structured content from your CMS, builds it into static files, and serves them as a fully-featured Model Context Protocol server. Your AI agents get instant access to your content — no database, no runtime dependencies.
# Install static-mcpify
$ npm install static-mcpify
# Initialize your content structure
$ npx smcp init --output my-mcp
# Pull content and build static files
$ npx smcp build --output my-mcp
# Your MCP server is ready! 🚀
Everything you need to bridge your content with AI agents
Content is pre-built into static files. No database queries at runtime. Lightning fast responses for your AI agents.
Built with an adapter pattern. Contentful support out of the box, with room to add any content source you need.
Implements the Model Context Protocol with streamable HTTP transport. Works with any MCP-compatible AI client.
Tools are auto-generated from your content structure. List entries, get details, and access specific content fields.
Runs on any Node.js server, Netlify Functions, Cloudflare Workers, Deno, or Bun. First-class serverless support.
Full TypeScript codebase with Zod validation. Type-safe from config to runtime, with descriptive error messages.
Three steps from content to AI-accessible MCP server
Run smcp init to set up your output directory. The CLI connects to your Contentful space and lets you pick content types and configure which fields power each tool.
$ npx smcp init --output my-mcp
# Creates:
# my-mcp/config.json
# my-mcp/content/entries/<type>/config.json
# my-mcp/content/assets/
Run smcp build to pull content from your CMS and generate markdown files, data.json files, and download assets.
$ npx smcp build --output my-mcp
# Generates per entry:
# content/entries/person/bob-smith/data.json
# content/entries/person/bob-smith/tools/biography.md
# content/entries/person/bob-smith/tools/skills.md
The MCP server reads your static files and auto-generates tools. Connect any MCP client and start querying.
# Auto-generated MCP tools:
list_person # Filter & list people
get_person # Get person data.json
get_person_biography # Get biography markdown
get_person_skills # Get skills markdown
list_assets # List all assets
get_asset # Get asset details by name
my-mcp/
├── config.json # Source configuration
└── content/
├── assets/ # Asset metadata (JSON)
│ └── photo.json
└── entries/
├── person/
│ ├── config.json # Tools: biography, skills
│ ├── bob-smith/
│ │ ├── data.json # All non-rich-text fields
│ │ └── tools/
│ │ ├── biography.md # Rich text → Markdown
│ │ └── skills.md
│ └── steve-baker/
│ ├── data.json
│ └── tools/
│ ├── biography.md
│ └── skills.md
└── place/
├── config.json
└── work-site/
├── data.json
└── tools/
└── description.md
A web standard handler for serverless, and a Node.js handler for Express
// Netlify Functions, Cloudflare Workers, Deno, Bun
import { handleMcpRequest } from 'static-mcpify/web-handler';
export default async (req: Request) => {
if (req.method === 'GET') {
return new Response(
JSON.stringify({ status: 'ok' }),
{ headers: { 'Content-Type': 'application/json' } }
);
}
return handleMcpRequest('./my-mcp/content', req);
};
Takes a web standard Request, returns a Response.
Uses JSON responses instead of SSE streaming — works reliably in stateless serverless environments.
// Traditional Node.js HTTP server
import { handleMcpRequest } from 'static-mcpify/handler';
import express from 'express';
const app = express();
app.use(express.json());
app.all('/mcp', async (req, res) => {
await handleMcpRequest(
'./my-mcp/content', req, res
);
});
app.listen(3000);
Works with Node.js IncomingMessage / ServerResponse.
Uses SSE streaming for real-time responses in long-lived server processes.
A concrete example: this project's own Netlify deployment
Each MCP endpoint is a small function that imports handleMcpRequest from static-mcpify/web-handler and points it at your content directory.
Set the functions directory and use node_bundler = "nft" (Node File Tracing) to resolve workspace dependencies.
Connect your repo to Netlify and push. Your MCP server is live and accessible to any MCP client.
import type { Context } from '@netlify/functions';
import { handleMcpRequest } from 'static-mcpify/web-handler';
import path from 'path';
const contentDir = path.join(process.cwd(), 'examples/static/content');
export default async (req: Request, _context: Context): Promise<Response> => {
if (req.method === 'GET') {
return new Response(
JSON.stringify({ status: 'ok', server: 'static-mcp' }),
{ status: 200, headers: { 'Content-Type': 'application/json' } }
);
}
return handleMcpRequest(contentDir, req);
};
export const config = {
path: '/example/static/mcp',
includedFiles: ['../../examples/static/content/**'],
};
[build]
publish = "netlify/brand"
command = "npm run build:ts && npm run build:contentful"
[build.environment]
NODE_VERSION = "22"
[functions]
directory = "netlify/functions"
node_bundler = "nft"
First-class integration with the Contentful CMS
Add your Contentful API token and Space ID to a .env file.
Run smcp init --output my-mcp. The CLI will connect to your Contentful space, show you all available content types, and let you pick which fields to expose as tools.
Run smcp build --output my-mcp. All entries are pulled, rich text fields converted to markdown, and assets downloaded.
Push to Netlify (or any server) and your MCP endpoint is live.
CONTENTFUL_API_TOKEN=nP...your_token...mo
SPACE_ID=1x...your_space...mb
{
"contentType": "blog",
"tools": [
{
"name": "summary",
"fields": ["summary", "tags"]
},
{
"name": "body",
"fields": ["body"]
}
]
}
Contentful rich text fields are automatically converted to clean Markdown for optimal AI consumption.
Referenced images and files are automatically downloaded to the local assets directory.
Use --content-type flags to rebuild only specific content types.
Live MCP servers you can connect to right now
A simple MCP server with pre-built static content about people and places. No CMS credentials needed.
{
"static-example": {
"type": "http",
"url": "https://static-mcpify.alexlockhart.me/example/static/mcp"
}
}
An MCP server built from Contentful content at deploy time, featuring adventures and campaigns from a fantasy world.
{
"contentful-example": {
"type": "http",
"url": "https://static-mcpify.alexlockhart.me/example/contentful/mcp"
}
}
Tip: These are live MCP servers running on Netlify Functions. Copy the JSON above into your VS Code mcp.json file to connect with GitHub Copilot or any MCP client.
Get started in under 5 minutes. Open source, free forever.