mcp-server-moegirl-wiki
English | 简体中文
MCP server for 萌娘百科 (Moegirl Wiki). Two tools: search entries and fetch a page's intro.
Requires the MCP Python SDK 2.x (mcp>=2,<3); see Compatibility if you are still on 0.2.x.
Install
uvx mcp-server-moegirl-wiki # recommended
pipx run mcp-server-moegirl-wiki
pip install mcp-server-moegirl-wiki
Tools
search_moegirl(keyword: str, limit: int = 5)
Returns {"results": [{"title", "url", "snippet"}, ...], "count": int}.
get_page(title: str, max_length: int = 6250)
Returns {"title", "content", "url", "page_id"} — full plain-text rendering of the page (all sections, templates expanded, links resolved). Auto-follows redirects. content is truncated to max_length characters; default 6250 covers a typical character page in full, pass larger (e.g. 20000) for very long pages.
Environment variables
| Variable | Default | Description |
|---|---|---|
MOEGIRL_MAX_LENGTH |
6250 |
Default max_length for get_page when the caller does not specify one. Useful for tuning per-deployment without forking the package. Invalid/non-positive values are ignored with a warning. |
Configuration
Claude Desktop
{
"mcpServers": {
"moegirl-wiki": {
"command": "uvx",
"args": ["mcp-server-moegirl-wiki"]
}
}
}
MaiBot (config/bot_config.toml)
MaiBot's default config already has the [mcp] block — just replace the servers line:
servers = [{name = "moegirl", enabled = true, transport = "stdio", command = "uvx", args = ["mcp-server-moegirl-wiki"], env = {MOEGIRL_MAX_LENGTH = "6250"}, url = "", headers = {}, http_timeout_seconds = 30.0, read_timeout_seconds = 300.0, authorization = {mode = "none", bearer_token = ""}}]
Tweak MOEGIRL_MAX_LENGTH to taste (raise to 20000 for very long pages, lower to 1500 for quick lookups). If uvx is not on PATH, swap command/args for command = "pipx", args = ["run", "mcp-server-moegirl-wiki"].
Development
git clone https://github.com/XXXxx7258/mcp-server-moegirl-wiki
cd mcp-server-moegirl-wiki
uv sync --group dev
uv run pytest -m network
uv run ruff check .
Compatibility
| Server version | MCP Python SDK | Notes |
|---|---|---|
0.3.x |
mcp>=2,<3 |
SDK 2.0 renamed FastMCP to mcp.server.mcpserver.MCPServer, so 0.2.x could not run on it. Hosts whose client still uses SDK 1.x work fine — the stdio handshake negotiates a shared protocol version (verified: 1.29.1 client ↔ 2.3.0 server). |
0.2.x |
mcp>=1.0 |
Crashes at startup on SDK 2.x (No module named 'mcp.server.fastmcp'). That is what 0.3.0 fixes; pin mcp<2 only if you must stay on 0.2.x. |
Limitations
get_pagereturns rendered plain text (templates expanded, links resolved). Raw wikitext (prop=revisions,action=parse,?action=raw,Special:Export) is blocked by Moegirl Wiki's site-wide ACL — empirically verified that bot-password login does not unlock it; onlysysop/staff groups can call these actions.- Uses the
mzh.moegirl.org.cnmirror. - Proxy variables are honoured via
httpx'strust_env. SomeNO_PROXYvalues are valid for curl but unparseable forhttpx(e.g. a bare::1next to[::1]); in that case the server logs a warning and issues direct requests instead of failing every tool call.
License
Metadata
Release files for mcp-server-moegirl-wiki 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_server_moegirl_wiki-0.3.0.tar.gz | 13.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_server_moegirl_wiki-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / mcp_server_moegirl_wiki-0.3.0.tar.gz
| Download URL | mcp_server_moegirl_wiki-0.3.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24cee24fca972057b915a57df24267295cf3186bf9d3281ca6522b13eb6d9c6b
|
|
BLAKE2b-256 checksum How to use checksums |
f629ef7af032ce4219207ae51cf585c89b8e533fd27f03d9412aae429cc2e305
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Release files / mcp_server_moegirl_wiki-0.3.0-py3-none-any.whl
| Download URL | mcp_server_moegirl_wiki-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdb8d09486706f2e215e9dac716272c8d81b7a15ff393d1c794054e5c9fb7c1f
|
|
BLAKE2b-256 checksum How to use checksums |
2e167fb0591ef050cb38489c90341a31de90f16770b6b42c3f430ebf9e4e9053
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Security for mcp-server-moegirl-wiki 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.