Cloudflare MCP Static Server

Provides up-to-date static-site content to MCP clients via a Cloudflare worker and R2-backed search index.
  • typescript

0

GitHub Stars

typescript

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

Turn your static site into an AI-accessible knowledge base by exposing its content through an MCP server running on Cloudflare. This lets AI tools search and retrieve your content with up-to-date results, while keeping the transport and sessions managed by Cloudflare.

How to use

Connect an MCP client to the server endpoint to start searching your content. The MCP server lets you perform keyword searches across your pages, retrieve full articles by URL, and fetch index information such as page counts and tool names. Use this to enable AI assistants to cite accurate, up-to-date content from your site.

How to install

Prerequisites and initial setup are required to run the MCP server. You will need a Cloudflare account to host the worker and the data bucket, and you must have a content adapter that generates search-index.json from your site.

# 1. Clone the project and install dependencies
git clone https://github.com/lennyzeltser/cloudflare-mcp-for-static-sites.git my-site-mcp
cd my-site-mcp
bun install

# 2. Configure the Cloudflare worker and R2 bucket

Configuration

The server is configured to run on Cloudflare with a dedicated R2 bucket for the search index. You specify the bucket binding and route in the Cloudflare configuration, and you point the adapter output to the R2 bucket so the worker can serve search results.

{
  "name": "my-site-mcp-server",
  "routes": [
    { "pattern": "mcp.example.com", "custom_domain": true }
  ],
  "r2_buckets": [
    { "binding": "SEARCH_BUCKET", "bucket_name": "my-site-mcp-data" }
  ]
}

Development and deployment

After configuring, generate and upload your index, then deploy the MCP server. The workflow includes building the index from your content, uploading it to the R2 bucket, and deploying the Cloudflare worker.

# Generate the index from your content using your chosen adapter
node adapters/generic/generate-index.js \
  --content-dir=../my-site/content \
  --site-name="My Site" \
  --site-domain="example.com" \
  --tool-prefix="mysite"

# Upload to R2
npx wrangler r2 object put my-site-mcp-data/search-index.json \
  --file=./search-index.json \
  --content-type=application/json

# Deploy the MCP server
bun run deploy

Troubleshooting

If you encounter issues, verify the index is present in R2, ensure the MCP endpoint is reachable, and confirm the client is using the correct /mcp endpoint. Common problems include a missing index file, endpoint misconfiguration, or network access restrictions.

Examples

Two example deployments show how the MCP server can be used to expose static site content to AI tools.

Available tools

search_<prefix>

Search by keywords across the indexed content, returning matching titles, URLs, dates, and summaries.

get_article

Retrieve full content for a specific page by its URL path.

get_index_info

Provide index statistics such as page count and available tools.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational