🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@one-source/mcp

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@one-source/mcp

Unified MCP server for OneSource — 30 tools for blockchain data, with x402 (USDC on Base) and MPP (Tempo) pay-per-call payment rails

latest
Source
npmnpm
Version
5.10.2
Version published
Maintainers
3
Created
Source

@one-source/mcp

Unified MCP server for OneSource — 30 tools for blockchain data and live chain queries in a single server.

What is MCP? The Model Context Protocol lets AI assistants call tools and access data sources. This server exposes both the OneSource blockchain API and its documentation as tools.

Quick Start

Claude Code

claude mcp add onesource -- npx -y @one-source/mcp@latest

Claude Desktop / Cursor

Add to your MCP config:

{
  "mcpServers": {
    "onesource": {
      "command": "npx",
      "args": ["-y", "@one-source/mcp@latest"]
    }
  }
}

Any MCP Client (stdio)

npx -y @one-source/mcp@latest

HTTP Server (self-hosted)

npx -y @one-source/mcp@latest --http
npx -y @one-source/mcp@latest --http --port=8080

Then connect your MCP client to http://localhost:3000/.

Health check: GET http://localhost:3000/health

Tools (30)

Blockchain API — Live Chain (12 tools)

ToolDescription
1s_allowance_liveERC20 allowance check
1s_contract_info_liveContract type detection via ERC165
1s_erc1155_balance_liveERC1155 balance via RPC
1s_erc20_balance_liveERC20 balance via balanceOf
1s_erc20_transfers_liveERC20 Transfer logs via eth_getLogs
1s_erc721_tokens_liveERC721 token enumeration
1s_events_liveEvent logs via eth_getLogs
1s_multi_balance_liveETH + multiple ERC20 balances
1s_nft_metadata_liveNFT metadata via tokenURI
1s_nft_owner_liveNFT owner via ownerOf
1s_total_supply_liveToken total supply
1s_tx_details_liveTransaction + receipt via RPC

Blockchain API — Chain Utilities (13 tools)

RPC only.

ToolDescription
1s_block_by_numberBlock details by number via RPC
1s_block_numberLatest block number
1s_chain_idEIP-155 chain ID
1s_contract_codeContract bytecode
1s_ens_resolveENS name/address resolution
1s_estimate_gasGas estimation
1s_network_infoChain ID, block number, gas price
1s_nonceTransaction count
1s_pending_blockPending block from mempool
1s_proxy_detectProxy contract detection
1s_simulate_callSimulate eth_call
1s_storage_readRead storage slot
1s_tx_receiptTransaction receipt

Payments (2 tools)

ToolDescription
1s_payment_modeView or switch the payment rail + scheme across all four modes: x402-exact / x402-batch (USDC on Base) and mpp-charge / mpp-session (USDC.e / pathUSD on Tempo). batch and session open a channel that funds many calls.
1s_refundReclaim an open payment channel's unspent deposit on demand — works for both an x402 batch channel (Base) and an MPP session voucher channel (Tempo)

Setup & Ops (3 tools)

No authentication required.

ToolPurposeWhen to use
1s_setup_checkInteractive setup & health check — walks the user through every config choice for both rails (auth method, x402, MPP, payment modes, channel prefs) one decision at a time, every run, plus version/auth/channel/connectivity statusFirst thing to call — to set up, change configuration, or troubleshoot
1s_batch_configView or change payment-channel preferences (autonomy, threshold, x402 deposit multiplier, MPP session deposit cap, default mode) and persist them across restarts — no config editing requiredConfigure channel behaviour from the session
1s_report_bugReport bugs to Slack (or GitHub Issues fallback)When a tool errors or user wants to report an issue

Networks

All blockchain API tools accept an optional network parameter:

NetworkDescription
ethereumEthereum mainnet (default)
sepoliaEthereum Sepolia testnet
robinhoodRobinhood Chain, chain 4663 (Arbitrum Orbit L2) — live-RPC only

Authentication

Blockchain API tools require authentication. Three options are available — if an API key is set alongside a wallet key, the API key takes priority and the wallet is ignored.

Tip: the easiest way to configure any of these is the 1s_setup_check tool — it walks you through every option interactively and hands you a ready-to-run command, so you never have to hand-edit env vars or config files. The manual instructions below are the reference.

MethodVariableDescription
API keyONESOURCE_API_KEYUnlimited calls, no per-call cost
x402 micropaymentsX402_PRIVATE_KEYPay-per-call via USDC on Base, no account required
MPP micropaymentsMPP_PRIVATE_KEYPay-per-call via USDC.e / pathUSD on Tempo, no account required

Option 1: API Key

  • Go to app.onesource.io and create an account.
  • Subscribe to a developer plan (Stripe checkout).
  • Navigate to API Keys and generate a key.
  • Copy the key — it starts with sk_.

Claude Code

claude mcp add onesource -e ONESOURCE_API_KEY=<key> -- npx -y @one-source/mcp@latest

Claude Desktop / Cursor

{
  "mcpServers": {
    "onesource": {
      "command": "npx",
      "args": ["-y", "@one-source/mcp@latest"],
      "env": {
        "ONESOURCE_API_KEY": "<key>"
      }
    }
  }
}

Any MCP Client (stdio)

ONESOURCE_API_KEY=<key> npx -y @one-source/mcp@latest

After adding, reload the MCP server and call 1s_setup_check — under Current configuration it should report Active auth method: API key (with the first 6 characters of your key).

Option 2: x402 Micropayments

Pay-per-call via USDC on Base using x402. No account required — just an EVM wallet funded with USDC. The server handles payments transparently.

  • Get an EVM private key — export from MetaMask, Coinbase Wallet, or generate a fresh one. The key is a 64-character hex string. The 0x prefix is optional — both formats are accepted.
  • Pass the key to the server:

Claude Code

claude mcp add onesource -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest

Claude Desktop / Cursor

{
  "mcpServers": {
    "onesource": {
      "command": "npx",
      "args": ["-y", "@one-source/mcp@latest"],
      "env": {
        "X402_PRIVATE_KEY": "<key>"
      }
    }
  }
}

Any MCP Client (stdio)

X402_PRIVATE_KEY=<key> npx -y @one-source/mcp@latest
  • Reload and find your wallet address — reload the MCP server, then call 1s_setup_check. Under Current configuration it lists your x402 (Base) wallet — the address derived from your key.
  • Fund that address with USDC on Base — send USDC to the address shown, on the Base network. A few dollars ($1–5 USDC) is enough for hundreds of calls. Bridge from Ethereum mainnet if needed using the Base Bridge.
  • Verify — call 1s_network_info for ethereum. If it returns chain data, payments are working.

Option 3: MPP Micropayments (Tempo)

Pay-per-call via USDC.e / pathUSD on the Tempo network — an alternative to x402 on Base. No account required — just a Tempo wallet funded with USDC.e or pathUSD. The server handles payments transparently.

  • Get an EVM private key — same format as x402 (64-char hex, 0x optional).
  • Pass the key to the server:

Claude Code

claude mcp add onesource -e MPP_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest

Claude Desktop / Cursor

{
  "mcpServers": {
    "onesource": {
      "command": "npx",
      "args": ["-y", "@one-source/mcp@latest"],
      "env": {
        "MPP_PRIVATE_KEY": "<key>"
      }
    }
  }
}

Any MCP Client (stdio)

MPP_PRIVATE_KEY=<key> npx -y @one-source/mcp@latest
  • Reload and find your wallet address — reload the MCP server, then call 1s_setup_check. Under Current configuration it lists your MPP (Tempo) wallet — the address derived from your key.
  • Fund that address with USDC.e or pathUSD on Tempo — a few dollars covers hundreds of calls.
  • Verify — call 1s_network_info. If it returns chain data, MPP payments are working.

Payment channels (optional)

By default each paid call signs one payment per call (x402-exact on Base, mpp-charge on Tempo). For a burst of calls, open a payment channel — one on-chain deposit funds many off-chain calls, settled together — which is cheaper than per-call:

  • x402 (Base): 1s_payment_mode { "mode": "x402-batch" } (or X402_PAYMENT_MODE=batch). First call deposits price × X402_DEPOSIT_MULTIPLIER (default 10).
  • MPP (Tempo): 1s_payment_mode { "mode": "mpp-session" } (or MPP_PAYMENT_MODE=session). First call deposits up to MPP_MAX_DEPOSIT (default 1).

Reclaim the unused balance any time with the 1s_refund tool (works for both rails); the residual is always recoverable. An idle x402 channel auto-refunds after a few hours; an MPP session settles automatically on clean shutdown.

When paying via a wallet, the agent is also given channel guidance at startup so it can manage this for you: when it anticipates a burst of calls it offers to switch to the active rail's channel mode and reminds you to 1s_refund when done. Tune that behavior with the 1s_batch_config tool — set whether the agent asks first / switches automatically / only on request (prompt), how many calls count as "a burst" (threshold, shared across rails), the x402 deposit multiplier, the MPP session deposit cap, and the default mode, all from your session. Changes are saved to a server-managed config file and persist across restarts, so you never have to edit the MCP config or set env vars by hand. (The matching X402_* / MPP_* env vars still work as install-time defaults.) Run 1s_setup_check to see your current mode, whether the channel is available, and these settings.

