Skip to main content
Glama
wzkzd666

wuwa-mcp

by wzkzd666

鸣潮 MCP Server

一个 Model Context Protocol (MCP) 服务器,用于获取《鸣潮》游戏的角色与声骸信息,并以 Markdown 格式返回,便于大型语言模型直接消费。

📄 English Documentation | 🇨🇳 中文文档

本仓库是 jacksmith3888/wuwa-mcp-server 的二次修改版, 上游停留在 v2.0.1(MIT 许可),当前版本 v2.2.0,由 颗粒 维护。 改动要点:适配 mcp 2.x、修复攻略子页抓取失败、输出去重、移除长度截断。 完整清单见文末「版本改动」。

功能特点

  • 角色信息查询:获取角色详情,含技能、养成攻略

  • 声骸信息查询:获取声骸套装的详细信息

  • 角色档案查询:获取角色档案信息

  • LLM 友好输出:结果格式为大型语言模型优化,内容去重且不截断

  • 双传输模式:支持 STDIO 与 Streamable HTTP

Related MCP server: WuWa MCP Server

环境要求

  • Python ≥ 3.12

  • uv(包管理与运行)

安装

从 PyPI 安装(推荐)

# 装进你的项目
uv add wuwa-mcp

# 或者不安装,直接运行
uvx wuwa-mcp

从 GitHub 安装

uv add "git+https://github.com/wzkzd666/wuwa-mcp-server"

# 锁定到某个版本
uv add "git+https://github.com/wzkzd666/wuwa-mcp-server@v2.2.0"

从本地源码安装(开发用)

# 以路径依赖装进你的项目
uv add /path/to/wuwa-mcp-server

# 安装到本仓库自身环境
cd /path/to/wuwa-mcp-server
uv sync

# 或先构建再安装产物
uv build
uv pip install dist/*.whl

⚠️ 不要安装 wuwa-mcp-server —— PyPI 上那个是上游 v2.0.1,不含 mcp 2.x 适配与去重 / 缓存修复,在 mcp 2.x 环境下启动即崩。 本项目发布的包名是 wuwa-mcp,import 名与包名一致为 wuwa_mcpimport wuwa_mcp)。 唯一的控制台命令也是 wuwa-mcp

命名对照

用途

名称

PyPI 分发包名

wuwa-mcp

import 名

wuwa_mcp

控制台命令

wuwa-mcp(唯一)

MCP 服务器名

wuwa-mcp

使用方法

任何支持 MCP 的客户端(Claude Desktop、Cherry Studio、Cline 等)都可用同一份配置接入。

从 PyPI 安装后,最简配置:

{
  "mcpServers": {
    "wuwa-mcp": {
      "command": "uvx",
      "args": ["wuwa-mcp"]
    }
  }
}

从本地源码或路径运行时:

{
  "mcpServers": {
    "wuwa-mcp": {
      "command": "uv",
      "args": ["--directory", "/path/to/wuwa-mcp-server", "run", "wuwa-mcp"]
    }
  }
}

与 Claude Desktop 一起运行

  1. 下载 Claude Desktop

  2. 创建或编辑配置文件:

    • macOS:~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows:%APPDATA%\Claude\claude_desktop_config.json

  3. 填入上面的 mcpServers 配置,然后重启客户端

与 Cherry Studio 一起运行

  1. 下载 Cherry Studio

  2. 设置 → MCP 服务器 → 添加,填入上面的 mcpServers 配置

可用工具

1. 角色信息工具

async def get_character_info(character_name: str) -> str

在库街区上查询角色详细信息(含技能、养成攻略)并以 Markdown 格式返回。

参数:

  • character_name: 要查询的角色的中文名称

返回: 包含角色信息的 Markdown 字符串(完整原文,仅去重、不截断),或者在找不到角色或获取数据失败时返回错误消息。

2. 声骸信息工具

async def get_artifact_info(artifact_name: str) -> str

在库街区上查询声骸详细信息并以 Markdown 格式返回。

参数:

  • artifact_name: 要查询的声骸套装的中文名称

返回: 包含声骸信息的 Markdown 字符串,或者在找不到声骸或获取数据失败时返回错误消息。

3. 角色档案工具

async def get_character_profile(character_name: str) -> str

在库街区上查询角色档案信息并以 Markdown 格式返回。

参数:

  • character_name: 要查询的角色的中文名称

返回: 包含角色档案信息的 Markdown 字符串,或者在找不到角色或获取数据失败时返回错误消息。

开发和测试

本地运行

# STDIO 模式(默认)
uv run python -m wuwa_mcp.server

# HTTP 模式
TRANSPORT=http uv run python -m wuwa_mcp.server

代码质量

项目使用 ruff 进行代码格式化和静态分析。

# 安装开发依赖
uv sync --extra dev

# 格式化所有 Python 代码
uv run ruff format .

# 检查代码问题
uv run ruff check .

# 自动修复可修复的问题
uv run ruff check --fix .

Ruff 配置:行长度 120 字符,目标 Python 3.12,启用 pycodestyle / pyflakes / isort / 命名约定 / pyupgrade / bugbear / 代码简化等规则,强制单行导入。

Docker 部署

# 构建镜像
docker build -t wuwa-mcp .

# 运行容器(HTTP 模式,监听 8081)
docker run -p 8081:8081 wuwa-mcp

# 运行容器(STDIO 模式)
docker run -e TRANSPORT=stdio wuwa-mcp

详细功能

结果处理

  • 清理并格式化库街区数据

  • 为 LLM 消费优化格式

  • 支持并行处理提高性能

  • 异步操作避免阻塞

传输模式

  • STDIO 传输:适用于本地客户端,如 Claude Desktop

  • Streamable HTTP 传输:适用于云端部署和远程访问

  • 通过环境变量 TRANSPORT 自动切换模式

贡献

本 fork 由 颗粒 维护(原作者 jacksmith3888)。改动以「能跑通 + 数据完整」为目标,未做大规模重构。

欢迎提出问题和拉取请求。一些可改进的方向:

  • 增加对更多《鸣潮》游戏内容的支持

  • 增强内容解析选项

  • 增加对频繁访问内容的缓存层

  • 支持更多语言的本地化

许可证

本项目采用 MIT 许可证,原始版权归 jacksmith3888 所有。

本地修改部分(v2.2.0,维护者:颗粒)同样遵循 MIT 许可证。

版本改动(维护者:颗粒)

v2.2.0

  • 🔤 统一命名:import 包目录 wuwa_mcp_serverwuwa_mcp,与分发包名 wuwa-mcp 完全一致(PEP 503 归一化),不再需要 [tool.uv.build-backend] module-name 特殊声明。控制台命令也只保留 wuwa-mcp 一个,移除 wuwa-mcp-server 别名。这是一处破坏性变更:原 import wuwa_mcp_server 需改为 import wuwa_mcp,原 wuwa-mcp-server 命令需改为 wuwa-mcp

  • 🐛 修复循环导入core/__init__.py 顶层 from .container import ...services 反向依赖 core 构成环,导致「先 import services.character_service」直接 ImportError(必须先 import core 才能用)。改为 PEP 562 模块级 __getattr__ 惰性导出 DIContainer / get_container / reset_container,对外 API 不变

  • 🧹 删除死代码 542 行:经 AST 可达性分析 + 全项目引用计数双重确认,移除 26 个零引用符号——13 个重复的工厂函数(create_*container 已直接构造)、3 个 legacy 兼容壳(LegacyMarkdownConverterContentParserCharacterDevelopmentStrategy)、6 个未被引用的 protocol / ABC、2 个未用异常类、2 个未用 value object(含级联孤立的 ModuleData

  • 🧹 裁剪冗余再导出builders / domain / infrastructure / infrastructure.api / parsers / services 六个 __init__.py 的急切再导出无人消费,精简为仅保留 docstring,降低耦合与导入开销

  • 🩹 修复版本漂移__init__.py__version__ 原硬编码 2.0.1(与 pyproject.toml 不符),改为从 importlib.metadata 读取,杜绝再次漂移

  • 🩹 修复潜在 F821artifact_service / character_service"MarkdownService" 前向引用从未导入,补 TYPE_CHECKING 导入

  • 质量:全项目 ruff check --select F 通过;34 个模块独立进程导入测试 0 个 ImportError

v2.1.0(本仓库 fork)

相对上游 v2.0.1 的改动:

  • 🔌 适配 mcp 2.xFastMCPMCPServer,修复原版在 mcp 2.x 下启动即崩的 ImportError

  • 🩹 修复攻略子页抓取偶发失败:根因是 HTTP client not initialized(原 _fetch_strategy_content 裸用 api_client 未进 async context)

  • 新增 API 响应 TTL 缓存(600s),减少库街区实时请求

  • ♻️ 输出去重:修复「整页渲染两遍」,并移除长度截断,改为始终返回完整原文

  • 📊 表格与标题质量修复:行名缺失、首列空白、blob URL 泄漏、重复表 / 残缺表清理、空标题、数字型 tab 补 Lv. 前缀、全角 % 归一

  • 🧹 清理:移除 Smithery 硬依赖,get_character_info 不再有 full 参数

文件

改动

server.py

mcp.server.fastmcp.FastMCPmcp.server.mcpserver.MCPServer;移除手搓 Starlette/SSE 分支,改用 mcp 2.x 原生 streamable_http_app();移除 @smithery.server() 分支并补 import sysget_character_info 不再有 full 参数(始终返回完整内容)

character_repository.py

新增托管方法 get_entry_detail(entry_id)(内部 async with self.api_client),供攻略子页复用

character_service.py

_fetch_strategy_content 改调 get_entry_detail()(修复 ConnectionException);末尾固定 postprocess_markdown(..., max_chars=0) —— 只去重、不截断

kuro_api_client.py

新增 _TTLCache(ttl=600s),缓存 list:char / list:artifact / detail:{entry_id}

markdown_service.py

新增模块级 postprocess_markdown():先按空行分块去重相邻重复块(修「整页渲染两遍」),再按需截断(max_chars<=0 表示不截断)

parsers/html_converter.py

表格行名修复、首列空白修复、blob URL 泄漏修复、重复表与残缺表清理

parsers/content_parser.py

空标题清理、数字型 tab 标题补 Lv. 前缀、全角 % 归一为半角 %

pyproject.toml

mcp[cli]>=1.8.0mcp>=2.0.0;移除 smithery 依赖与 [tool.smithery] 段;版本升 2.1.0

v2.0.1(上游 jacksmith3888)

  • 🏗️ 架构重构:采用领域驱动设计(DDD)架构,清晰的分层结构

  • 🔧 代码质量:集成 ruff 代码格式化和静态分析工具

  • 📝 现代化语法:使用 Python 3.12+ 现代类型注解(dict/list 替代 Dict/List)

  • 🧹 代码清理:移除旧有代码,统一代码风格和质量标准

  • 支持 Streamable HTTP 传输

  • 🔄 向后兼容:同时支持传统的 STDIO 和新的 HTTP 传输模式

  • 🌐 云端部署就绪:适配 VPS、Google Cloud Run、AWS Lambda 等云环境

  • 📦 依赖注入:使用依赖注入容器管理服务实例

  • 🐳 Docker 优化:使用 uv 的多阶段构建,提升构建速度并减小镜像体积

Available Tools

3 tools
get_artifact_infoA

获取库街区上的声骸详细信息并以 Markdown 格式返回。

    Args:
        artifact_name: 要查询的声骸套装的中文名称。

    Returns:
        包含声骸信息的 Markdown 字符串,
        或者在找不到声骸或获取数据失败时返回错误消息。
    
ParametersJSON Schema
NameRequiredDescriptionDefault
artifact_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns Markdown-formatted data or error messages on failure, which is useful behavioral context. However, it doesn't mention other traits like rate limits, authentication needs, data freshness, or whether it's a read-only operation (though implied by 'get'). For a tool with no annotations, this is adequate but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose and output format. The Args and Returns sections are structured clearly without unnecessary details. Every sentence earns its place by providing essential information, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is mostly complete. It covers the purpose, parameter semantics, and output behavior. However, it lacks usage guidelines and deeper behavioral context (e.g., error conditions beyond 'not found' or 'failure'), which slightly reduces completeness for a tool with no annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It adds meaning by specifying that 'artifact_name' is the Chinese name of the artifact set to query, which clarifies the parameter's purpose beyond the schema's generic 'Artifact Name' title. Since there's only one parameter, this is sufficient to earn a high score, though it doesn't detail format constraints or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取库街区上的声骸详细信息' (get detailed information about artifacts from the library district). It specifies the verb (获取/get) and resource (声骸详细信息/artifact details), and mentions the output format (Markdown). However, it doesn't explicitly differentiate from sibling tools like get_character_info, which likely retrieves character information instead of artifacts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools (get_character_info, get_character_profile) or clarify scenarios where this tool is appropriate versus others. The only implied usage is when artifact details are needed, but no explicit context or exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_character_infoA

获取库街区上的角色详细信息包括角色技能,养成攻略等,并以 Markdown 格式返回。

    Args:
        character_name: 要查询的角色的中文名称。

    Returns:
        包含角色信息的 Markdown 字符串(完整内容,只做去重、不截断),
        或者在找不到角色或获取数据失败时返回错误消息。
    
ParametersJSON Schema
NameRequiredDescriptionDefault
character_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No safety annotations are present, but the description goes beyond the tool name by specifying Markdown output, deduplication, no truncation, and error behavior – meaningful extra transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Compact, front-loaded purpose, and return behavior in two sentences. No filler or duplication of schema information beyond the useful Chinese-name constraint.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers input semantics, output format, dedup/no-truncation, and error result. Missing only an explicit call-to-action vs sibling get_character_profile.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only says 'character_name'; the description clarifies it must be the Chinese name, which is useful beyond the schema. It doesn't mention exact matching or alternatives, so not a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('获取'), a precise resource (库街区 character info), and concrete content (skills, cultivation guides). It is clear enough to know what the tool returns, though it never explicitly contrasts itself with get_character_profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies use when detailed character info is needed, but there is no explicit when-to-use/when-not-to-use guidance or mention of alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_character_profileB

获取库街区上的角色档案信息并以 Markdown 格式返回。

    Args:
        character_name: 要查询的角色的中文名称。

    Returns:
        包含角色档案信息的 Markdown 字符串,
        或者在找不到角色或获取数据失败时返回错误消息。
    
ParametersJSON Schema
NameRequiredDescriptionDefault
character_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool fetches and returns data in Markdown format, and mentions error handling for missing characters or failures. However, it lacks details on authentication needs, rate limits, data sources, or whether it's read-only (implied but not explicit). For a tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose. The Args and Returns sections are structured but could be more integrated. There's minimal waste, though the formatting with indentation is slightly verbose. Overall, it's efficient for its content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which handles return values), the description is moderately complete. It covers the basic purpose and parameter semantics but lacks usage guidelines and behavioral details like error types or data freshness. With no annotations, it should do more to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% coverage. It specifies that 'character_name' is '要查询的角色的中文名称' (the Chinese name of the character to query), clarifying language and context. With only one parameter and no schema descriptions, this compensation is effective, though not exhaustive (e.g., no format examples).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取库街区上的角色档案信息并以 Markdown 格式返回' (Get character profile information from the library district and return it in Markdown format). This specifies the verb (get), resource (character profile), and output format (Markdown). However, it doesn't explicitly differentiate from sibling tools like 'get_character_info', which likely serves a similar purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions the parameter 'character_name' and what happens on success/failure, but offers no context about prerequisites, when to choose this over 'get_character_info', or any usage constraints. This leaves the agent without direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv2.1.0
    • First observedget_artifact_info
    • First observedget_character_info
    • First observedget_character_profile

TDQS

A3.5/5.0

Scored across 3 tools

Disambiguation4/5

get_artifact_info is clearly distinct from the character tools. However, get_character_info and get_character_profile could be confused since both take a character name and return Markdown, though their descriptions hint at different content types.

Naming Consistency5/5

All tools follow a consistent get_<resource>_<subtype> pattern with snake_case. No mixed conventions or vague verbs.

Tool Count4/5

Three tools is at the lower end but appropriate for a narrow read-only encyclopedia server. Each tool serves a distinct query purpose.

Completeness3/5

The set covers character and artifact information, but lacks search/list tools and other common Wuthering Waves content like weapons. Agents may fail when queries fall outside these three data types.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search and access Arknights game data including operator information, enemy intelligence, skills, talents, and attributes through PRTS.wiki integration. Provides fuzzy search functionality for operators and enemies with clean Markdown output.
    9
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Arknights PRTS Wiki MCP Server — queries the PRTS Wiki API for full-text search and article extraction, and serves auto-synced operator archives, voice lines, and story/event scripts from game data. Designed for fan-creation AI agents that need accurate lore, character profiles, and in-character dialogue references.
    9
    8
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    Enables querying the Purupuru universe codex programmatically, including characters, locations, Jani variants, and Wuxing elements, with anti-hallucination validation and fuzzy search.
    -