handigraphs-stats-api-mcp

handigraphs-stats-api-mcp

Provides read-only access to the Handigraphs Stats API v1, enabling discovery of sports resources and querying of protected sports statistics.

Category
访问服务器

README

Handigraphs Stats API MCP

Public MCP server for read-only access to the Handigraphs Stats API v1. Version 0.2.0 uses stdio only and exposes three tools:

  • list_resources({ sport? }) discovers sports and resources.
  • describe_resource({ sport, resource }) discovers metrics, canonical units, splits, and supported filters.
  • query_stats(...) validates against live discovery and queries one protected data resource. Continue pagination by passing the returned cursor back to this tool.

Sports, resources, metrics, and splits are never compiled into this package. Public discovery remains authoritative.

Credentials

Create a reveal-once Stats API key at handigraphs.com/account/api. Never paste a real key into a repository, issue, prompt, or committed client configuration.

Install with the Handigraphs plugin

Codex

  1. Install Node.js 22 or newer.
  2. Create a named Stats API key and copy it when it is revealed.
  3. Open Terminal and run these commands in order:
codex plugin marketplace add Handigraphs/handigraphs-stats-api-mcp
codex plugin add handigraphs-stats-api@handigraphs
  1. Set HANDIGRAPHS_API_KEY in the same shell or environment used to launch Codex. Keep the value out of source control and prompts.
  2. Launch or fully restart Codex. The plugin adds the local MCP server and a query-handigraphs-stats skill.

Claude Code

  1. Install Node.js 22 or newer.
  2. Create a named Stats API key and copy it when it is revealed.
  3. Open Terminal and run these commands in order:
claude plugin marketplace add Handigraphs/handigraphs-stats-api-mcp
claude plugin install handigraphs-stats-api@handigraphs
  1. Inside Claude Code, run /plugin configure handigraphs-stats-api@handigraphs, paste the key into the sensitive setting, and save it.
  2. Run /reload-plugins or start a new Claude Code session.

Claude Desktop extension

  1. Create a named Stats API key and copy it when it is revealed.
  2. Download handigraphs-stats-api-mcp-<version>.mcpb from the matching GitHub release.
  3. Double-click the downloaded file to open it in Claude Desktop. If it does not open, drag the file onto the Claude Desktop window.
  4. Review the extension, select Install, and enter the Stats API key when prompted.
  5. Start a new conversation. Select + in the message box, then Connectors, and confirm Handigraphs Stats API appears.

The bundle includes the compiled server and its production dependencies; a separate Node.js installation is not required by the extension.

These are local distributions. They do not create a hosted connector for Claude.ai, Claude Cowork, mobile clients, or ChatGPT web.

Configure another MCP client

Node.js 22 or newer is required. Add the published npm package to any client that supports local stdio MCP servers:

{
  "mcpServers": {
    "handigraphs-stats": {
      "command": "npx",
      "args": ["-y", "@handigraphs/stats-api-mcp"],
      "env": { "HANDIGRAPHS_API_KEY": "hg_live_REPLACE_ME" }
    }
  }
}

Restart the MCP client after saving its configuration. Do not commit the configuration when it contains a real key.

For sandbox testing, also set HANDIGRAPHS_API_BASE_URL to the sandbox origin's /api/v1 path and use a sandbox key.

Configuration

Environment variables:

Variable Required Default Purpose
HANDIGRAPHS_API_KEY Yes none Bearer key for protected data. It is never accepted as a tool argument.
HANDIGRAPHS_API_BASE_URL No https://handigraphs.com/api/v1 API v1 root. HTTPS is mandatory except loopback HTTP used by tests.
HANDIGRAPHS_DISCOVERY_TTL_SECONDS No 300 In-process public-discovery cache TTL.
HANDIGRAPHS_HTTP_TIMEOUT_MS No 10000 Upstream request timeout.
HANDIGRAPHS_MAX_RESPONSE_BYTES No 5242880 Maximum declared or streamed upstream JSON response size.

Query model

query_stats accepts sport, resource, and these optional fields: split, metrics, up to five numeric filters, sort, team, opponent, entity_id, day, page_size, cursor, stat_format, meta, category, duration, and location. Resource discovery determines which optional fields are supported. stat_format and meta default to compact.

Filter objects use { "metric": "k_pct", "operator": "gte", "value": 0.20 }. Operators are eq, ne, gt, gte, lt, and lte. Values must be finite and use the canonical unit returned by discovery; proportions use 0.20 for 20%.

Successful tools return the upstream JSON in structuredContent.response, a minified JSON text block, and safe request/quota headers in structuredContent.metadata. Upstream problem responses become isError tool results. The server does not automatically retry 429 or 503 responses.

Security behavior

  • stdout is reserved exclusively for MCP protocol messages; diagnostics use stderr.
  • Authorization is sent only to protected resource URLs, never public discovery.
  • Redirects, credentialed base URLs, cross-origin discovery links, and links outside /api/v1 are rejected.
  • Discovery uses a 300-second default cache with ETag revalidation and in-flight coalescing. Protected data and errors are never cached.
  • Upstream JSON bodies are bounded by declared and streamed byte size before parsing.
  • Error and diagnostic values recursively redact the configured key and authorization-like fields.

See SECURITY.md for reporting and key-handling guidance.

Development

Clone this repository and install its locked dependencies:

npm ci

Run the complete local validation suite:

npm test
npm run typecheck
npm run build
npm run pack:check
npm run distributions:check
npm run mcpb:check

Tests use local mocked HTTP servers and the official MCP client, including an end-to-end stdio process. No live Handigraphs key or external service is required.

Build a local Claude Desktop artifact in artifacts/ with:

npm run mcpb:pack

License

Licensed under the Apache License 2.0.

推荐服务器

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

官方
精选