meta-horizon-developer-mcp

meta-horizon-developer-mcp

Read-only MCP server that collects Analytics data from the Meta Horizon developer dashboard by intercepting GraphQL queries. It provides tools for status checks, snapshot collection, and reading allowed query results.

Category
访问服务器

README

meta-horizon-developer-mcp

A read-only stdio MCP server for collecting Analytics from the Meta Horizon developer dashboard (developers.meta.com/horizon).

For package structure and trust boundaries, see ARCHITECTURE.md. For development and change rules, see AGENTS.md.

The bundled meta-horizon-developer CLI is for the collection owner only (manual authentication and scheduled collection).

The collector opens the Analytics page in an authenticated browser, observes only successful persisted GraphQL Query responses issued by the Dashboard itself, removes secrets, and stores immutable JSON. It never constructs and replays requests, performs mutations, or fetches arbitrary URLs.

Usage

# 1. Log in manually (cookies remain in the dedicated Chromium profile).
meta-horizon-developer --app-id <APP_ID> --profile-dir .state/meta-horizon-developer/profile auth

# 2. Collect data (cron-friendly; writes one immutable JSON file).
meta-horizon-developer --app-id <APP_ID> --snapshot-dir data/raw/meta-store collect

# 3. Check status.
meta-horizon-developer --app-id <APP_ID> --snapshot-dir data/raw/meta-store status

CLI arguments can also be supplied through environment variables.

Environment variable Corresponding argument Needed for
META_HORIZON_APP_ID --app-id everything
META_HORIZON_OUTPUT_DIR --snapshot-dir everything
META_HORIZON_PROFILE_DIR --profile-dir auth / collect / capture-csv
META_HORIZON_CSV_DIR --csv-dir capture-csv (defaults next to the profile)
META_HORIZON_LOOKBACK_DAYS --lookback-days (default: 120) collect
PLAYWRIGHT_CHROMIUM_EXECUTABLE Chromium executable browser operations

Reading a snapshot never needs a profile: status and read resolve without one.

MCP

Start it as a stdio MCP server. It takes no startup arguments. The target application and storage location are tool arguments, so one process serves every application and the host that launches it needs no knowledge of its callers.

{
  "mcpServers": {
    "meta-horizon-developer": {
      "command": "/path/to/bin/meta-horizon-developer-mcp"
    }
  }
}

Splitting the server per application would isolate nothing: every instance opens the same Chromium profile and the same cookies, so the only thing separated is app_id, which is not a secret.

Only four tools are exposed:

Tool Arguments Returns
meta_horizon_developer_status app_id, snapshot_dir latest snapshot health
meta_horizon_developer_collect app_id, snapshot_dir, profile_dir, lookback_days? runs a collection
meta_horizon_developer_latest_snapshot app_id, snapshot_dir snapshot metadata (not its payload)
meta_horizon_developer_read_operation operation_name, app_id, snapshot_dir one allowed Query

Authentication, arbitrary URLs, arbitrary operations, mutations, and Cookie/token values are never exposed. Authentication is available only through the CLI because it requires human interaction.

Invariants

  • One process per profile. auth / collect / capture-csv take an exclusive lock and fail immediately with ProfileBusyError if it cannot be acquired.
  • One application per directory. Never write snapshots for a different app_id into a directory that already contains snapshots (AppIdMismatchError).
  • Always pass --password-store=basic. Without a keyring, Chromium may select another key and appear unauthenticated because it cannot decrypt any saved cookies.
  • Separate proxy credentials. Chromium does not use credentials embedded in a proxy URL for CONNECT; passing them that way results in 407 and ERR_TUNNEL_CONNECTION_FAILED.
  • The aggregation period comes from URL start / end. Presets allow at most 28 days, so a custom period (default: 120 days) is passed to the Dashboard to produce a longer daily series.
  • Fail when collection captures zero operations. Do not leave an empty snapshot. Partial gaps are recorded in missing_operations / missing_required_operations.

Snapshot format

{
  "schema_version": 1,
  "collected_at": "2026-08-06T01:23:45Z",
  "source": "meta-horizon-dashboard",
  "app_id": "…",
  "operations": [{"name": "…Query", "doc_id": "…", "data": {…}, "errors": null}],
  "missing_operations": ["…"],
  "missing_required_operations": ["…"]
}

Files are named meta-store-<UTC>.json, mode 0600, and are never overwritten.

dashboard.json is the contract for the Dashboard pages and allowed operations; it does not identify an application. The page layout is shared across applications, so this allowlist is shared as well.

Secrets

  • Cookies remain only in the dedicated profile; they are not written to configuration or snapshots.
  • Responses are redacted before storage (authorization / cookie / token / session / email / user_id / dtsg and similar fields).
  • Profiles and snapshots must never be committed to Git.

Development

uv run --project . pytest -q
uv run --project . ruff check src tests

The package requires Python 3.13 or newer. Runtime state is intentionally excluded from Git.

推荐服务器

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

官方
精选