2026-06-22

Building with MCP: Claude Code, hosted, and npm

The Model Context Protocol (MCP) is the emerging standard for how AI agents discover and call tools. Agent402 supports MCP in three ways: a hosted HTTP endpoint, an npm package for local use, and direct integration with Claude Code.

Hosted MCP endpoint

The simplest way to connect: point your MCP client at https://agent402.tools/mcp. This endpoint exposes four tools:

The hosted endpoint handles PoW challenges internally, so pure-CPU tools are effectively free through MCP. Paid tools require an x402 payment header on the call_tool request.

Claude Code setup

To add Agent402 to Claude Code, add this to your MCP configuration:

{
  "mcpServers": {
    "agent402": {
      "url": "https://agent402.tools/mcp"
    }
  }
}

Once connected, Claude Code can search through all 1,323 tools, find the right one for a task, and call it โ€” all through the standard MCP protocol. The search_tools and find_tool commands help the agent discover relevant tools without needing to know the full catalog.

npm package (local / stdio)

For local development or air-gapped environments, install the agent402-mcp npm package:

npm install -g agent402-mcp

Then configure it as a stdio MCP server in your client:

{
  "mcpServers": {
    "agent402": {
      "command": "agent402-mcp",
      "args": []
    }
  }
}

The npm package bundles the same tool definitions and connects to the hosted API for execution. It works with any MCP client that supports stdio transport โ€” Claude Code, Cline, Continue, and others.

Framework adapters

Beyond MCP, we publish framework-specific adapters for direct integration: OpenAI, Anthropic SDK, Vercel AI SDK, LangChain, LlamaIndex, Google ADK, OpenAI Agents, and AWS Strands. Each adapter wraps Agent402 tools in the framework's native tool format, so you can drop them into existing agent code without protocol translation.

All adapters and the MCP package are open source and published on npm. Check the GitHub repo for the latest versions.

← Back to blog