static-mcpify
Pulls content from Contentful, builds it into static Markdown and JSON files, and serves them as an MCP server with tools to list and retrieve entries and assets.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@static-mcpifylist all blog posts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
static-mcpify
Turn any structured content into a static MCP (Model Context Protocol) server.
static-mcpify pulls content from your CMS (currently Contentful), builds it into static Markdown and JSON files, then serves those files as a fully-featured MCP server. Your AI agents get instant access to your content — no database, no runtime dependencies.
Website · Docs · Examples · Deploy Guide · npm · GitHub
Netlify Starter Templates
Static/filesystem starter: creates a new repo from
starters/netlify-static-starterand deploys bundled sample Markdown/JSON content immediatelyContentful starter: creates a new repo from
starters/netlify-contentful-starter, deploys bundled sample content immediately, and rebuilds from Contentful whenCONTENTFUL_API_TOKENandSPACE_IDare configuredBoth starters auto-wire a Netlify Function at
/mcp, ship anetlify.toml, and include a small landing page plus sample MCP client JSON
Related MCP server: Markdownify MCP Server
Quick Start
1. Install
npm install static-mcpify2. Initialize
Set your Contentful credentials in a .env file:
CONTENTFUL_API_TOKEN=your_token_here
SPACE_ID=your_space_id_hereRun the init wizard to choose content types and configure tools:
npx smcp init --output my-mcp3. Build
Pull content from Contentful and generate static files:
npx smcp build --output my-mcpBuild specific content types only:
npx smcp build --output my-mcp --content-type blog --content-type author4. Serve
Serverless (Netlify Functions, Cloudflare Workers, Deno, Bun)
Use the web standard handler — it takes a Request and returns a Response:
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);
};Express / Node.js HTTP
Use the Node.js handler for traditional server environments:
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);How It Works
Content Structure
After building, your output directory looks like:
my-mcp/
├── config.json
└── content/
├── assets/
│ └── photo.json
└── entries/
├── person/
│ ├── config.json # defaultTool + tools: biography, skills
│ ├── bob-smith/
│ │ ├── data.json # All non-rich-text fields
│ │ └── tools/
│ │ ├── _default.md # Output for get_person
│ │ ├── biography.md # Output for get_person_biography
│ │ └── skills.md
│ └── steve-baker/
│ ├── data.json
│ └── tools/
│ ├── _default.md
│ ├── biography.md
│ └── skills.md
└── place/
├── config.json
└── work-site/
├── data.json
└── tools/
└── description.md _default.md is only generated when defaultTool is configured for that entry type. Named tool files like biography.md or description.md are only generated for entries listed in tools.
Auto-Generated Tools
The MCP server dynamically creates tools based on the content structure:
Tool | Description |
| List assets, with optional filter |
| Get asset details by name |
| List entries of a content type, with optional filter |
| Get the configured default tool content by title slug |
| Get entry metadata JSON by title slug when enabled |
| Get a tool's markdown by title slug |
Tool names are MCP-safe identifiers, so dashes in content type IDs or tool names are normalized to underscores. For example, agent-skill becomes get_agent_skill.
All list tools return MCP structuredContent in the shape { "titles": ["...", "..."] } and advertise an outputSchema for that response.
For example, with content types person (default tool enabled, tools: biography, skills) and place (tools: description):
list_person/get_person/get_person_metadata/get_person_biography/get_person_skillslist_place/get_place/get_place_descriptionlist_assets/get_asset
Configuration
Output Config (config.json)
{
"source": "contentful",
"instructions": [
"Use list_* tools before get_* tools when you need to discover available titles."
]
}instructions is optional. When omitted, it defaults to "Use list_* tools before get_* tools when you need to discover available titles.".
These instructions are sent in the MCP initialize response as server-level guidance for clients.
Entry Config (content/entries/<type>/config.json)
{
"contentType": "person",
"format": "json",
"listTool": {
"description": "List all available people."
},
"includeMetadataTool": true,
"defaultTool": {
"description": "Get the primary biography for a specific person.",
"fields": ["biography"]
},
"tools": [
{
"name": "biography",
"fields": ["biography"]
},
{
"name": "skills",
"fields": ["skills", "certifications"]
}
]
}format is optional and defaults to "string".
listTool is optional. When present, it lets you override the description shown for list_<type>.
includeMetadataTool is optional and defaults to false.
defaultTool is optional. When present, it controls the content returned by get_<type>. When omitted, get_<type> is not registered.
tools is optional. Each named tool defines a name and which Contentful fields to include.
When format is "string", tool output is rendered as concatenated Markdown and returned in the MCP content field.
When format is "json", each configured field is returned as a property on MCP structuredContent, and the generated tool definition includes an outputSchema.
List tools always use structuredContent, regardless of format.
Live Examples
Try the hosted example MCP servers by adding these to your VS Code mcp.json:
Static Content Example (people and places):
{
"static-example": {
"type": "http",
"url": "https://static-mcpify.alexlockhart.me/example/static/mcp"
}
}Contentful Example (fantasy adventures and campaigns):
{
"contentful-example": {
"type": "http",
"url": "https://static-mcpify.alexlockhart.me/example/contentful/mcp"
}
}Adding a New Source Adapter
To add support for a new CMS (e.g., Sanity, Strapi):
Create
module/src/cli/sources/<name>/index.tsImplement the
SourceAdapterinterface frommodule/src/cli/sources/adapter.tsRegister it in
module/src/cli/sources/index.tsAdd the source name to the Zod enum in
module/src/types/config.ts
Development
Prerequisites
Node.js 22+
npm
Project Structure
module/ # Publishable npm package (static-mcpify)
├── src/
│ ├── types/ # Zod schemas and TypeScript types
│ ├── cli/ # smcp CLI tool (init + build commands)
│ │ └── sources/ # Source adapters (pluggable)
│ │ └── contentful/
│ └── server/ # MCP server + handlers
├── package.json
└── tsconfig.json
netlify/ # Brand website + hosted examples
├── brand/ # Static HTML/CSS brand website
├── functions/ # Netlify serverless function handlers
└── package.json
examples/ # Example content and configs
├── static/ # Pre-built static content (no CMS needed)
└── contentful/ # Contentful-backed content (built at deploy time)
test/ # Sanity testsThis is an npm workspace with two packages:
module/— The publishablestatic-mcpifynpm package (CLI + MCP server)netlify/— Brand website and Netlify serverless functions for hosted examples
Commands
Command | Description |
| Start both MCP servers (static + contentful) and brand website |
| TypeScript compile + build contentful example |
| TypeScript compile only |
| Sanity check MCP server endpoints |
| Run ESLint |
| Run ESLint with auto-fix |
Local Development
npm start runs three services concurrently:
Static MCP server at
http://localhost:3100/mcpContentful MCP server at
http://localhost:3101/mcpBrand website at
http://localhost:3102
Testing
Run the sanity tests, which spin up both MCP servers and verify health and MCP initialize responses:
npm testAlways run lint and TypeScript compilation before committing:
npm run lint
npm run build:tsNetlify Deployment
The project deploys to static-mcpify.alexlockhart.me via Netlify.
Pushes to
maintrigger automatic deploysBuild command:
npm run build:tsplusnpm run build:contentfulonly whenCONTENTFUL_API_TOKENandSPACE_IDare setnode_bundler = "nft"(Node File Tracing) resolves workspace packages in functionsEnvironment variables
CONTENTFUL_API_TOKENandSPACE_IDare set as secrets on Netlify
The Netlify functions use static-mcpify/web-handler which wraps the MCP SDK's WebStandardStreamableHTTPServerTransport with enableJsonResponse: true. This returns a JSON response instead of SSE streaming, which is required for stateless serverless environments.
License
ISC
Made by Alex Lockhart
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Personal context for every AI: search, read, and write back to your private Markdown library of articles, threads, PDFs, notes, and captured ChatGPT/Claude/Gemini/Grok conversations. OAuth 2.1 paste-and-authorize or revocable tiered Agent keys (read_only / edit / full). Every agent edit is versioned and revertible.
A Model Context Protocol server for Wix AI tools
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that intelligently fetches and processes web content, transforming websites and documentation into clean, structured markdown with nested URL crawling capabilities.210 npm9MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that converts diverse file types, including PDFs, images, audio, and Office documents, into Markdown format. It also transforms web content like YouTube transcripts and Bing search results into readable text for model consumption.13244 npmMIT
- AlicenseAqualityAmaintenanceExposes local markdown documentation, notes, and knowledge bases to AI tools via the Model Context Protocol without embeddings or uploading.41MIT
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that converts documents (PDF, DOCX, HTML, etc.) to Markdown, enabling AI agents to ingest and understand document content.MIT