Sign In

@one-source/api-mcp

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@one-source/api-mcp

MCP server for OneSource blockchain data — 26 named tools for balances, NFTs, transactions, events, live chain queries, and x402 payment-mode control via x402

Source
npmnpm
Version
5.2.1
Version published
Weekly downloads
655
15.52%
Maintainers
3
Weekly downloads
 
Created
Source

onesource-api-mcp

MCP server for OneSource blockchain data. 26 named tools for balances, NFTs, transactions, events, and live chain queries via API key or x402 micropayments.

npx onesource-api-mcp

Install

# Claude Code
claude mcp add onesource-api -- npx onesource-api-mcp

# Claude Desktop / Cursor — add to MCP config:
{
  "mcpServers": {
    "onesource-api": {
      "command": "npx",
      "args": ["-y", "onesource-api-mcp"]
    }
  }
}

Tools (26)

Live Chain Data (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

Chain Utilities (13 tools) - RPC Only

ToolDescription
1s_block_by_numberBlock details by number
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

Session (1 tool)

ToolDescription
1s_payment_modeView or switch the x402 payment scheme (exact per-call vs batch payment channel)

Networks

All tools accept an optional network parameter:

NetworkDescription
ethereumEthereum mainnet (default)
sepoliaEthereum Sepolia testnet
avaxAvalanche C-Chain

Authentication

Two auth methods are supported. API key takes priority when both are configured.

Set ONESOURCE_API_KEY to your OneSource API key. The server sends it as a Bearer token on every request.

ONESOURCE_API_KEY=your-key-here npx onesource-api-mcp

Or in your MCP config:

{
  "mcpServers": {
    "onesource-api": {
      "command": "npx",
      "args": ["-y", "onesource-api-mcp"],
      "env": {
        "ONESOURCE_API_KEY": "your-key-here"
      }
    }
  }
}

x402 Micropayments

Set X402_PRIVATE_KEY to a funded EVM wallet key. The server automatically signs and settles USDC payments on Base via x402.

X402_PRIVATE_KEY=your-private-key-hex npx onesource-api-mcp

Payments default to the exact scheme (one USDC payment per call). For a burst of calls you can switch to batch settlement — a payment channel that funds many off-chain calls from a single on-chain deposit, settled with one claim — by calling the 1s_payment_mode tool with { "mode": "batch" }, or by setting X402_PAYMENT_MODE=batch. Both modes use the same wallet.

No auth

Without either variable, tools work for free endpoints. Paid endpoints return 402 errors with a descriptive message.

Configuration

VariableDefaultDescription
ONESOURCE_API_KEYOneSource API key. Sent as Authorization: Bearer <key>. Takes priority over x402.
ONESOURCE_BASE_URLhttps://skills.onesource.ioSkills API endpoint
X402_PRIVATE_KEYEVM private key (hex, with or without 0x prefix) for automatic x402 USDC payments on Base
X402_PAYMENT_MODEexactInitial x402 scheme: exact (per-call) or batch (payment channel). Switch in-session with the 1s_payment_mode tool.
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).
X402_DEPOSIT_MULTIPLIER5Batch mode: deposit = price × this multiplier, funding that many calls per channel
X402_CHANNEL_SALTzeroBatch mode: 32-byte hex salt to derive a distinct channel id

License

MIT

Keywords

mcp

FAQs

Package last updated on 05 Jun 2026

Related posts