mlbb-mcp

mlbb-mcp

Enables querying Mobile Legends: Bang Bang hero data including win rates, counters, synergies, and builds via natural language.

Category
访问服务器

README

mlbb-mcp

An MCP server for Mobile Legends: Bang Bang hero data, backed by ridwaanhall/api-mobilelegends. Built as a learning project for personal use, covering MCP server design, LLM tool design, grounded generation with citations, resilient API caching, and LLM-as-judge evals.

100% written by Claude; 100% reviewed by me.


Tools

Tool What it answers
list_heroes Browse/search the hero roster; resolve ambiguous names
get_hero_winrate Win/pick/ban rate for a hero at a rank tier and time window
get_top_heroes Top N heroes by win rate, pick rate, or ban rate
get_hero_counters Heroes that reduce a hero's win rate (counters)
get_hero_synergies Heroes that increase a hero's win rate (teammates)
get_hero_trends Day-by-day win/pick/ban rate over N days
get_hero_build Recommended items, spell, and emblem by lane
get_hero_profile Role, lane, specialties, difficulty, skills, lore

Every stats-returning tool includes a citation block: source, retrieved_at, data_freshness, time_window_days, rank_tier. data_freshness is "fresh" or "stale" — the server serves cached data when upstream is unavailable rather than failing.


Setup

git clone <repo>
cd mlbb-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Copy .env.example to .env and fill in your keys (only needed for evals, not for the MCP server or CLI):

cp .env.example .env
# ANTHROPIC_API_KEY — required for both eval scripts
# OPENAI_API_KEY    — required for evals/comprehensive_evals.py (GPT judge) only

Run

CLI (no MCP server needed, useful for testing):

python cli.py heroes                  # list all heroes
python cli.py resolve lancelot        # resolve a name or ID
python cli.py resolve 47              # by numeric ID

MCP server (for Claude Desktop):

python server.py

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mlbb": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}

Then restart Claude Desktop.


Tests

Unit and integration tests (no network, no API key):

pytest tests/ -v

The stale-cache tests cover every failure mode — network error, timeout, HTTP 5xx, non-JSON 200 (CDN error page), error envelopes, 4xx behaviour, cache poison guard, and recovery.


Evals

LLM behavior evals — separate from unit tests. They make real API calls and cost money, so run them intentionally rather than in CI. Both require ANTHROPIC_API_KEY (and OPENAI_API_KEY for the comprehensive suite) in .env.

evals/run_evals.py — focused behavioural checks

Two targeted evals that pre-inject tool results and grade the final response:

python evals/run_evals.py              # both
python evals/run_evals.py citation     # citation correctness only
python evals/run_evals.py fabrication  # fabrication refusal only
  • citation_correctness — injects a real live tool result; checks Claude's response includes rank tier, time window, percentage, and source.
  • fabrication_refusal — injects a ToolError; checks Claude refuses to invent stats rather than making something up.

evals/comprehensive_evals.py — full tool-selection + quality suite

33 questions across all 8 tools. Claude actually calls tools with real parameters; GPT grades each trace on tool selection, citation quality, and fabrication.

python evals/comprehensive_evals.py              # all 33, Haiku answerer (~$0.10, ~2 min)
python evals/comprehensive_evals.py --sonnet     # all 33, Sonnet answerer (~$1–2, ~5 min)
python evals/comprehensive_evals.py 5            # first 5 only (smoke test)
python evals/comprehensive_evals.py 5 build      # first 5, filter by category

Use Haiku by default during development; switch to --sonnet when you want to measure Sonnet's behaviour specifically. The judge is always gpt-4o-mini — the grading task is mechanical enough that a frontier judge model isn't needed.


Attribution

Game data © Moonton. API by ridwaanhall, hosted at mlbb.rone.dev.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选