WritersLogic AI Agents (x402)

السجل الرسمي الذكاء الاصطناعي والوكلاء

Pay-per-call AI agents over x402. Settled in USDC on Base with a per-call spending cap.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package @writerslogic/ai-agents-mcp
Claude Code
claude mcp add writerslogic-ai-agents-x402 -e 'AGENT_PRIVATE_KEY=<your agent_private_key>' -e 'MAX_USDC_PER_CALL=1.00' -e 'AGENTS_API_KEY=<your agents_api_key>' -e 'AGENTS_BASE_URL=https://agents.writerslogic.com' -- npx -y @writerslogic/ai-agents-mcp@0.1.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "writerslogic-ai-agents-x402": {
            "command": "npx",
            "args": [
                "-y",
                "@writerslogic/ai-agents-mcp@0.1.0"
            ],
            "env": {
                "AGENT_PRIVATE_KEY": "<your agent_private_key>",
                "MAX_USDC_PER_CALL": "1.00",
                "AGENTS_API_KEY": "<your agents_api_key>",
                "AGENTS_BASE_URL": "https://agents.writerslogic.com"
            }
        }
    }
}

متغيرات البيئة

  • AGENT_PRIVATE_KEY سري Private key of a dedicated, low-balance wallet holding USDC on Base. Signs gasless EIP-3009 payment authorizations. Without it, paid tools return payment instructions instead of paying.
  • MAX_USDC_PER_CALL Maximum USDC the client will authorize for a single tool call. Calls priced above it are refused.
  • AGENTS_API_KEY سري Hub API key sent as X-API-KEY. Bypasses payment.
  • AGENTS_BASE_URL Hub base URL (https only; http allowed for localhost).

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. @writerslogic/ai-agents-mcp
  2. Install
  3. Configuration
  4. Tools
  5. How payment works
  6. Provenance
  7. Security
  8. Development
  9. License

@writerslogic/ai-agents-mcp

An MCP server that exposes the WritersLogic x402 agent hub as tools. Each hub agent becomes one tool. Calls are priced in USDC and paid over x402 on Base, with no gas needed from the buyer.

The server is a thin client: it fetches the hub catalog, registers a tool per agent, forwards calls over HTTPS, and signs a payment authorization when the hub asks for one and your spending cap allows it.

Install

Requires Node.js 20 or later. No global install is needed; MCP clients run it with npx, which builds it from this repository on first run.

{
  "mcpServers": {
    "writerslogic-ai-agents": {
      "command": "npx",
      "args": ["-y", "@writerslogic/ai-agents-mcp"],
      "env": {
        "AGENT_PRIVATE_KEY": "0x...",
        "MAX_USDC_PER_CALL": "1.00"
      }
    }
  }
}

Put that block in your client's MCP configuration:

ClientConfig file
Claude Desktopclaude_desktop_config.json (Settings, Developer, Edit Config)
Cursor~/.cursor/mcp.json (or .cursor/mcp.json in a project)
Windsurf~/.codeium/windsurf/mcp_config.json
Clinecline_mcp_settings.json (MCP Servers, Configure MCP Servers)
Claude Codeclaude mcp add writerslogic-ai-agents -e AGENT_PRIVATE_KEY=0x... -- npx -y @writerslogic/ai-agents-mcp

Omit AGENT_PRIVATE_KEY to browse and to see prices: paid tools then return the payment instructions instead of paying.

Configuration

VariableDefaultPurpose
AGENT_PRIVATE_KEYunsetPrivate key of the wallet that pays. Needs USDC on Base, no ETH. Use a dedicated low-balance wallet.
MAX_USDC_PER_CALL1.00Per-call spending cap. A call whose price is above it is refused before anything is signed.
AGENTS_API_KEYunsetSent as X-API-KEY. Bypasses payment.
AGENTS_BASE_URLhttps://agents.writerslogic.comHub URL. Must be https; plain http is accepted for localhost only.
AGENTS_TIMEOUT_MS120000Timeout for tool calls (1000 to 600000). The catalog fetch uses at most 15 s.

Tools

Tools are discovered from the hub catalog (GET /api/v1/catalog) when the server starts and refreshed on tools/list after ten minutes, so the live list is authoritative. Tool names are the agent id with every character outside A-Za-z0-9_ replaced by _. Each tool takes the agent's own input schema. Agents at the time of writing:

