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.

已验证Streamable HTTP可网页运行金融开发者工具数据与分析

概览

AI 生成的概览

一个远程 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。
安装前请注意
多个路由按请求收费(预检 $0.005,bounty-radar、payanagent-health 和 base-market-pulse 各 $0.01,agent-work-brief $0.03),以 Base USDC 结算。服务称不会把提交的文本发送给第三方且无需签名密钥,但部署时仍应避免放入私钥和 facilitator 凭据。市场数据仅供参考,不执行交易。项目自称实验性质,收入应以结算记录核实。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agent Context Api,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

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

bash
npm installnpm testX402_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

bash
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:

json
{"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:

bash
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.js contains the Express app, x402 payment middleware, discovery metadata, and route wiring.
  • mcp-core.js defines the shared MCP tool surface; mcp-server.js runs it over stdio and /mcp runs it over Streamable HTTP.
  • analysis.js contains deterministic context analysis; bounty-radar.js contains source normalization and evidence policy.
  • payanagent-health.js contains the bounded, read-only catalog collector and probe logic.
  • market-pulse.js contains the bounded public market/RPC collectors and partial-source health output.
  • test/server.test.js covers redaction, budgets, the health route, and funded/unfunded labeling; test/payanagent-health.test.js covers 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
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v0.7.4最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分