
Luogu MCP Server
io.github.KaiserunixPublished by GitHub account Kaiserunixv0.2.1Updated Oct 24, 2026
Search Luogu problems, fetch statements, explore problem sets and get practice recommendations.
Overview
Read-only MCP server for Luogu: search competitive-programming problems, fetch statements and samples, browse training sets, and get practice recommendations.
- What you can do
- Search problems by keyword, topic, title fragment, id or tag ids, and resolve pasted URLs or ids to a problem
- Fetch a problem's statement, formats, samples, tags, difficulty and URL
- Search and fetch Luogu training/problem sets, including official and user-shared sets
- Find related practice and recommendations from a topic or a student pain point, with alias and tag expansion
- List algorithm topics and fetch public user profiles by uid, plus report which route features are available
- When to use it
- Useful when an assistant should help with Luogu practice: finding problems on a topic, pulling a statement and samples into context, assembling practice sets, or suggesting follow-up problems for a specific confusion.
- Requirements
- Either the hosted Streamable HTTP endpoint (no install) or the local npm package run through npx or node, which needs Node.js. Network access to Luogu's public web endpoints is required. No account or API key is needed for the public read-only tools.
Installation
In SourceWeft
- Open Luogu MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Use with an agent
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/io.github.Kaiserunix%2Fluogu-mcp-server/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Other MCP clients
Add this to your client's mcpServers config.
{
"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.
Source: README.md at commit 00d89a4
Tools
0Version history
1- v0.2.1LatestSep 16, 2026
Score
85% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
- Auth declaredRequired10 pts
- Tools listedRequired15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts