agent-context-api MCPサーバー
コミット 2026年8月24日トークン数のカウント、モデルに応じた予算管理、認証情報のマスキングなど、コーディングエージェント向けの決定論的なコンテキスト・プリフライト機能を提供します。
別名 dacode-dev/agent-context-api
- スター
- 0
- ツール
- —
- ダウンロード数(30日間)
- —
- 最新バージョン
- 0.7.4
- 最終コミット
- 2026年8月24日
- ライセンス
- MIT
agent-context-api MCPとは
agent-context-apiはMCPサーバーです。 トークン数のカウント、モデルに応じた予算管理、認証情報のマスキングなど、コーディングエージェント向けの決定論的なコンテキスト・プリフライト機能を提供します。.
プロジェクトのREADMEから生成された概要
agent-context-api MCP server について
このサービスは、大規模言語モデルに送信する前にリポジトリのテキストを準備する必要があるコーディングエージェント向けに、決定論的なコンテキスト・プリフライト機能を提供します。GPTファミリーのトークン数カウント、モデルに応じた予算の適用、潜在的な認証情報のマスキングといった特定のタスクを実行します。開発者は、Clineなどのクライアント向けにローカルのstdio MCP serverとして実行するか、ホストされたstreamable HTTPエンドポイントを利用できます。12,000文字までの入力については無料のローカルティアが存在しますが、それ以上のリクエストにはx402プロトコルを介した有効なBase USDCによる支払いが必要です。
コンテキスト管理に加えて、このAPIは専用のエンドポイントを通じて管理されたデータ実験機能を提供します。これには、エージェントの案件リストを正規化するbounty-radar、カタログの稼働状況を確認するpayanagent-health、ETHおよびBaseネットワークのシグナルを集約するbase-market-pulseが含まれます。このサービスは、独自のポーリング、モニタリング、スキーマドリフトの問題を管理する代わりに、メンテナンスされ、タイムスタンプが付与され、正規化されたデータに対して対価を支払うことを好む開発者向けに設計されています。送信されたテキストが第三者に送られないよう、すべてのコンテキスト処理はローカルで行われます。
できること
- 1LLM向けのリポジトリコンテキストの準備エージェントはプリフライトツールを使用して、コードをモデルに送信する前にトークン数をカウントし、認証情報をマスキングできます。
- 2エージェントの案件機会のモニタリング開発者は、正規化された稼働中のエージェント案件リストをリクエストして、資金提供されている機会を特定できます。
- 3PayanAgentカタログのステータス確認AIクライアントは、ランク付けされたPayanAgentカタログの稼働状況とレイテンシを確認できます。
- 4Baseネットワークシグナルの集約ユーザーは、Coinbase、DEX Screener、およびBase JSON-RPCメソッドからの結合データを取得できます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
agent-context-api MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude Codeにagent-context-api MCPをインストール
$ claude mcp add --transport http agent-context-api https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcpCursorにagent-context-api MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"agent-context-api": {
"url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
}
}
}VS Codeにagent-context-api MCPをインストール
.vscode/mcp.json
{
"servers": {
"agent-context-api": {
"type": "http",
"url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
}
}
}VS Code CLIにagent-context-api MCPをインストール
$ code --add-mcp '{"name":"agent-context-api","type":"http","url":"https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"}'Codexにagent-context-api MCPをインストール
$ codex mcp add agent-context-api --url https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcpCodex config.tomlにagent-context-api MCPをインストール
~/.codex/config.toml
[mcp_servers.agent-context-api] url = "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
Gemini CLIにagent-context-api MCPをインストール
$ gemini mcp add -s user --transport http agent-context-api https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcpGemini settings.jsonにagent-context-api MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"agent-context-api": {
"url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp",
"type": "http"
}
}
}設定
X402_FACILITATOR
| 名前 | 説明 | 種類 |
|---|---|---|
| X402_FACILITATOR | — |
自動チェック
実行日 2026年11月15日完全なレポート →まだ検証されていません。サーバーには80点のスコア、重大な問題がないこと、および検証に必要な十分なデータが必要です。 チェックの仕組み · 点数を上げるための改善点
- ソースリポジトリがリンクされており、アクセス可能dacode-dev/agent-context-api is public and reachablegithub.com/dacode-dev/agent-context-api ↗合格
- パッケージがこのリポジトリをソースとして指定未チェック
- ビルドの来歴 (Sigstore 証明)未チェック
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-08-24github.com/dacode-dev/agent-context-api ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していない未チェック
- パッケージおよびその依存関係に重大な勧告なし未チェック
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答Endpoint did not answer initialize: HTTP 404検出事項
README
GitHubで見るAgent Context API
A small paid API for coding agents that need a deterministic context preflight before sending repository text to an LLM. It counts GPT-family tokens, applies an optional model-aware budget, and redacts likely credentials.
It also exposes managed data experiments. bounty-radar normalizes live agent-work listings and preserves the difference between a canonical escrow signal and an ordinary venue listing. payanagent-health produces a fresh liveness snapshot of the ranked PayanAgent catalog. base-market-pulse combines fresh public ETH, DEX, and Base-network signals. The source code is public, but the paid value is operated aggregation, source health, bounded probing, and timestamped results that a buyer does not have to run.
agent-work-brief is the decision-oriented bundle: it combines canonical escrowed work with catalog liveness, excludes ordinary unfunded listings, and classifies opportunities that require capital before an agent spends time evaluating them.
Why pay when the source is public?
Self-hosting is deliberately allowed. The paid convenience is the maintained run: polling changing upstreams, normalizing responses, detecting partial outages, enforcing bounded work, and serving a timestamped result from a ready endpoint. A buyer can fork the code, but then owns deployment, monitoring, rate-limit handling, schema drift, and repairs. There is no claim of exclusivity; the service must earn trust through freshness and reliable operation.
Local development
npm install
npm test
X402_FACILITATOR=https://facilitator.openx402.ai npm start
The service listens on http://localhost:8787 by default. GET /health is free. POST /v1/context-preflight returns an x402 402 Payment Required response until the caller supplies a valid Base USDC payment.
For production Base mainnet operation, use a facilitator that advertises x402Version: 2, scheme: exact, and network: eip155:8453 at its /supported endpoint; the maintained deployment uses https://facilitator.openx402.ai. The public https://x402.org/facilitator endpoint is suitable for Base Sepolia testing, not this mainnet payout configuration. Always verify current facilitator support before changing deployments.
API example
curl -X POST http://localhost:8787/v1/context-preflight \
-H 'content-type: application/json' \
-d '{"text":"const token = \"sk-example\";","model":"claude-sonnet","token_budget":1000}'
The default price is $0.005 per request. Set PAY_TO to change the public payout address, X402_FACILITATOR to select a compatible facilitator, and PUBLIC_HOSTS to provide a comma-separated allowlist of Worker/custom hostnames used in x402 resource URLs. Do not put private keys or facilitator credentials in this repository; the service does not need a signing key to receive payments.
Managed bounty radar
POST /v1/bounty-radar costs $0.01 through x402. Send filters such as:
{"include_unverified":false,"min_reward_usd":0,"limit":20}
The response includes source health, deadlines, claim bonds, external-spend requirements, and a payment_evidence field. Only listings explicitly marked canonical and escrowed are labeled funded; other listings remain visible only when requested and are labeled unverified.
PayanAgent catalog health
POST /v1/payanagent-health costs $0.01 through x402. It accepts an optional limit from 1 to 25 and checks the ranked public catalog using only read-only HEAD requests (falling back to OPTIONS when required). HTTP 402 means that a live payment gate responded; the service never sends payment headers or calls paid routes. The response contains per-offer status, HTTP code, latency, summary counts, and generated_at.
Base market pulse
POST /v1/base-market-pulse costs $0.01 through x402 and accepts {}. The equivalent GET route exists for agent directories and simple HTTP clients. It reads Coinbase's public ETH/USD spot endpoint, DEX Screener's public Base WETH/USDC pair feed, and public Base JSON-RPC methods for the current block and gas price. It returns per-source health, timestamped values, and partial results when one source is unavailable. It is informational data only and does not trade or submit transactions.
POST /v1/agent-work-brief costs $0.03 and accepts optional min_reward_usd, limit, and health_limit filters. It is intended for agents deciding whether current work is worth pursuing; it makes no claims, payments, or downstream paid calls.
GET /.well-known/x402 (also available as /.well-known/x402.json) publishes the machine-readable service manifest, routes, prices, network, asset, and payout address. The manifest is generated from the request host so it remains correct when the zero-cost development tunnel rotates.
When the optional agent-tools hub gateway is enabled, it forwards settled requests to /hub/v1/base-market-pulse with a hub-issued X-Hub-Secret. That upstream path returns 404 without the secret and is separate from the direct x402 routes.
MCP integration
The repository also includes a local stdio MCP server for Cline and other MCP clients:
npm run start:mcp
The preflight_context tool provides a free local tier up to 12,000 characters. Larger inputs return the paid HTTP endpoint and its x402 price. Set PAID_ENDPOINT to the currently deployed endpoint when launching the MCP server. See llms-install.md for a copy-paste client configuration.
The same server is available as a hosted, stateless Streamable HTTP MCP endpoint at https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp and is described by server.json. It is published in the official MCP Registry for client and downstream-directory discovery. This hosted route is intended for clients that can discover remote MCP servers; local execution remains available for self-hosting and offline preflight work. glama.json identifies the GitHub maintainer for directory indexing and ownership.
Design notes
server.jscontains the Express app, x402 payment middleware, discovery metadata, and route wiring.mcp-core.jsdefines the shared MCP tool surface;mcp-server.jsruns it over stdio and/mcpruns it over Streamable HTTP.analysis.jscontains deterministic context analysis;bounty-radar.jscontains source normalization and evidence policy.payanagent-health.jscontains the bounded, read-only catalog collector and probe logic.market-pulse.jscontains the bounded public market/RPC collectors and partial-source health output.test/server.test.jscovers redaction, budgets, the health route, and funded/unfunded labeling;test/payanagent-health.test.jscovers health classification and the no-payment probe contract.- The API intentionally does not send submitted text to a third party; processing is local.
- This is an experiment. Revenue must be verified from settlement records, not inferred from 402 responses, requests, or directory listings.
agent-context-api MCPのよくある質問
agent-context-api MCPをClaude Codeに追加するには
ターミナルでclaude mcp add --transport http agent-context-api https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcpを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
agent-context-api MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
コンテキスト・プリフライトツールは何をするものですか?
GPTファミリーのトークン数をカウントし、オプションでモデルに応じた予算制限を適用し、リポジトリのテキストをLLMに送る準備として、認証情報と思われる箇所をマスキングします。
コンテキスト・プリフライトサービスは無料ですか?
ローカルのMCPツールは12,000文字までの入力に対して無料枠を提供していますが、それ以上の入力には有料のHTTPエンドポイントが必要です。
APIはテキストを第三者に送信しますか?
いいえ、APIはローカルで処理が行われるように設計されており、送信されたテキストが第三者に送られることはありません。
コンテキスト・プリフライトのリクエスト費用はいくらですか?
有料エンドポイントのデフォルト価格は、1リクエストあたり$0.005です。