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
# 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, serverless functions, or edge runtime. First-class Netlify support included.

📝

TypeScript First

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

How it works

Three simple steps from content to AI-accessible MCP server

01

Initialize

Run smcp init to set up your output directory. Choose your content types and define 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 info

📁 Output Structure

my-mcp/
├── config.json                          # Source configuration
└── content/
    ├── assets/                          # Downloaded assets
    │   └── photo.png
    └── 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

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.

Deploy to Netlify

Serverless MCP endpoints in seconds

1

Add netlify.toml

Configure your build and function settings. static-mcpify includes a ready-made configuration.

2

Create Netlify Functions

Each MCP endpoint is a Netlify function that serves content from your static files.

3

Push & Deploy

Connect your repo to Netlify and deploy. Your MCP server is live at /example/static/mcp.

netlify.toml
[build]
  publish = "brand"

[functions]
  directory = "netlify/functions"
  node_bundler = "esbuild"

[[redirects]]
  from = "/example/static/mcp"
  to = "/.netlify/functions/static-mcp"
  status = 200

[[redirects]]
  from = "/example/contentful/mcp"
  to = "/.netlify/functions/contentful-mcp"
  status = 200
netlify/functions/static-mcp.ts
import { createMcpServer } from 'static-mcpify';

// The server reads your content directory
// and auto-generates MCP tools
const server = createMcpServer(contentDir);

// Connect transport and handle requests
await server.connect(transport);
await transport.handleRequest(req, res, body);

Ready to mcpify your content?

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