halans-mcp-server
Enables querying halans.com content via search, section retrieval, full content, and summaries.
README
Halans Content MCP Server
This MCP (Model Context Protocol) server provides content querying tools for halans.com. It offers two deployment options: a local stdio-based server for direct Claude Desktop integration, and a Cloudflare Workers deployment for remote access.
Available Tools
The MCP server provides four content querying tools:
- search_content - Search for specific terms in halans.com content with context
- get_section - Retrieve specific sections by title/heading
- get_full_content - Get the complete content with optional truncation
- get_content_summary - Generate content statistics and table of contents
Available Resources
The MCP server also exposes three browseable resources:
- halans://content - Complete content from halans.com in plain text format
- halans://content-summary - Content statistics and hierarchical table of contents
- halans://articles-list - Structured JSON list of all blog articles with titles, dates, URLs, and excerpts
Quick Start
Option 1: Local Stdio Server (Recommended)
- Clone and install dependencies:
git clone https://github.com/halans/halans-mcp-server
cd halans-mcp-server
npm install
- Configure Claude Desktop by adding to your MCP config:
{
"mcpServers": {
"halans-content": {
"command": "node",
"args": ["/path/to/halans-mcp-server/mcp-stdio.js"],
"env": {}
}
}
}
- Restart Claude Desktop and the tools will be available.
Option 2: Cloudflare Workers Deployment
-
Prerequisites:
- Sign up for a Cloudflare account
- Install Wrangler CLI
-
Authenticate with Cloudflare:
npx wrangler login
- Deploy to Cloudflare Workers:
npm run deploy
This will deploy your MCP server to a URL like: halans-mcp-server.<your-account>.workers.dev/sse
Cloudflare Workers Features
This MCP server leverages several Cloudflare Workers features:
- Edge Computing: Runs close to users worldwide for low latency
- Durable Objects: Maintains stateful MCP agent instances
- Server-Sent Events: Real-time communication with MCP clients
- No Cold Starts: Fast response times with Cloudflare's V8 isolates
- Built-in Observability: Monitoring and analytics through Cloudflare dashboard
Worker Configuration
The server exposes two endpoints:
/sse- Server-Sent Events endpoint for MCP communication/mcp- Standard MCP endpoint
Configuration is managed in wrangler.jsonc:
{
"name": "halans-mcp-server",
"main": "src/index.ts",
"compatibility_date": "2025-03-10",
"durable_objects": {
"bindings": [
{
"class_name": "MyMCP",
"name": "MCP_OBJECT"
}
]
}
}
Development
Local Development with Wrangler
# Start the Cloudflare Workers dev server
npm run dev
# Run TypeScript type checking
npm run type-check
# Format code
npm run format
# Fix linting issues
npm run lint:fix
Local Development with Stdio Server
# Test the stdio server directly
node mcp-stdio.js
# The server will wait for MCP protocol messages on stdin
Project Structure
├── src/
│ └── index.ts # Cloudflare Workers MCP server
├── mcp-stdio.js # Local stdio MCP server
├── package.json # Dependencies and scripts
├── wrangler.jsonc # Cloudflare Workers config
├── CLAUDE.md # Claude-specific documentation
└── README.md # This file
Content Sources
The server uses two different content sources with separate 5-minute caching:
Tools Content (https://halans.com/llms-full.txt)
Used by search_content, get_section, get_full_content, and get_content_summary tools:
- Complete blog content with full article text
- Technical documentation and detailed explanations
- Comprehensive project descriptions
- Full conference notes and insights
Resources Content (https://halans.com/llms.txt)
Used by the browseable resources (halans://content, etc.):
- Sorted chronological list of articles (year descending)
- Article titles, publication dates, and URLs
- Structured metadata for easy browsing
- Content excerpts and summaries
Test locally with MCP Inspector
npx @modelcontextprotocol/inspector
Connecting to Claude Desktop
For Local Stdio Server
Add this to your Claude Desktop MCP configuration:
{
"mcpServers": {
"halans-content": {
"command": "node",
"args": ["/absolute/path/to/mcp-stdio.js"],
"env": {}
}
}
}
For Deployed Workers (with mcp-remote)
{
"mcpServers": {
"halans-content": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-worker-url.workers.dev/sse"
]
}
}
}
Connect to Cloudflare AI Playground
For deployed Workers, you can test the MCP server using Cloudflare AI Playground:
- Go to https://playground.ai.cloudflare.com/
- Enter your deployed MCP server URL (
your-worker-url.workers.dev/sse) - Test the content querying tools directly
Run MCP inspector
npx @modelcontextprotocol/inspector@latest
Deployment Customization
Custom Domain (Optional)
To use a custom domain with your Cloudflare Worker:
- Add a custom domain in your Cloudflare dashboard
- Update
wrangler.jsoncwith your domain:
{
"routes": [
{
"pattern": "mcp.yourdomain.com/*",
"custom_domain": true
}
]
}
Environment Variables
Add environment variables for configuration:
# Set environment variables
npx wrangler secret put API_KEY
npx wrangler secret put CONTENT_URL
Then access them in your Worker:
// In src/index.ts
const toolsContentUrl = env.TOOLS_CONTENT_URL || "https://halans.com/llms-full.txt";
const resourcesContentUrl = env.RESOURCES_CONTENT_URL || "https://halans.com/llms.txt";
Troubleshooting
Common Issues
-
MCP Connection Failed
- Ensure the server URL is correct
- Check that the Worker is deployed and accessible
- Verify Claude Desktop configuration
-
Content Fetching Errors
- Check if
https://halans.com/llms-full.txtandhttps://halans.com/llms.txtare accessible - Verify network connectivity from the Worker
- Monitor Cloudflare logs for fetch errors
- Check if
-
Development Server Issues
- Run
npm installto ensure dependencies are installed - Check Node.js version compatibility (v18+ recommended)
- Use
npm run type-checkto identify TypeScript errors
- Run
Monitoring
- View Worker logs in the Cloudflare dashboard
- Use
wrangler tailfor real-time log monitoring - Monitor MCP server logs in Claude Desktop
Customization
To add your own tools:
- Stdio server: Edit
mcp-stdio.jsand add new tool handlers - Workers server: Edit
src/index.tsand add tools in theinit()method
Example: Adding a New Tool
// In src/index.ts or mcp-stdio.js
this.server.tool(
"new_tool",
{
parameter: z.string().describe("Tool parameter")
},
async ({ parameter }) => {
// Tool implementation
return {
content: [{ type: "text", text: `Result: ${parameter}` }]
};
}
);
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。