Security

Never commit keys to source control. Use environment variables, a .env file (excluded from git), or a secrets manager.

After any config change: Run /reload-plugins in Claude Code, or restart Claude Desktop / Cursor. The MCP server must be reloaded to pick up new environment variables.

Environment Variables

Required

Set one to access the blockchain API tools. Without any, only the no-auth Setup & Ops tools work. The API key takes priority when set alongside a wallet key.

VariableDefaultDescription
ONESOURCE_API_KEYOneSource API key for Bearer token auth. Takes priority over the wallet rails.
X402_PRIVATE_KEYEVM private key (64-char hex, 0x prefix optional) for automatic x402 USDC payments on Base.
MPP_PRIVATE_KEYEVM private key for automatic MPP payments (USDC.e / pathUSD) on Tempo.

Optional / Advanced

All have sensible defaults — channel modes run out of the box. Set these only to tune how channel modes behave or how proactively the agent reaches for them. Payment modes can also be switched at runtime with the 1s_payment_mode tool.

VariableDefaultDescription
X402_PAYMENT_MODEexactInitial x402 scheme: exact (per-call) or batch (payment channel). Switch in-session with 1s_payment_mode.
X402_DEPOSIT_MULTIPLIER10Batch mode: deposit = price × this multiplier, funding that many calls per channel. Unused balance is reclaimable via 1s_refund.
X402_RPC_URLBase defaultBase RPC endpoint used to submit channel deposits in batch mode.
X402_CHANNEL_DIRDirectory to persist batch channel state across restarts. Unset = in-memory (channel lost on restart).
MPP_PAYMENT_MODEchargeInitial MPP scheme: charge (per-call) or session (Tempo voucher channel). Switch in-session with 1s_payment_mode.
MPP_MAX_DEPOSIT1Session mode: max USDC.e / pathUSD locked per Tempo voucher channel. Unused balance is reclaimable via 1s_refund.
MPP_RPC_URLTempo defaultTempo RPC endpoint used to submit channel deposits in session mode.
X402_BATCH_PROMPTaskHow the agent handles switching to a channel mode (both rails): ask (confirm first), auto (switch on its own), or off (only when explicitly asked).
X402_BATCH_THRESHOLD5Number of anticipated calls in a session at/above which the agent considers a channel mode (both rails). Advisory — the agent estimates the count; not a hard runtime counter.

Troubleshooting

1s_setup_check shows "Active auth method: none" (blockchain tools locked) — Under Current configuration, "Active auth method: none" means no authentication is set. Set one of ONESOURCE_API_KEY (API key), X402_PRIVATE_KEY (x402 on Base), or MPP_PRIVATE_KEY (MPP on Tempo) — or just run 1s_setup_check and let it walk you through it. Reload the MCP server after setting any variable. If the key still isn't reaching the server, set it as a shell environment variable directly.

Getting 403 / wrong key active despite correct setup — A key set in your shell profile (e.g. ~/.zshrc, ~/.bash_profile) is picked up by the MCP server process even if it isn't in your Claude MCP config. Run echo $ONESOURCE_API_KEY in your terminal to check. If it prints a value you didn't intend, unset it (unset ONESOURCE_API_KEY) or explicitly clear it when adding the server: claude mcp add onesource -e ONESOURCE_API_KEY= -e X402_PRIVATE_KEY=<key> -- npx -y @one-source/mcp@latest. 1s_setup_check shows the first 6 characters of whichever key is active so you can confirm which one the server is using.

Instructions show wrong auth method after reinstall/reload-plugins in Claude Code reconnects tools but may not refresh the system prompt the LLM sees. If you switch auth method (e.g. API key → x402), do a full Claude Code restart to ensure the instructions reflect the new auth.

"MCP server onesource already exists" error — Run claude mcp remove onesource first, then re-add.

Windows: npx requires cmd /c wrapper — Update your MCP config to use "command": "cmd" with "args": ["/c", "npx", "-y", "@one-source/mcp@latest"]. Claude Code's /doctor command can diagnose this.

npx hangs with no output — That's normal in stdio mode. Use --http for an HTTP server.

Port already in use — Specify a different port: npx -y @one-source/mcp@latest --http --port=8080

License

Apache 2.0

Keywords

mcp

FAQs

Package last updated on 06 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts