Open Source · TypeScript · MCP

Turn any content into an MCP server

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.

Terminal
# 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! 🚀

Built for the AI era

Everything you need to bridge your content with AI agents

📦

Static by Design

Content is pre-built into static files. No database queries at runtime. Lightning fast responses for your AI agents.

🔌

Pluggable Sources

Built with an adapter pattern. Contentful support out of the box, with room to add any content source you need.

🤖

MCP Native

Implements the Model Context Protocol with streamable HTTP transport. Works with any MCP-compatible AI client.

🛠️

Dynamic Tools

Tools are auto-generated from your content structure. List entries, get details, and access specific content fields.

🚀

Deploy Anywhere

Runs on any Node.js server, Netlify Functions, Cloudflare Workers, Deno, or Bun. First-class serverless support.

📝

TypeScript First

Full TypeScript codebase with Zod validation. Type-safe from config to runtime, with descriptive error messages.

How it works

Three steps from content to AI-accessible MCP server

01

Initialize

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/
02

Build

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
03

Serve

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

📁 Output Structure

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

Two ways to serve

A web standard handler for serverless, and a Node.js handler for Express

Serverless — static-mcpify/web-handler
// 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.

Express — static-mcpify/handler
// 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.

Deploy to Netlify

A concrete example: this project's own Netlify deployment

1

Create a Netlify Function

Each MCP endpoint is a small function that imports handleMcpRequest from static-mcpify/web-handler and points it at your content directory.

2

Configure netlify.toml

Set the functions directory and use node_bundler = "nft" (Node File Tracing) to resolve workspace dependencies.

3

Push & Deploy

Connect your repo to Netlify and push. Your MCP server is live and accessible to any MCP client.

netlify/functions/static-mcp.ts
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/**'],
};
netlify.toml
[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"

Contentful as a source

First-class integration with the Contentful CMS

Setup in minutes

  1. Set environment variables

    Add your Contentful API token and Space ID to a .env file.

  2. Initialize

    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.

  3. Build

    Run smcp build --output my-mcp. All entries are pulled, rich text fields converted to markdown, and assets downloaded.

  4. Deploy

    Push to Netlify (or any server) and your MCP endpoint is live.

.env
CONTENTFUL_API_TOKEN=nP...your_token...mo
SPACE_ID=1x...your_space...mb
my-mcp/content/entries/blog/config.json
{
  "contentType": "blog",
  "tools": [
    {
      "name": "summary",
      "fields": ["summary", "tags"]
    },
    {
      "name": "body",
      "fields": ["body"]
    }
  ]
}
Rich Text Conversion

Contentful rich text fields are automatically converted to clean Markdown for optimal AI consumption.

Asset Downloads

Referenced images and files are automatically downloaded to the local assets directory.

Selective Building

Use --content-type flags to rebuild only specific content types.

Try the examples

Live MCP servers you can connect to right now

📄

Static Content Example

A simple MCP server with pre-built static content about people and places. No CMS credentials needed.

Content Types:
  • Person: Bob Smith & Steve Baker with biography and skills
  • Place: The Big Mountain & Work Site with descriptions
Add to VS Code mcp.json
{
  "static-example": {
    "type": "http",
    "url": "https://static-mcpify.alexlockhart.me/example/static/mcp"
  }
}
⚔️

Contentful Example

An MCP server built from Contentful content at deploy time, featuring adventures and campaigns from a fantasy world.

Content Types:
  • Adventure: 7 epic adventures with detailed descriptions
  • Campaign: 2 campaign arcs with story overviews
Add to VS Code mcp.json
{
  "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.

Ready to mcpify your content?

Get started in under 5 minutes. Open source, free forever.