DE

DevHub MCP Server: CMS Website Content Management

Manage website content with the DevHub MCP server to streamline CMS workflows, publish updates, and control assets across your site.

Quick Install
npx -y @devhub/devhub-cms-mcp

Overview

The DevHub MCP Server is a lightweight backend that centralizes website content, assets, and publication workflows while exposing content as structured context for model-driven processes. It implements the Model Context Protocol (MCP) patterns so downstream tools — including automated pipelines and LLM-based editors — can fetch normalized site state and make context-aware edits or suggestions.

The server is intended for developer teams who need to coordinate content updates, control asset distribution, and integrate content operations into CI/CD or model-augmented workflows. It supports local or S3-backed storage, a REST API for content and asset management, and webhook hooks for automated publishing and notifications.

Features

  • REST API for content CRUD, asset upload/download, and publication control
  • MCP-compatible context endpoint for model and automation integrations
  • Support for local filesystem or S3-compatible storage backends
  • Authentication via JWT or API tokens, with role-aware endpoints (editor, publisher)
  • Webhook events on content changes and publish actions
  • Optional CLI and SDK for local workflows and automation scripts
  • Configurable caching and pagination for large sites
  • Audit logs and basic versioning for content entries

Installation / Configuration

Clone the repository and install dependencies:

git clone https://github.com/devhub/devhub-cms-mcp.git
cd devhub-cms-mcp
npm install

Run locally (development):

# copy example env and edit as needed
cp .env.example .env

# start the server
npm run dev

Run with Docker (example using Docker Compose):

# docker-compose.yml
version: "3.8"
services:
  devhub-mcp:
    image: devhub/devhub-cms-mcp:latest
    ports:
      - "8080:8080"
    environment:
      - PORT=8080
      - STORAGE_TYPE=s3
      - S3_BUCKET=your-bucket
      - S3_REGION=us-east-1
      - JWT_SECRET=changeme
    volumes:
      - ./data:/data

Configuration environment variables

VariableDefaultDescription
PORT8080HTTP server port
STORAGE_TYPEfilesystemStorage backend: filesystem or s3
STORAGE_PATH./dataLocal storage path (for filesystem)
S3_BUCKETS3 bucket name (if STORAGE_TYPE=s3)
S3_REGIONS3 region
S3_ACCESS_KEYS3 access key
S3_SECRET_KEYS3 secret key
JWT_SECRETchangemeSecret for signing JWT auth tokens
DATABASE_URLOptional relational DB connection string for audit/versioning
MCP_TOKENToken required for MCP context endpoint (optional)

Authentication

  • The server supports JWT bearer tokens. Include Authorization: Bearer on protected endpoints.
  • You can seed admin tokens via environment variables or create users through the admin API.
  • Available Resources

    API endpoints (examples)

    • GET /mcp/context
      • Returns structured site context (content entries, asset metadata, routing) suitable for MCP clients.
    • GET /api/content
      • List content entries with pagination and filters.
    • GET /api/content/:id
      • Retrieve a single content item (Markdown, JSON, or structured model).
    • POST /api/content
      • Create or update content (body, metadata, locale).
    • POST /api/publish/:id
      • Publish a content entry to the live channel; triggers webhooks.
    • POST /api/assets
      • Upload an asset (images, media). Returns URL and metadata.
    • GET /api/assets/:id
      • Retrieve asset metadata or stream the file.
    • POST /api/webhooks/register
      • Register webhook callbacks for publish/content events.

    CLI and SDK

    • The project includes a small CLI for local dev commands (start, validate, export) and a JavaScript SDK that wraps the REST API for scripted workflows. Check the repository’s /cli and /sdk folders for usage examples.

    Documentation and API docs

    • Auto-generated OpenAPI/Swagger docs are available at /docs when running the server locally.

    Use Cases

    1. Collaborative editorial workflow

      • Editors create or update content via the REST API or UI. Changes are stored, audited, and only published after review. Webhooks notify external systems (search indexing, static site builders) when a publish event occurs.
    2. CI/CD-driven publishing

      • A CI pipeline fetches content previews from /mcp/context, runs automated validation and tests, then triggers POST /api/publish/:id to release updates. Artifacts (static builds) can be synced using published asset URLs.
    3. Model-augmented content generation

      • An LLM-based assistant queries GET /mcp/context to receive structured page context and metadata. The assistant proposes edits which are then POSTed to /api/content for review and publication.
    4. Asset distribution and optimization

      • Upload assets to /api/assets. The MCP server stores files (local or S3), provides canonical URLs, and publishes metadata so CDNs or image services can fetch and optimize assets.
    5. Multi-locale and A/B testing

      • Store localized content variants and use the publish endpoint to control which variant is live. Use metadata fields to coordinate A/B test assignment and rollbacks.

    Example Requests

    Fetch MCP context (requires MCP token or auth):

    curl -H "Authorization: Bearer $MCP_TOKEN" \
      https://devhub.example.com/mcp/context
    

    Create or update content:

    curl -X POST https://devhub.example.com/api/content \
      -H "Authorization: Bearer $EDITOR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "id": "about-page",
        "title": "About",
        "body": "# About our product",
        "metadata": {"status":"draft","locale":"en"}
      }'
    

    Upload an asset:

    curl -X POST https://devhub.example.com/api/assets \
      -H "Authorization: Bearer $EDITOR_TOKEN" \
      -F "file=@./hero.jpg"
    

    Use these examples as starting points; check the running server’s /docs for the full OpenAPI schema.

    Notes and Best Practices

    • For production, prefer S3 (or S3-compatible) storage and a managed database for audit/version history.
    • Protect MCP endpoints with tokens and limit access to automation clients and trusted editors.
    • Use webhooks to connect publishing events to downstream systems (static site generator, search index, analytics).
    • Implement content validation and linting steps in CI to prevent malformed content from being published.