hugo-llms-mcp

hugo-llms-mcp

A generic MCP (Model Context Protocol) server for any Hugo blog, deployed on Cloudflare Workers. It reads your blog's llms.txt and llms-full.txt files and exposes them as structured tools that AI assistants can query to understand your content.

Category
访问服务器

README

Hugo MCP server

A generic MCP (Model Context Protocol) server for any Hugo blog, deployed on Cloudflare Workers.

It reads your blog's llms.txt and llms-full.txt files and exposes them as structured tools that AI assistants (Claude, Cursor, and others) can query to understand your content.


How it works

Your Hugo blog           Cloudflare Worker          AI assistant
─────────────────        ──────────────────         ──────────────
/llms.txt          ───►  /mcp  (MCP tools)  ◄───►  Claude / Cursor
/llms-full.txt     ───►  /llms.txt (proxy)          etc.
                         /llms-full.txt (proxy)

The Worker fetches your blog's llms.txt and llms-full.txt at runtime (with an in-memory cache), and exposes three MCP tools:

Tool What it does
get_blog_summary Returns the concise overview from /llms.txt
get_blog_full_index Returns the full content index from /llms-full.txt
search_content Searches for a keyword across the full index and returns matching paragraphs with context

Prerequisites

  • A Hugo blog publicly accessible on the web
  • llms.txt and llms-full.txt files in your Hugo static/ folder (see Step 1)
  • A Cloudflare account (free tier is enough)
  • Node.js ≥ 18
  • Wrangler CLI (npm install -g wrangler)

Step 1 — Create your llms.txt files

llms.txt and llms-full.txt are plain-text files that describe your blog's content to language models. They live in your Hugo static/ folder and are served automatically at /llms.txt and /llms-full.txt.

Option A — Use the helper script

# Clone this repo
git clone https://github.com/your-username/hugo-llms-mcp.git
cd hugo-llms-mcp

# Edit the configuration at the top of the script
nano scripts/generate-llms.py

# Run it — outputs static/llms.txt and static/llms-full.txt
python3 scripts/generate-llms.py

Then copy the generated files to your Hugo site's static/ folder, review and enrich them manually, and redeploy your site.

Option B — Write them by hand

static/llms.txt (summary, ~50 lines):

# My Hugo Blog

> One-line tagline for your blog.

Author: Your Name
Site: https://your-hugo-blog.com
Language(s): English

## Description

Two or three sentences describing what the blog is about,
who the author is, and who it's for.

## Published content

- Post Title One (Month Year) — https://your-hugo-blog.com/posts/post-one/
- Post Title Two (Month Year) — https://your-hugo-blog.com/posts/post-two/

## Instructions for language models

- Content may be freely summarised with attribution and a link to the source.
- Short excerpts may be quoted for informational purposes.
- Reproduction of full articles is not permitted.

static/llms-full.txt (extended index, as long as needed):

# My Hugo Blog
# llms-full.txt — Extended index for language models

Site: https://your-hugo-blog.com
Author: Your Name
Generated: June 2026

---

## Author profile

A longer bio of the author.

---

## Content

---

### Post Title One

URL: https://your-hugo-blog.com/posts/post-one/
Date: January 2025
Description: A detailed summary of what this post covers,
key points made, people or places mentioned, and tone.

---

### Post Title Two

...

Tip: The more detailed llms-full.txt is, the more useful the search_content tool becomes. Include summaries, key locations, episode descriptions, and any cross-references between posts.

Verify the files are live

After deploying your Hugo site, check:

https://your-hugo-blog.com/llms.txt
https://your-hugo-blog.com/llms-full.txt

Both should return plain text. If they do, you're ready for Step 2.


Step 2 — Configure the Worker

Clone this repo (if you haven't already) and edit wrangler.toml:

name = "my-blog-mcp"            # becomes my-blog-mcp.<account>.workers.dev

[vars]
SITE_URL     = "https://your-hugo-blog.com"
SITE_NAME    = "My Hugo Blog"
CACHE_TTL_SEC = "3600"          # cache TTL in seconds; 0 = always fetch fresh

Step 3 — Deploy

# Install dependencies
npm install

# Log in to Cloudflare (once)
wrangler login

# Deploy
npm run deploy

Wrangler will print the Worker URL:

https://my-blog-mcp.<your-account>.workers.dev

Step 4 — Verify

# Health check
curl https://my-blog-mcp.<your-account>.workers.dev/health

# List MCP tools
curl -s -X POST https://my-blog-mcp.<your-account>.workers.dev/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | python3 -m json.tool

# Search for a keyword
curl -s -X POST https://my-blog-mcp.<your-account>.workers.dev/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_content","arguments":{"query":"your keyword","max_results":3}}}' | python3 -m json.tool

Step 5 — Connect to Claude

Claude.ai

Settings → Connectors → Add MCP Server:

https://my-blog-mcp.<your-account>.workers.dev/mcp

Claude Desktop

Install the mcp-remote bridge (needed because Claude Desktop doesn't yet support remote MCP natively):

npm install -g mcp-remote

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "my-blog": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://my-blog-mcp.<your-account>.workers.dev/mcp"
      ]
    }
  }
}

Restart Claude Desktop. The three tools will appear in the tool list.

Cursor / other MCP clients

Use the Worker URL directly: https://my-blog-mcp.<your-account>.workers.dev/mcp


Updating content

The Worker fetches content from your live site and caches it in memory for CACHE_TTL_SEC seconds (default: 1 hour). So when you publish new posts:

  1. Update llms.txt and llms-full.txt in your Hugo static/ folder.
  2. Redeploy your Hugo site — the Worker will pick up the changes automatically within the cache TTL.

No need to redeploy the Worker itself unless you change wrangler.toml or src/index.js.


Project structure

hugo-llms-mcp/
├── src/
│   └── index.js          ← Cloudflare Worker (MCP server logic)
├── scripts/
│   └── generate-llms.py  ← Helper to scaffold llms.txt files
├── wrangler.toml         ← Cloudflare configuration (edit this)
├── package.json
├── .gitignore
├── LICENSE
└── README.md

Cloudflare free tier limits

Resource Free limit
Requests 100,000 / day
CPU time 10 ms / request
Memory 128 MB
Script size 1 MB (compressed)

A typical blog MCP server uses well under all of these limits.


Real-world example

This project was originally built for ciclogravelista.com, a personal gravel cycling travel blog. The live MCP server is available at:

https://ciclogravelista-mcp.ciclogravelista.workers.dev/mcp

Source: github.com/your-username/ciclogravelista-mcp


License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选