
Luogu MCP Server
io.github.Kaiserunix由 GitHub 帳號 Kaiserunix 發布v0.2.1更新於 Oct 24, 2026
Search Luogu problems, fetch statements, explore problem sets and get practice recommendations.
概覽
面向洛谷的唯讀 MCP 伺服器:搜尋演算法題、取得題目敘述與範例、瀏覽題單,並取得練習推薦。
- 可以做什麼
- 依關鍵字、主題、標題片段、題號或標籤搜尋題目,並把貼上的連結或題號解析成題目
- 取得題目的敘述、格式、範例、標籤、難度與連結
- 搜尋並取得洛谷訓練題單,涵蓋官方題單與使用者分享題單
- 依主題或學生痛點尋找相關練習與推薦,支援別名與標籤擴充
- 列出演算法主題、依 uid 取得公開使用者資料,並回報哪些功能可用
- 適用情境
- 適合讓助理協助洛谷練題:尋找某個主題的題目、把題目敘述與範例帶進上下文、整理練習題單,或針對特定困惑推薦後續題目。
- 執行需求
- 可使用託管的 Streamable HTTP 端點(免安裝),或透過 npx 或 node 執行本機 npm 套件,需要 Node.js。需要能連線到洛谷的公開網頁端點。公開唯讀工具不需帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Luogu MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.Kaiserunix%2Fluogu-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"luogu": {
"type": "http",
"url": "https://luogu-mcp-server.lantangtang54.workers.dev/mcp"
}
}
}README
Luogu MCP Server | 洛谷 MCP Server
A small MCP server for searching Luogu problems, reading statements and training sets, and finding related practice. It can run locally through npm or as a hosted Streamable HTTP server.
Quick Start
Use the hosted read-only server without installing anything:
To keep the server on your machine, use the published luogu-mcp-server package:
Then ask:
Tools
All tools are read-only.
Availability
- Hosted MCP:
https://luogu-mcp.ksrnyx.top/mcp - Health:
https://luogu-mcp.ksrnyx.top/health - Official MCP Registry:
io.github.Kaiserunix/luogu-mcp-server, described byserver.json
Other Ways To Run
From source:
Use node directly from a source checkout:
Example Calls
Search problems:
Search problems with a Luogu tag filter:
Fetch a problem:
Recommend from a pain point:
Resolve a pasted URL:
Find related practice:
Find topic practice with alias expansion:
Fetch a public user profile:
Search training/problem sets:
type: "all" is the default. It combines title-filtered official sets with selected user-shared set search. Use type: "official" for the public official index, or type: "select" for selected user-shared sets.
Luogu Route Parity
This project mirrors the useful shape of richer LeetCode MCP servers while respecting what Luogu exposes publicly:
- Available now: problem search, problem fetch, URL/id/title resolution, related problem discovery, training set search/fetch, public user profile fetch.
- Auth-required in live probes: recent submissions, public solution pages, and discussion pages.
- Planned but intentionally not enabled: solution submission/run-code tools. Those require authenticated session handling and explicit write-tool safety gates.
Development
Cloudflare Worker Deployment
This package also includes a stateless Streamable HTTP MCP entrypoint for Cloudflare Workers.
The Worker exposes the same read-only tools at /mcp, with a health endpoint at / or /health.
Verify a deployed Worker:
For private deployments, set LUOGU_MCP_TOKEN with wrangler secret put and configure your MCP client to send an Authorization: Bearer <token> header where supported. Browser Origin requests are rejected by default; set LUOGU_MCP_ALLOWED_ORIGINS to a comma-separated origin list if browser access is needed.
See docs/cloudflare-deployment.md for the full release checklist.
Run broad live checks against Luogu's current website responses:
The live smoke starts the MCP server through a real stdio client, then compares problem fetches, problem searches, training searches, training fetches, URL/id resolution, related recommendations, public user profiles, and route capabilities against Luogu content-only page responses. It is intentionally separate from unit tests because it depends on Luogu network availability and current site behavior.
Run the 100-topic algorithm coverage smoke:
The topic smoke starts the real MCP server and probes 100 algorithm categories across high-level topic search and training-set search. It fails if fewer than 98 topic searches return Luogu results.
Download one representative problem per catalog topic into a local ignored folder:
Test a MiMo agent loop that asks the model to choose MCP tools, then executes those calls through the local stdio MCP server:
smoke:mimo reads MIMO_API_KEY from the environment, or from C:\Users\qwerf\.continue\.env on this machine.
Notes
- Luogu endpoints used here are content-only web endpoints, not a formal stability contract.
- The server keeps outputs compact and structured for model context control.
- Browser automation is intentionally not the default path. A Playwright fallback can be added later for pages that cannot be read through lightweight HTTP.
- For broad topic discovery, Luogu training-set search is often cleaner than raw problem title search; raw keyword search follows Luogu's website ordering and can include title-level noise.
來源:README.md,提交 00d89a4
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具必需15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分