Skip to main content
AllSwap

MCP server

@allswapio/mcp-server is a read-only Model Context Protocol (MCP) server for AllSwap. It runs on your own machine and talks to your MCP client over stdio. It offers three tools, needs no API key or other credentials, has no runtime dependencies, and requires Node.js 22 or later.

It cannot quote prices, create or track orders, read balances, sign anything or move funds. The three tools read AllSwap's public asset catalog, return a fixed list of AllSwap's official channels, and build block-explorer links for transaction hashes. For quotes and orders, see the Partner API documentation.

Install and configure

Most MCP clients read a JSON file with an mcpServers object. Add this entry (strict JSON: no comments, no trailing commas). The client starts the server itself with npx, which downloads the package on first use; -y skips the install prompt. Node.js 22 or later must be on your PATH.

mcpServers
{
  "mcpServers": {
    "allswap": {
      "command": "npx",
      "args": ["-y", "@allswapio/mcp-server"]
    }
  }
}

The package installs one command, allswap-mcp. After you save the configuration, restart or reload the client so it starts the server, then check that the three tools are listed.

Where the entry goes differs by client. The notes below follow each client's own documentation as read on 2026-11-26; if your version behaves differently, trust its documentation over this page.

Claude Desktop

Open Settings, then Developer, then Edit Config. This opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json). Add the allswap entry inside your existing mcpServers object, or use the block as is if the file has none. Save, then quit Claude Desktop completely and start it again. Source: MCP documentation, “Connect to local MCP servers”.

claude_desktop_config.json
{
  "mcpServers": {
    "allswap": {
      "command": "npx",
      "args": ["-y", "@allswapio/mcp-server"]
    }
  }
}

To check it: after the restart, click the “Add files, connectors, and more” indicator in the conversation input box, move over Connectors, click Manage connectors and select allswap to see its tools.

Claude Code

Add it from the command line; the -- separates Claude Code's options from the server command. By default the server is stored for the current project only (scope local). --scope project writes it to .mcp.json in the project root so the project can share it, and --scope user makes it available in all your projects. Source: Claude Code documentation, MCP.

Default scope
claude mcp add --transport stdio allswap -- npx -y @allswapio/mcp-server
Project scope
claude mcp add --transport stdio --scope project allswap -- npx -y @allswapio/mcp-server

To check it: run claude mcp list, which shows a health status next to each server, or run /mcp inside a Claude Code session.

Cursor

Put the block in .cursor/mcp.json for one project, or in ~/.cursor/mcp.json for every project. The command must be on your system path or be a full path. Cursor's field table lists "type": "stdio" as required although its examples leave it out, so the sample below includes it. Source: Cursor documentation, MCP.

.cursor/mcp.json
{
  "mcpServers": {
    "allswap": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@allswapio/mcp-server"]
    }
  }
}

To check it: open Customize and make sure the server's toggle is on; its tools are then listed under Available Tools in chat. The Output panel (Cmd+Shift+U) with MCP Logs selected shows initialization and errors.

VS Code

Run MCP: Add Server from the Command Palette, choose Command (stdio) and enter npx -y @allswapio/mcp-server. Enter a unique server ID (for example allswap), then choose where to keep it: Global (Copilot Global) for a personal configuration shared across your workspaces, or, when the guided flow offers it, a workspace-root .mcp.json that you can share with your team through source control.

If you edit the files yourself, the format depends on the file. VS Code's editor-managed mcp.json (the workspace .vscode/mcp.json or the profile mcp.json) uses a top-level servers object; a workspace-root .mcp.json uses a top-level mcpServers object. Sources: VS Code documentation, MCP servers and MCP configuration reference.

mcp.json
{
  "servers": {
    "allswap": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@allswapio/mcp-server"]
    }
  }
}
.mcp.json
{
  "mcpServers": {
    "allswap": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@allswapio/mcp-server"]
    }
  }
}

To check it: run Chat: Open Customizations and open MCP Servers, where VS Code lists and manages your servers.

Environment variable

ALLSWAP_API_ORIGIN changes the origin that list_supported_assets reads (default https://allswap.io). It must be an http: or https: origin with no path, query or credentials, such as https://allswap.io. Otherwise the command prints one line to stderr and exits with code 2 before reading any input. Most setups never set it.

To set it, put it in the env object of the entry, for example "env": { "ALLSWAP_API_ORIGIN": "https://allswap.io" }, in a client that supports an env object.

Try it by hand

The server reads one JSON-RPC 2.0 message per line on stdin and writes one reply per line on stdout. This sends initialize, then asks for a Bitcoin explorer link:

Shell
printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_tx_explorer_url","arguments":{"network":"btc","txHash":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"}}}' \
  | npx -y @allswapio/mcp-server

