SAIR MCP Server

SAIR MCP Server

A local MCP server that exposes the SAIR Competition Public API as tools for MCP clients, enabling account introspection, competition browsing, submissions, playground operations, cheatsheet management, and Contributor Network interactions.

Category
访问服务器

README

sair-mcp

A local MCP (Model Context Protocol) server that exposes the SAIR Competition Public API as tools for an MCP client (Claude Code, Claude Desktop, or any other MCP-compatible client).

It covers the full documented API surface: account introspection, competitions (browsing, eligibility, leaderboards, submissions, IGP24 label progress), Playground (models, problem sets, runs, results, live event streaming, usage), your private cheatsheet and Lean solver-template libraries, custom Lean problems, and the Contributor Network (browsing, publishing, favoriting, commenting, lineage graphs, benchmarks).

Installation

Requires Python 3.10+.

git clone <this-repo>
cd SAIRmcp
pip install -e .

Getting a SAIR API key

  1. Sign in to SAIR and open Account settings -> API keys.
  2. Create a key and select the scopes you need. At minimum, for the examples below: competition.read and competition.write. Add playground.read / playground.write for Playground tools, contributor-network.read / contributor-network.write for Contributor Network tools.
  3. Copy the key immediately -- it is shown only once. Keys look like sair_a1b2c3d4_zR9....

Configuration

Set these environment variables before starting the server:

Variable Required Default Purpose
SAIR_API_KEY Yes - Your personal SAIR API key. The server refuses to start without it.
SAIR_BASE_URL No https://api.sair.foundation/api/public/v1 Override for testing against a different environment.
export SAIR_API_KEY="sair_a1b2c3d4_zR9..."

Running it standalone

python -m sair_mcp

This starts the server on stdio and blocks, waiting for an MCP client to connect. There is no output on success; it's meant to be launched by an MCP client, not run interactively.

Registering with Claude Code and other mcp clients

Add to your project's .mcp.json (or user-level MCP config)

{
  "mcpServers": {
    "sair": {
      "command": "python",
      "args": ["-m", "sair_mcp"],
      "env": {
        "SAIR_API_KEY": "sair_a1b2c3d4_zR9..."
      }
    }
  }
}

Or via the CLI, substituting the same absolute path:

claude mcp add sair -- python3 -m sair_mcp

(then set SAIR_API_KEY in your shell environment before launching Claude Code, or add it to the env block above).

Alternative: pyproject.toml also declares a sair-mcp console-script entry point, so once installed you can skip -m sair_mcp entirely and point command straight at that script's absolute path instead -- again, resolve it in the same command as the install so it can't drift to a different environment's sair-mcp:

pip install -e . && which sair-mcp

No args needed when using this form.

If you use a dedicated virtual environment for this project (recommended for isolation from other Python projects), the same rule applies: use <path-to-venv>/bin/python (or <path-to-venv>/bin/sair-mcp) as command, not a bare python.

Registering with Claude Desktop

Add the same shape to claude_desktop_config.json under mcpServers, using the same absolute-interpreter-path command as above -- Desktop's subprocess environment is even less likely than a terminal's to have your Python environment on PATH.

Usage example

A typical end-to-end flow, as an MCP client would call it:

  1. get_me -- confirm the key is valid and see its scopes.
  2. list_competitions -- find a competition ID.
  3. get_competition("modular-arithmetic-challenge") -- read submissionSpec to learn the required payload shape.
  4. get_my_participation("modular-arithmetic-challenge") -- check canSubmit before attempting anything.
  5. submit_competition_entry("modular-arithmetic-challenge", payload={"modelName": "you/your-model", "commitHash": "0123...(40 hex chars)"}).
  6. get_my_submission("modular-arithmetic-challenge") -- confirm the active submission.

Tool reference

All tools return the API's unwrapped data object as a dict (or None for 204 responses, or a plain string for the two text-returning tools). On error, the tool call fails with a SairApiError-derived message in the form [<http status> <error code>] <message>; consult SAIR's Errors documentation for the full code table.

Account (1 tool)

Tool Scope Purpose
get_me none Confirm the API key and see its owner + granted scopes.

Competitions (10 tools)

Tool Scope Purpose
list_competitions competition.read List competitions visible through the API.
get_competition competition.read Get one competition's detail and submissionSpec.
get_my_participation competition.read Check canSubmit / submitBlockedReason for one competition.
get_leaderboard competition.read List published leaderboard rows.
get_my_leaderboard_standing competition.read Get the caller's own leaderboard entry.
submit_competition_entry competition.write Create or replace the caller's submission.
get_my_submission competition.read Read the caller's current submission (or history, for IGP24).
get_submission_by_id competition.read Read one submission by ID.
download_submission_text competition.read Download the stored text body of a submission.
get_igp24_label_progress competition.read Bulk aggregate IGP24 discovery progress by label.

Playground (10 tools)

Tool Scope Purpose
list_playground_models playground.read List model IDs accepted in runs for a competition.
list_playground_problem_sets playground.read List available practice problem sets.
get_playground_problem_set playground.read Get every problem in one problem set.
submit_playground_run playground.write Create a practice run.
list_playground_runs playground.read List the caller's runs for a competition.
get_playground_run playground.read Get one run's params, summary, and timing.
cancel_playground_run playground.write Cancel a pending/running run.
list_playground_run_results playground.read List per-cell/per-problem result rows for a run.
stream_playground_run_events playground.read Collect live verdict events for a solver-participation run (blocks up to a timeout).
get_playground_usage playground.read Get the caller's practice credit/usage counters.

Cheatsheets (5 tools)

Tool Scope Purpose
list_cheatsheets playground.read List the caller's cheatsheets.
get_cheatsheet playground.read Get one cheatsheet including its content.
create_cheatsheet playground.write Create a cheatsheet.
update_cheatsheet playground.write Update a cheatsheet's title/content.
delete_cheatsheet playground.write Delete a cheatsheet.

Solver templates (5 tools)

Tool Scope Purpose
list_solver_templates playground.read List the caller's Lean solver templates.
get_solver_template playground.read Get one solver template including its source.
create_solver_template playground.write Create a solver template.
update_solver_template playground.write Update a solver template's title/source.
delete_solver_template playground.write Delete a solver template.

Custom Lean problems (4 tools)

Tool Scope Purpose
list_custom_problems playground.read List the caller's private Lean statement pairs.
get_custom_problem playground.read Get one custom problem.
create_custom_problem playground.write Create an immutable custom Lean problem.
delete_custom_problem playground.write Delete a custom problem.

Contributor Network (13 tools)

Tool Scope Purpose
list_contributor_network_items contributor-network.read Browse shared cheatsheets/solver templates/model references.
get_contributor_network_item contributor-network.read Get one item's full payload.
publish_contributor_network_item contributor-network.write Publish a saved resource, submission body, inline text, or model reference.
withdraw_contributor_network_item contributor-network.write Withdraw (unpublish) an item you authored.
favorite_contributor_network_item contributor-network.write Favorite an item.
unfavorite_contributor_network_item contributor-network.write Unfavorite an item.
list_contributor_network_comments contributor-network.read List comments on an item.
create_contributor_network_comment contributor-network.write Post a comment.
delete_contributor_network_comment contributor-network.write Delete a comment.
get_contributor_network_item_graph contributor-network.read Get the lineage subgraph rooted at one item.
get_contributor_network_global_graph contributor-network.read Get the lineage graph across all visible items.
list_contributor_network_benchmarks contributor-network.read List platform-run benchmark summaries.
get_contributor_network_item_benchmark contributor-network.read Get the per-model benchmark breakdown for one item.

Total: 48 tools.

Development

pip install -e ".[dev]"
pytest --cov=sair_mcp --cov-report=term-missing

All tests run against a mocked HTTP layer (respx) -- no test requires or uses a real SAIR_API_KEY or makes a real network call.

Design documents

  • Spec: docs/superpowers/specs/2026-07-08-sair-mcp-server-design.md
  • Plan: docs/superpowers/plans/2026-07-08-sair-mcp-server.md
  • ADR: docs/architecture/ADR_001-sair-mcp-server.md

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选