
Agent Context Api
io.github.dacode-dev由 GitHub 帳號 dacode-dev 發布v0.7.4更新於 Oct 24, 2026
Agent-work MCP: free context preflight and page-read previews, paid x402 HTTP upgrades.
概覽
一個遠端 MCP 端點,提供免費的上下文預檢(詞元計數、預算、憑證遮蔽),以及以 x402 付費的代理任務列表與市場資料介面。
- 可以做什麼
- 對儲存庫文字執行上下文預檢:計算 GPT 系列詞元、依模型套用可選預算並遮蔽疑似憑證,本機或託管端點免費處理至 12,000 字元,更大輸入依 x402 價格走付費介面。取得正規化的代理任務列表,含來源健康、截止時間、認領保證金以及已注資與未驗證的標註。以唯讀 HEAD/OPTIONS 探測取得 PayanAgent 目錄的存活快照。取得 Base 市場脈動,彙整公開的 ETH 現貨、DEX 交易對與 Base RPC 區塊和 gas 資料。請求代理任務簡報,結合託管任務與目錄存活情況並標出需要資金的機會。
- 適用情境
- 當編碼代理在把儲存庫文字送給 LLM 前需要確定性檢查時,或當代理希望取得帶時間戳、持續維護的代理任務列表、目錄存活狀態或 Base 市場訊號而不想自行執行採集器時使用。
- 執行需求
- 遠端 Streamable HTTP 端點;未宣告驗證、環境變數或請求標頭。付費路由需透過 x402 以 Base USDC 付款,較大的預檢輸入會被導向付費 HTTP 端點。自架需要 Node.js 與 npm,可選設定 PAY_TO、X402_FACILITATOR 和 PUBLIC_HOSTS。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Agent Context Api,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.dacode-dev%2Fagent-context-api/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"agent-context-api": {
"type": "http",
"url": "https://agent-context-api-proxy.agent-context-proxy.workers.dev/mcp"
}
}
}README
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
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
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:
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:
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.
來源:README.md,提交 bf05daf
工具
0版本歷史
1- v0.7.4最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具必需15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分