The second reply contains "explorerUrl": "https://mempool.space/tx/4a5e1e4b…a33b" (shortened here). Tool results arrive as one text content item whose text is the JSON object shown in the examples below.

Run in a container

No container image is published. To run the server in a container, clone the repository and build the image yourself (the Dockerfile is in the repository, not in the npm package):

Build
git clone https://github.com/allswapio/mcp-server
cd mcp-server
docker build -t allswap-mcp .
Client configuration
{
  "mcpServers": {
    "allswap": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "allswap-mcp"]
    }
  }
}

Then use "command": "docker" with these args in the client configuration. The image runs as a non-root user and needs outbound HTTPS only for list_supported_assets.

Tools

All three tools carry the annotation readOnlyHint: true; only list_supported_assets has openWorldHint: true, because it is the only one that uses the network.

list_supported_assets

Fetches AllSwap's public asset catalog (GET https://allswap.io/api/v2/assets, no authentication; specification at /docs/openapi.json) and filters it. The only tool that uses the network.

Scroll the table sideways to view more columns.

FieldTypeDescription
symboloptionalstringExact symbol match, case-insensitive (usdt matches USDT).
chainIdoptionalstringCase-insensitive substring of the asset's chainId (eip155 matches every EVM chain).
quotableOnlyoptionalbooleantrue drops assets whose quotable is false.
limitoptionalinteger1 to 200, default 25. A value outside that range uses the default.

Returns observedAt, stale, totalAssets (entries in the catalog), matchedAssets (entries that passed the filters) and returnedAssets (up to limit matched entries, exactly as the API returns them; see the specification for their fields).

Errors. A non-2xx response, a redirect (redirects are not followed), a response body over 5 MiB, a network error or a timeout (8 seconds) returns { "error": "…" } with isError: true.

Arguments
{
  "symbol": "usdt",
  "chainId": "tron",
  "limit": 1
}
Result (shortened)
{
  "observedAt": "2026-11-25T15:35:33.021848959Z",
  "stale": false,
  "returnedAssets": [
    {
      "assetId": "tron:mainnet/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "chainId": "tron:mainnet",
      "decimals": 6,
      "destinationGroups": [
        "a",
        "b"
      ],
      "minAmountIn": "100000000",
      "quotable": true,
      "sourceGroups": [
        "a",
        "b"
      ],
      "symbol": "USDT",
      "version": 1
    }
  ]
}
Error result, for example
{
  "error": "Catalog endpoint returned HTTP 503"
}

get_official_channels

Takes no arguments and makes no network request. Use it to check that a link, account or email address that claims to be AllSwap is on the official list.

Returns a fixed object with: website, documentation, OpenAPI and verification page links; support and security contact (service@allswap.io); Telegram and X accounts; the Chrome Web Store extension ID and link; the operating company (Haohang Network Technology Co., Limited), its Hong Kong Business Registration No. and D-U-N-S number; its registered address; the compliance page; and the statement that AllSwap issues no token, presale or airdrop. It has no error case.

Arguments
{}
Result (shortened)
{
  "website": "https://allswap.io",
  "docs": "https://allswap.io/docs",
  "openApiSpec": "https://allswap.io/docs/openapi.json",
  "verifyPage": "https://allswap.io/verify",
  "supportEmail": "[email protected]",
  "securityEmail": "[email protected]",
  "operatingEntity": "Haohang Network Technology Co., Limited",
  "compliancePage": "https://allswap.io/compliance",
  "nativeTokenPolicy": "None — AllSwap does not issue any native platform token, presale, or airdrop."
}

get_tx_explorer_url

Returns a block-explorer URL for a transaction hash on a supported mainnet network. It makes no network request and checks only the format of the hash, not whether the transaction exists.

Scroll the table sideways to view more columns.

FieldTypeDescription
networkrequiredstringNetwork key, case-insensitive (see the table below).
txHashrequiredstringTransaction hash; surrounding whitespace is ignored.

Returns { network, txHash, explorerUrl, valid }. network and txHash are echoed only when they are strings (otherwise null). For an unknown network, a hash in the wrong format or a non-string argument, explorerUrl is null and valid is false; this is a normal result, not an error.

Arguments
{
  "network": "btc",
  "txHash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
}
Result
{
  "network": "btc",
  "txHash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
  "explorerUrl": "https://mempool.space/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
  "valid": true
}
Arguments (bad hash)
{
  "network": "eth",
  "txHash": "0x1234"
}
Result (bad hash)
{
  "network": "eth",
  "txHash": "0x1234",
  "explorerUrl": null,
  "valid": false
}

Network keys and hash formats

Each network can be named by a short key or by its chain id; both are accepted.

Scroll the table sideways to view more columns.

Network keysHash formatExplorer
eth, eip155:10x + 64 hex charactersetherscan.io
arb, eip155:421610x + 64 hex charactersarbiscan.io
base, eip155:84530x + 64 hex charactersbasescan.org
bsc, eip155:560x + 64 hex charactersbscscan.com
op, eip155:100x + 64 hex charactersoptimistic.etherscan.io
pol, eip155:1370x + 64 hex characterspolygonscan.com
avax, eip155:431140x + 64 hex characterssnowtrace.io
btc, bip122:000000000019d6689c085ae165831e9364 hex charactersmempool.space
ltc, bip122:12a765e31ffd4059bada1e25190f6e9864 hex characterslitecoinspace.org
doge, bip122:1a91e3dace36e2be3bf030a65679fe8264 hex charactersblockchair.com
bch, bip122:000000000000000000651ef99cb9fcbe64 hex charactersblockchair.com
zec, bip122:00040fe8ec8471911baa1db1266ea15d, bip122:0007104ccda289427919efc39dc9e4d464 hex charactersblockchair.com
tron, tron:mainnet64 hex characterstronscan.org
sol, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpBase58, 32 to 96 characterssolscan.io
ton, ton:mainnet64 hex characters (Base64 hashes are not linked)tonscan.org
xrp, ripple:064 hex charactersxrpscan.com
stellar, stellar:public64 hex charactersstellar.expert
near, near:mainnetBase58, 32 to 96 charactersnearblocks.io
sui, sui:mainnetBase58, 32 to 96 characterssuiscan.xyz
aptos, aptos:mainnet0x + 1 to 64 hex charactersexplorer.aptoslabs.com

The eip155:<id> and bip122:<hash> keys and solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp are CAIP-2 chain ids. tron:mainnet, ton:mainnet, ripple:0 and near:mainnet are aliases: the chain ids AllSwap's public asset API uses for those chains. stellar:public, sui:mainnet and aptos:mainnet are plain aliases. For Zcash, bip122:00040fe8ec8471911baa1db1266ea15d is the genesis-hash CAIP-2 id and bip122:0007104ccda289427919efc39dc9e4d4 is the chain id that the asset API returns for Zcash.

Protocol notes

  • Transport: stdio only, one JSON-RPC 2.0 message per line. There is no remote or HTTP endpoint.
  • Supported protocol revisions: 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. Only the initialize-based revisions are implemented; revision 2026-07-28 is not.
  • initialize answers with the client's protocolVersion when it is one of those revisions, with 2025-11-25 when the client asks for any other revision, and with 2024-11-05 when the client sends none. The only capability is tools.
  • Methods: initialize, ping, tools/list, tools/call. Notifications (messages without id) get no reply. Any other method, including server/discover, returns -32601.
  • Other errors: an unknown tool, or a tool name that is not a string, returns -32602. A message that is not a valid JSON-RPC 2.0 request (wrong jsonrpc value, a method that is not a string, or an id that is not a string, a number or null) returns -32600. That reply carries the request's id when it is a string, a number or null, and id: null otherwise, including when the request has no id. A line that is not JSON returns -32700 with id: null. An unexpected failure returns -32603 (with the same id rule) and the server keeps running.
  • Batches (JSON arrays) are not supported and return -32600.

Verify what you run

An MCP server runs on your machine with your user's permissions, so check where it comes from. Everything below is public.

Check provenance

Versions from 1.0.1 are published by the repository's GitHub Actions release workflow, from their version tags, with npm provenance. To check it, install the package in an empty project and run npm audit signatures. npm documents the command as verifying the registry signatures of downloaded packages and also their provenance attestations.

Shell
npm install @allswapio/mcp-server
npm audit signatures
Expected output
1 package has a verified registry signature

1 package has a verified attestation

Provenance ties the package to its source repository and build; it does not by itself show that the code is free of defects, so read the source if that matters to you. Version 1.0.0 was published by hand and carries no provenance.