xkcd-mcp
MCP server to fetch xkcd comics (latest, random, by number, search) and display them with rich in-chat previews via the official JSON API and explainxkcd semantic search.
README
xkcd-mcp
<p align="center"> <a href="https://github.com/casey/just"><img src="https://img.shields.io/badge/just-ready_to_go-7c5cfc?style=flat-square&logo=just&logoColor=white" alt="Just"></a> <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a> <a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.13+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python"></a> <a href="https://github.com/PrefectHQ/fastmcp"><img src="https://img.shields.io/badge/FastMCP-3.2-7c5cfc?style=flat-square" alt="FastMCP"></a> </p>
📖 Installation Guide — quick start, manual setup, and troubleshooting
MODEL CONTEXT PROTOCOL fine print sold separately
The part humans read first
xkcd-mcp Comics for your LLM. Official JSON API (/info.0.json), unofficial amount of stick-figure drama.
You get a small Vite dashboard with a comic-panel hero: stick people, a speech bubble that says MCP, explain this, and a box labeled JSON that definitely understands your feelings. The README cant draw SVG, so imagine it badlysame energy as the web app.
Alt text (this repo): A README receives a pull request titled make it whimsical. The CI passes. The narrator questions whether that was ever in scope.
Alt text (the app): A tiny server labeled JSON gets enthusiastic waves while someone negotiates with the universe. Hover tooltips not included; thats what the comic alt is for.
No scraping. No Explainxkcd body fetch. Were not here to parse HTML like its 2003.
Repo: github.com/sandraschi/xkcd-mcp
Quick Start
git clone https://github.com/sandraschi/xkcd-mcp
cd xkcd-mcp
just
This opens an interactive dashboard showing all available commands. Run just bootstrap to install dependencies, then just serve or just dev to start.
Manual Setup
If you don't have just installed:
Technical details
What it is
- MCP server + HTTP API exposing xkcd metadata and image URLs via the official API and explainxkcd semantic search.
- Web UI calls
POST /api/comicwith the same operations as the tool (latest,random,by_number,search).
MCP tools
| Tool | Description | Arguments |
|---|---|---|
xkcd_latest |
Fetch the most recent comic. | None |
xkcd_get |
Fetch a specific comic by number. | comic_number (int) |
xkcd_random |
Fetch a random surprise comic. | None |
xkcd_search |
Search comics by topic (aliens, climate). | query (str) |
xkcd_help |
Display usage guide and system info. | None |
Prefab UI (Rich In-Chat Comics)
When installed with the apps extra and used in a compatible client (Claude Desktop, Antigravity), these tools render a rich PrefabApp card containing:
- The comic image (high-resolution, base64-encoded).
- The comic title and number.
- The alt text directly below the image for context.
- A link to the original xkcd page.
This provides a seamless, visual way to consume comics without leaving the chat interface.
Install
To get started, clone the repository and sync dependencies:
git clone https://github.com/sandraschi/xkcd-mcp.git
Set-Location xkcd-mcp
# Sync all dependencies (v0.2.0)
uv sync
# RECOMMENDED: FastMCP 3.2 Prefab UI support (rich in-chat comics)
uv sync --extra apps
MCP Configuration (Claude / Antigravity)
Add the following to your mcp_config.json (Antigravity) or claude_desktop_config.json (Claude):
{
"mcpServers": {
"xkcd": {
"command": "uv",
"args": ["--directory", "D:/Dev/repos/xkcd-mcp", "run", "xkcd-mcp"],
"env": {
"XKCD_PREFAB_APPS": "1"
}
}
}
}
[!TIP] Ensure the
argspath matches your actual disk location. Usinguv runis the most reliable way to ensure the correct environment andappsextra are loaded.
Run Manual Start
uv run xkcd-mcp --serve
| Item | Value |
|---|---|
| HTTP | http://127.0.0.1:10778 /health, /docs |
| MCP | http://127.0.0.1:10778/mcp |
| Env | XKCD_MCP_HOST, XKCD_MCP_PORT (default 10778), XKCD_MCP_HTTP_PATH (default /mcp) |
Run web UI (SPA)
.\web_sota\start.ps1
Or double-click web_sota\start.bat (launches the same script).
http://127.0.0.1:10779/ (same repo root as install)
Fleet docs (LLM index)
llms.txtshort index;llms-full.txttools, env, ports, troubleshooting.
🛡️ Industrial Quality Stack
This project adheres to SOTA 14.1 industrial standards for high-fidelity agentic orchestration:
- Python (Core): Ruff for linting and formatting. Zero-tolerance for
printstatements in core handlers (T201). - Webapp (UI): Biome for sub-millisecond linting. Strict
noConsoleLogenforcement. - Protocol Compliance: Hardened
stdout/stderrisolation to ensure crash-resistant JSON-RPC communication. - Automation: Justfile recipes for all fleet operations (
just lint,just fix,just dev). - Security: Automated audits via
banditandsafety.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。