ToolPrice (USDC)Description
abandoned_compound_miner2.00Abandoned Compound & Uncommercialized Trial Miner
accessibility_patcher0.75ADA / WCAG Lawsuit Shield & DOM Auto-Patcher
arxiv_to_code1.00arXiv-to-Production Code & Hyperparameter Compiler
token_trap_detector0.25On-Chain Bytecode & Unverified Token Trap Detector
chargeback_fighter2.50E-Commerce Chargeback Representment Builder
clarification_impact0.50Prediction-Market Clarification Impact Pricer
competitor_battlecard1.50SaaS Pricing & Competitor Battlecard Spy
contract_auditor1.00Smart Contract Auditor
contract_terminator1.00Dark Pattern Contract & Subscription Exit Lawyer
cover_claim5.00DeFi Cover Claim Adjudicator
diff_gatekeeper0.50PR / Dependency Breaking-Change & Exploit Gatekeeper
dispute_ev0.50UMA Dispute EV Desk
foreignResearchScout1.50Cross-Lingual Dark Science Arbitrage Scout
lead_enrichment0.50Autonomous Lead Enrichment
market_predictor0.10Prediction Market Analyzer
medical_bill_auditor3.00Medical Bill Upcoding & Overcharge Slasher
milestone_verifier2.00Grant Milestone Verifier with Signed Release Attestation
patent_design_around2.00Patent Design-Around & Freedom-to-Operate Architect
prior_art_invalidator2.50Global Prior-Art Patent Invalidator
replication_auditor0.75Scientific Consensus & Replication Failure Auditor
arbitrage_lawyer0.75Cross-Platform Arbitrage & Resolution Rules Lawyer
heal_scraper0.40Self-Healing Scraper & DOM-to-JSON Compiler
tariff_engineer1.50Global Customs & Tariff Engineering Optimizer
vault_exit_lawyer0.25Vault Exit Lawyer

Also always available, and free:

ToolDescription
verify_provenancePOSTs to /api/v1/verify-provenance to check the _provenance record on a paid result.

A paid result is the hub's JSON response, returned unchanged as text content.

How payment works

  1. The tool POSTs your arguments to the agent endpoint.
  2. If the hub answers 402, it sends a base64 PAYMENT-REQUIRED header (x402 v2) listing an exact scheme requirement: network eip155:8453, USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, an atomic amount (6 decimals), payTo, and the token's EIP-712 name and version.
  3. If AGENT_PRIVATE_KEY is set and amount is at most MAX_USDC_PER_CALL, the client signs an EIP-3009 TransferWithAuthorization (EIP-712, USDC domain on chain 8453) for exactly that amount to payTo, valid for the requirement's timeout, with a random nonce.
  4. It retries the same request once with the base64 PAYMENT-SIGNATURE header. The hub's facilitator submits the transfer and pays the gas.
  5. The result is returned. If the retry is not accepted, the error is returned and nothing further is sent.

If no key is configured, or the price is over the cap, the tool returns an error that states the price, network, asset and payTo, and no signature is produced.

Provenance

Paid results carry a _provenance record next to data. Pass the whole {data, _provenance} object to verify_provenance to check it against the hub. The request body is forwarded as given.

Security

  • The key stays local. AGENT_PRIVATE_KEY is read once from the environment, used only to sign typed data, and never logged or sent anywhere. Authorizations are signatures; the client never broadcasts a transaction.
  • The cap is per call, not per session. An agent that calls tools in a loop can spend MAX_USDC_PER_CALL each time. Fund the wallet with only what you are willing to lose, and lower the cap to the most expensive tool you actually want to allow.
  • Only USDC on Base is signed for. Challenges naming another network, asset, or transfer method are refused, so a malicious or compromised hub cannot ask for a different token. Base Sepolia (eip155:84532) USDC is also accepted for testing.
  • Catalog entries are untrusted. Endpoints must resolve to the hub's own origin, ids and prices are validated, and redirects are never followed, so credentials and signatures are not sent to other hosts.
  • Bounds. Requests are limited to 1 MiB, responses to 2 MiB, and every request has a timeout.
  • Stdout is the MCP stream. Logs go to stderr only; they include the paying address and each payment amount, never the key.
  • Anyone who holds a signed authorization before it expires could submit it, up to the signed amount and to payTo only.

Development

npm install
npm run build
npm test

Tests run against a local mock hub and verify the EIP-3009 signature by recovering the signer, the cap at limit-1, limit and limit+1, and an end-to-end stdio session against dist/index.js. No network access or funds are involved.

License

Apache-2.0. Copyright 2026 WritersLogic.

الأسئلة الشائعة

ما هو WritersLogic AI Agents (x402)؟

Pay-per-call AI agents over x402. Settled in USDC on Base with a per-call spending cap.

كيف أثبّت WritersLogic AI Agents (x402)؟

يعمل على جهازك. في Claude Code: claude mcp add writerslogic-ai-agents-x402 -e 'AGENT_PRIVATE_KEY=<your agent_private_key>' -e 'MAX_USDC_PER_CALL=1.00' -e 'AGENTS_API_KEY=<your agents_api_key>' -e 'AGENTS_BASE_URL=https://agents.writerslogic.com' -- npx -y @writerslogic/ai-agents-mcp@0.1.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج WritersLogic AI Agents (x402) إلى مفتاح API؟

نعم. يتطلب AGENT_PRIVATE_KEY, AGENTS_API_KEY، وتضبطها في إعداداته.

هل WritersLogic AI Agents (x402) مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص Apache-2.0.

من يصون WritersLogic AI Agents (x402)؟

ينشره writerslogic. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.