app.vercel.baselens-api/baselens
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@app.vercel.baselens-api/baselensWhat's the current Base gas fee and suggested priority fee?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BaseLens
Pay-per-call Base (chain 8453) on-chain reads for AI agents. No account and no API key: call a URL, get 402 Payment Required, pay the quoted amount in USDC on Base, and retry. The same data is available as a remote MCP server.
Live service: https://baselens-api.vercel.app
Payments settle to 0x50F806C7E473322484bc91FF628380a3b12366f9 on Base, in native USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913). Prices are $0.001–$0.004 per call. Responses are read-only chain facts, not financial advice and not an audit.
Paid HTTP endpoints
Every paid route is GET. Arguments are query parameters. A call without a payment header returns HTTP 402 with the x402 requirements (scheme: exact, network: eip155:8453).
Method and path | Price | Query | What you get |
| $0.002 |
| EOA vs contract vs EIP-7702, ETH balance, nonce, code size, and native USDC balance at the latest block. |
| $0.002 |
| ERC-20 balance for any Base token, raw and human-readable, plus symbol and decimals. |
| $0.003 |
| Name, symbol, decimals, total supply, code size, |
| $0.003 |
| Transaction summary: status, block time, from/to, value, total fee (including the L1 fee), and decoded ERC-20 |
| $0.001 | none | Base fee, gas price, suggested EIP-1559 max fee and priority fee (gwei), block fullness, and the cost of a plain ETH transfer. |
| $0.001 |
| Forward-resolve a Basename ( |
| $0.003 |
| On-chain USDC price of 1 whole token from Uniswap v3 on Base (direct USDC pool, or via WETH, best fee tier). No third-party price API. |
| $0.004 |
| Recent ERC-20 transfers in and out of an address, newest first. |
| $0.003 |
| Contract, code size, |
Example (this returns 402 until you pay):
curl -i "https://baselens-api.vercel.app/v1/gas"
curl -i "https://baselens-api.vercel.app/v1/name?name=jesse.base.eth"Worked examples for every route are also in routes.js and on /llms.txt.
Related MCP server: 47620-evm-mcp
Free routes
Path | Purpose |
| Truncated gas sample so you can see the output shape before paying. The full reading is |
|
|
| Short HTML index of the endpoints. |
| Service icon ( |
| Minimal A2A JSON-RPC |
| Redirects to |
How agents pay (x402)
BaseLens speaks x402 v2, scheme exact, network eip155:8453 (Base mainnet).
The client requests the resource.
The server responds
402with aPAYMENT-REQUIREDheader (and a JSON body) quoting the USDC amount, asset, andpayTo.The client signs an EIP-3009
transferWithAuthorizationfor that exact amount of USDC on Base. The paying wallet needs the USDC; the facilitator submits the authorization, so the wallet does not broadcast the transaction itself.The client retries the same request with a
PAYMENT-SIGNATUREheader.The facilitator verifies and settles. The success response includes a
PAYMENT-RESPONSEreceipt.
The paying wallet is any EVM account that holds USDC on Base. Do not commit the private key. Cap spend in the client if you run this unattended. Each call is a fresh payment; there is no session or stored balance.
The v2 client packages are @x402/fetch and @x402/axios (successors of the v1 packages x402-fetch and x402-axios). Use the v2 packages against this server.
Fetch
npm install @x402/fetch @x402/evm viemimport { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});
const response = await fetchWithPayment("https://baselens-api.vercel.app/v1/gas");
console.log(await response.json());
// receipt: response.headers.get("PAYMENT-RESPONSE")Axios
npm install @x402/axios @x402/evm axios viemimport axios from "axios";
import { wrapAxiosWithPaymentFromConfig } from "@x402/axios";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const api = wrapAxiosWithPaymentFromConfig(axios.create(), {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});
const { data } = await api.get("https://baselens-api.vercel.app/v1/address", {
params: { address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" },
});
console.log(data);MCP
Remote Streamable HTTP MCP endpoint:
https://baselens-api.vercel.app/mcpRegistry server name (see server.json):
app.vercel.baselens-api/baselensPaid tools use x402-over-MCP: the client sends the payment payload in _meta["x402/payment"] and receives the settlement in _meta["x402/payment-response"]. POST JSON-RPC to /mcp. The server is stateless (GET and DELETE return 405).
Tool | Price | Same data as |
| $0.002 |
|
| $0.002 |
|
| $0.003 |
|
| $0.003 |
|
| $0.001 |
|
| $0.001 |
|
| $0.003 |
|
| $0.004 |
|
| $0.003 |
|
| free | Truncated |
| free | Tool list with prices, inputs, and HTTP URLs |
Claude Desktop and Cursor can attach the remote URL and call the two free tools. Paid tools return a payment-required error until the client attaches an x402 payment. An x402-aware MCP client (@x402/mcp) does that automatically.
Claude Desktop
Add this to claude_desktop_config.json (Claude Desktop with remote MCP support):
{
"mcpServers": {
"baselens": {
"url": "https://baselens-api.vercel.app/mcp"
}
}
}Cursor
Add this to ~/.cursor/mcp.json (or the project .cursor/mcp.json):
{
"mcpServers": {
"baselens": {
"url": "https://baselens-api.vercel.app/mcp"
}
}
}Paying MCP client
npm install @x402/mcp @x402/evm @modelcontextprotocol/sdk viemimport { createx402MCPClient } from "@x402/mcp";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const client = createx402MCPClient({
name: "baselens-caller",
version: "1.0.0",
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
autoPayment: true,
onPaymentRequested: async ({ paymentRequired }) => {
console.log("paying", paymentRequired.accepts[0].amount, "USDC atomic units");
return true;
},
});
await client.connect(
new StreamableHTTPClientTransport(new URL("https://baselens-api.vercel.app/mcp")),
);
const sample = await client.callTool("base_free_gas_sample", {});
const priced = await client.callTool("base_price", {
token: "0x4200000000000000000000000000000000000006",
});
console.log(sample.content, priced.content);Discovery
URL | What it is |
Plain-text endpoint list for agents. | |
OpenAPI 3.1 description of the paid routes, including | |
x402 resource discovery document. | |
A2A agent card (also at | |
MCP registry server card. Also at | |
Tool list, input schemas, and the note that paid tools settle via |
Bazaar discovery extensions are attached to each paid route, so facilitators that index the x402 Bazaar can list them when the Coinbase CDP facilitator is enabled (see environment variables).
Self-hosting
Requires Node.js 24.x (engines in package.json) and outbound HTTPS to public Base and Ethereum RPC endpoints, Uniswap v3’s Quoter on Base, and Sourcify (for /v1/contract).
git clone https://github.com/elevatedesign/baselens.git
cd baselens
npm install
npm start # node server.js, listens on $PORT or 3409
curl -s localhost:3409/healthindex.js builds the Express app and is the module Vercel runs. server.js only calls listen for a local or VPS process. Paid routes read public RPCs at request time (https://base-rpc.publicnode.com, https://mainnet.base.org, https://base.drpc.org, with Ethereum mainnet for ENS and Basenames).
check-payments.mjs lists USDC transfers into the payTo address (any sender, not only BaseLens settlements):
node check-payments.mjs # from block 53289500
node check-payments.mjs 53300000 # from a later blockDeploy to Vercel
Vercel runs Express with no extra config when index.js default-exports the app. public/ is served as static files (/icon.png). express.static() is not used.
Import this repository in the Vercel dashboard, or from the repo root run
npx vercel.Leave the framework on Express / Other. There is no build step. Set the Node.js version to 24.x so it matches
package.json.Optionally set the environment variables below, then deploy.
The public production deployment is https://baselens-api.vercel.app.
On Vercel the app is one Fluid Compute function. /v1/transfers can scan up to ~30,000 blocks, so give the function enough duration if you raise the default timeout.
Environment variables
Variable | Required | Effect |
| no | Listen port for |
| no | Together with the secret, switches the x402 facilitator from PayAI to Coinbase CDP. |
| no | Coinbase CDP API key secret. Both CDP variables must be set; either one alone keeps the PayAI facilitator. |
With neither CDP variable set, BaseLens uses the keyless PayAI facilitator (@payai/facilitator). Setting both CDP_API_KEY_ID and CDP_API_KEY_SECRET calls createFacilitatorConfig from @coinbase/x402 and the facilitator becomes Coinbase CDP, which indexes resources into the Coinbase x402 Bazaar. GET /health reports the active facilitator as payai or cdp.
Do not commit key values. .env* is gitignored.
Layout
index.js Express app: x402 middleware, routes, discovery, A2A
server.js Local listener
routes.js Prices, descriptions, and discovery examples
mcp.js Streamable HTTP MCP at /mcp
lib/chain.js viem reads against Base (and Ethereum for names)
server.json MCP registry manifest
public/icon.png Icon served at /icon.png on Vercel
check-payments.mjs List USDC received by the payTo addressLicense
MIT © 2026 Elevate Design NW
This server cannot be deployed
Maintenance
Related MCP Connectors
Onchain DeFi intelligence API for Base, payable per call with x402 (USDC). Live MCP tools: get_bot_status (Telegram bot health), get_market_stats (market snapshot), get_onchain_sales (proven revenue from live x402 routes). Built for agents that need verifiable onchain data — whale flow, signals, and sales evidence at $0.003/call.
Market and on-chain crypto data for AI agents. Pay per call in USDC on Base (x402).
Pay-per-call Base and Polygon onchain data over x402 for AI agents.
Market data and web intelligence for AI agents, paid per call in USDC on Base via x402.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to fetch crypto market and on-chain data, including prices across venues, token facts, OHLC candles, market overview, DeFi TVL, and wallet balances, with two free tools and the rest paid per call in USDC on Base via x402.89 npmMIT
- AlicenseAqualityCmaintenanceEnables AI agents to access pay-per-call Base and Polygon onchain data (balances, tokens, transactions, gas, blocks, and trending pairs) settled in USDC via x402, with no API key required.18MIT

AgentBIT MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to call 50+ pay-per-request tools covering onchain and crypto data, web research, security, compliance screening, business intelligence, and infrastructure checks. Payments settle per call in USDC on Base through the x402 protocol with no accounts, API keys, or subscriptions, and the first call is free for new wallets.MIT- AlicenseNot gradedqualityBmaintenanceEnables AI agents to run honeypot and owner-power safety checks on Base tokens and to read wallet ETH and USDC balances, with every answer sourced from real chain data and paid per call in USDC via x402.MIT