Kaia MCP Server
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., "@Kaia MCP Server What's the KAIA balance of 0x742d35Cc6634C0532925a3b844Bc4a1B1c542D5?"
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.
Kaia MCP Server
Production-ready Model Context Protocol (MCP) server for the Kaia blockchain. Exposes 25 partner-safe tools (26 if KAIA_ALLOW_UNSAFE_WALLET=1), 5 resources, and 6 prompts for balance, transactions, blocks, tokens, NFTs, contracts, network info, and calldata encoding.
HTTP is a partner-style connector: OAuth 2.1 with PKCE (browser) or device flow (CLI), fail-closed bearer auth, and token scopes mapped to an allowed-tool registry. An in-process demo IdP runs with the HTTP server so tests and CI need no real credentials. See docs/AUTH.md.
Installation
npm install -g kaia-mcp
# or
npx kaia-mcpRelated MCP server: KaiaFun MCP
Quick start
stdio (default) — run and connect via stdin/stdout (e.g. Claude Desktop, Cursor):
npx kaia-mcp
# or
npx kaia-mcp --transport stdioHTTP — Streamable HTTP on a port. Partner default (KAIA_AUTH_MODE=required) requires Authorization: Bearer on every MCP request. The same process serves the demo OAuth/OIDC endpoints.
npx kaia-mcp --transport http --port 3100
# GET http://127.0.0.1:3100/health
# GET http://127.0.0.1:3100/.well-known/openid-configurationTools (25 partner-safe)
Tool | Description |
| Get KAIA balance for an address |
| Get account summary: balance, tx count, nonce |
| List ERC-20 token holdings for an address |
| List NFT holdings for an address |
| Get transaction by hash |
| Get transaction receipt and status |
| List recent transactions for an address |
| Estimate gas for a transaction |
| Current block number |
| Get block by number or tag |
| Block rewards for a block |
| Token metadata (name, symbol, supply) |
| Top token holders |
| Token transfer history |
| ERC-20/KIP-7 allowance (owner/spender) for DeFi |
| NFT collection info |
| Single NFT item (owner, metadata) |
| NFT transfer history |
| Read contract view/pure function |
| Verified contract ABI from KaiaScan |
| Verified contract source from KaiaScan |
| Current gas price |
| KAIA price (USD, BTC, stats) from KaiaScan |
| Chain id and name (mainnet/kairos) |
| Encode contract call data from ABI and args ( |
| Not in the default list. Unsafe local-dev only ( |
Resources (5)
URI | Description |
| Mainnet status: block height, gas price, KAIA price |
| Kairos testnet status |
| Popular mainnet token addresses with name/symbol |
| Top 100 KAIA holders |
| Static reference of Kaia RPC methods |
Prompts (6)
Name | Args | Description |
| address, network? | Analyze wallet: balance, txs, tokens |
| txHash | Investigate tx: status, gas, transfers |
| contractAddress, network? | Research token: supply, holders, activity |
| contractAddress, tokenId, network? | Look up NFT: owner, metadata, history |
| network? | Gas report: price, history, recommendations |
| contractAddress, network? | Review contract: ABI, source, type |
Configuration
Environment variables (see .env.example):
Variable | Description | Default |
| Kaia mainnet RPC endpoint |
|
| Kairos testnet RPC |
|
| KaiaScan API key (optional) | — |
| mainnet or kairos | mainnet |
| debug, info, warn, error | info |
| Max RPC requests per second | 10 |
| Max KaiaScan requests per second | 5 |
| RPC request timeout (ms) | 30000 |
| KaiaScan request timeout (ms) | 15000 |
| HTTP auth: |
|
| Demo public client id |
|
| Demo access-token TTL | 900 |
| Public origin ( |
|
| Extra | unset |
| Reject authorize/device/token requests without an RFC 8707 | off (missing = this server) |
| Extra browser origins allowed on the MCP/OAuth endpoints (comma-separated); a foreign | only the public origin |
| Retired signing keys (comma-separated PEMs) still published in the JWKS and accepted for verification | unset |
| Dev RS256 key path, created 0600 if missing; keep it gitignored ( | unset (in-memory key per process) |
| Where revoked access-token |
|
| Gateway client id for |
|
| Gateway secret (HTTP Basic). Unset: introspection is not offered | unset |
| Enable | off |
MCP client setup
Cursor — add to Cursor MCP settings (e.g. ~/.cursor/mcp.json or project MCP config):
{
"mcpServers": {
"kaia": {
"command": "npx",
"args": ["kaia-mcp"],
"env": {}
}
}
}Claude Desktop — in Claude Desktop config (e.g. ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"kaia": {
"command": "npx",
"args": ["kaia-mcp"],
"env": {}
}
}
}Override env as needed, e.g. "env": { "KAIA_RPC_URL": "https://your-rpc.io", "KAIASCAN_API_KEY": "your-key" }.
Links
Programmatic use
import { createKaiaMcpServer, runKaiaMcpServer } from "kaia-mcp";
// Get the MCP Server instance (e.g. for custom transport)
const server = createKaiaMcpServer();
// Run over stdio (CLI default)
await runKaiaMcpServer();For HTTP:
import { runKaiaMcpServerHttp } from "kaia-mcp";
await runKaiaMcpServerHttp(3100);Docker
docker build -t kaia-mcp .
docker run -p 3100:3100 -e KAIA_RPC_URL=https://public-en.node.kaia.io kaia-mcpServer listens on port 3100 (Streamable HTTP transport). Override env as needed.
Connecting to the Docker server
The container runs the HTTP transport (not stdio), so clients must connect by URL.
Cursor — in MCP settings (e.g. ~/.cursor/mcp.json or project MCP config), add a server entry with url:
{
"mcpServers": {
"kaia": {
"url": "http://localhost:3100"
}
}
}If your client expects a path, use http://localhost:3100/mcp. Restart Cursor after changing MCP config.
Claude Desktop — if your Claude Desktop build supports remote MCP URLs, use the same url in its MCP config.
Test from the host (with the container running). Health is unauthenticated; MCP is not:
curl -s http://localhost:3100/health
# Obtain a demo token (see docs/AUTH.md), then:
curl -s -X POST http://localhost:3100 \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jqYou should see a list of tools filtered by the token’s scopes. Replace localhost with your machine’s IP or hostname when connecting from another device.
Partner integration
This server is an MCP connector, not a hosted product partnership. Integrate over HTTP with OAuth; do not treat stdio as a partner path.
Integration checklist
Discover
/.well-known/oauth-protected-resourceand/.well-known/openid-configuration(demo) or your authorization server’s metadata. Access tokens are RS256 JWTs; fetch keys from the discoveryjwks_uriand pinissandaud(both the server's canonical URI,KAIA_PUBLIC_URL) instead of trusting whatever the token says. Sendresource=<canonical URI>on authorize and token requests (RFC 8707) and check theisson the authorization response (RFC 9207).Register a public client. Require PKCE
S256for browser agents; use device flow for CLIs that cannot host a redirect.Allowlist redirect URIs. The demo IdP accepts only
http://127.0.0.1/callback,http://localhost/callback, and/cbvariants.Request least privilege:
kaia:readfor chain reads, addkaia:encodeonly if the agent must build calldata. Never requestkaia:walletin production.Send
Authorization: Bearer <access_token>on every MCP HTTP request. The transport is stateless (MCP 2026-07-28 via SDK v2createMcpHandler): noMcp-Session-Id, modern clients may useserver/discoverinstead ofinitialize,GET/DELETEanswer 405. MatchMcp-Method/Mcp-Name/MCP-Protocol-Versionto the body on modern requests (-32020on mismatch).tools/listiscacheScope: private.Handle fail-closed errors literally:
-32040unauthorized,-32041token_expired,-32043invalid_token (HTTP 401 with aWWW-Authenticatechallenge namingresource_metadata), and-32042insufficient_scope (HTTP 403,error="insufficient_scope"with the requiredscope). Retry only after a new token; do not retry a denied tool.On disconnect or user logout,
POST /oauth/revokewith the access or refresh token. Revocation is byjtiand only the issuer knows about it: a gateway that verifies JWTs offline must also call/oauth/introspect(client-authenticated) if it needs to see revocations beforeexp.Keep tokens out of logs, crash dumps, eval fixtures, and git. Prefer a token fingerprint if you must correlate requests.
Leave
KAIA_ALLOW_UNSAFE_WALLETunset.generate_walletmust not appear in partner tool lists and must not return private keys.Point production at your own OIDC issuer; the in-process demo IdP is for tests/CI/local bring-up only. No real user secrets or signing keys belong in this repo.
If you keep your own copy of the tool → scope map (e.g. in a policy gateway), compare it against
GET /.well-known/kaia-mcp/tool-scopesat startup and refuse to run on drift.
Threat notes
Scopes. A
kaia:readtoken must not callencode_function_data. Scope checks run before handlers; a deny has no chain or wallet side effect.Secret handling. Access tokens are signed JWTs and are not stored; refresh tokens are hashed at rest. The logger redacts bearer values and bare JWTs. The signing key is generated at startup (or read from a gitignored dev path) and only the public JWK is published. Wallet private keys are not emitted unless the explicit unsafe dev flag is on.
Offline verification vs revocation. A JWT stays cryptographically valid until
expeven after/oauth/revoke. kaia-mcp itself rejects revokedjtis; external verifiers need introspection or a short TTL.Algorithm confusion. Only
RS256with the publishedkidis accepted;alg=none,HS*, and foreign keys fail asinvalid_token.Sessions and DNS rebinding. There are no MCP sessions to steal; the bearer token is checked on every request. A browser page on a foreign origin is refused with 403 before auth (allow-list with
KAIA_ALLOWED_ORIGINS).PKCE downgrade.
code_challenge_method=plainis rejected.Open redirect. Unregistered
redirect_urivalues are rejected.Fallbacks.
KAIA_AUTH_MODE=offand stdio skip OAuth. Those paths are local-only. Partners must not ship them as a “fallback” for failed authentication; failed auth is a deny.Unsafe wallet flag. If an operator enables
KAIA_ALLOW_UNSAFE_WALLET=1, private keys can leave the process. Treat that as a break-glass local tool, not a partner feature.
Full protocol detail: docs/AUTH.md.
License
MIT
Available Tools
25 toolsencode_function_dataA
Encode function call data from ABI, function name, and optional args. Uses viem encodeFunctionData. Returns hex data string. Use for building transaction calldata.
Inputs: abi (required), functionName (required), args.
estimate_gasA
Estimate gas for a transaction (from, to optional for contract creation, value, data). Returns estimated gas and optionally KAIA at current gas price.
Inputs: from (required), to, data, value, +1 more.
get_account_infoB
Get account info (type, balance, nonce, accountKey) for an address via Kaia RPC kaia_getAccount.
Inputs: address (required), network.
get_account_nftsC
Get NFT inventories for an address via KaiaScan API.
Inputs: address (required), page, size, network.
get_account_tokensB
Get fungible token balances for an address via KaiaScan API.
Inputs: address (required), page, size, network.
get_account_transactionsB
Get list of transactions for an account via KaiaScan API (tx hash, from, to, value, time, status).
Inputs: address (required), page, limit, network.
get_blockB
Get block by number or hash. Returns block number, hash, parentHash, timestamp, miner, gasUsed, gasLimit, transactions count or list.
Inputs: blockNumberOrHash (required), network, includeTransactions.
get_block_numberC
Get the current block number for the network.
Inputs: network.
get_block_rewardsC
Get block rewards and burns for a block via KaiaScan API (rewards and burns summary).
Inputs: blockNumber (required), network.
get_chain_infoB
Get chain info for the network: chainId, chain name, native currency. Uses getChain() and RPC getChainId().
Inputs: network.
get_contract_abiB
Get the ABI of a verified contract from KaiaScan. Path: GET /api/v1/contracts/:contractAddress/abi. Returns ABI JSON as text.
Inputs: contractAddress (required), network.
get_contract_sourceB
Get verified contract source code from KaiaScan. Path: GET /api/v1/contracts?contractAddresses=:address (contract info); if source is not available returns 'Unverified'.
Inputs: contractAddress (required), network.
get_gas_priceA
Get current gas price from the network. Returns gas price in peb, Gpeb (1e9 peb), and optionally KAIA per unit.
Inputs: network.
get_kaia_balanceB
Get KAIA balance for an address. Returns formatted KAIA and raw peb.
Inputs: address (required), network.
get_kaia_priceA
Get KAIA price in USD and other stats from KaiaScan. Path: GET /api/v1/kaia. Returns usd_price, btc_price, usd_price_changes (24h), market_cap, total_supply, volume.
Inputs: network.
get_nft_infoB
Get NFT collection metadata (name, symbol, total supply) by contract address. Uses KaiaScan Get Non Fungible Token (api/v1/nfts/:contractAddress).
Inputs: contractAddress (required), network.
get_nft_itemB
Get a single NFT item by contract and token ID (owner, tokenURI, metadata). Uses KaiaScan Get Nft Token Item (api/v1/nfts/:contractAddress/tokenids/:tokenId).
Inputs: tokenId (required), contractAddress (required), network.
get_nft_transfersC
Get NFT transfer history for a collection. Uses KaiaScan Get Transfers Of Non Fungible Token (api/v1/nfts/:contractAddress/transfers).
Inputs: contractAddress (required), page, size, network.
get_token_allowanceA
Get ERC-20/KIP-7 allowance: the amount a spender can transfer from an owner. Use for DeFi approvals (e.g. DEX, staking). Returns raw allowance and human-readable amount if decimals known.
Inputs: owner (required), spender (required), tokenAddress (required), network, +1 more.
get_token_holdersC
Get top holders of a fungible token. Uses KaiaScan Get Holders Of Fungible Token (api/v1/tokens/:contractAddress/holders).
Inputs: contractAddress (required), page, size, network.
get_token_infoB
Get fungible token metadata (name, symbol, decimals, total supply) by contract address. Uses KaiaScan Get Fungible Token (api/v1/tokens/:contractAddress).
Inputs: contractAddress (required), network.
get_token_transfersB
Get recent transfers of a fungible token. Uses KaiaScan Get Transfers Of Fungible Token (api/v1/tokens/:contractAddress/transfers).
Inputs: contractAddress (required), page, size, network.
get_transactionB
Get a human-readable summary of a transaction by hash (from, to, value, blockNumber, gas, gasPrice, input truncated).
Inputs: txHash (required), network.
get_transaction_receiptB
Get transaction receipt: status, blockNumber, gasUsed, contractAddress (if creation), logs count.
Inputs: txHash (required), network.
read_contractA
Read a view/pure contract function (no state change). Requires contract address, function name, and ABI (JSON string or array). Use get_contract_abi first if you do not have the ABI. Returns decoded result as readable text.
Inputs: abi (required), functionName (required), contractAddress (required), args, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools target distinct resources and actions, especially blocks, transactions, contracts, and NFTs. A few overlaps exist, such as get_kaia_balance vs. get_account_info (which also returns balance) and get_account_tokens vs. token metadata/holder tools, but descriptions usually clarify the boundaries.
The set mostly follows a snake_case prefix_verb/noun convention, especially with get_* tools. Minor deviations like read_contract, estimate_gas, and encode_function_data are semantically appropriate rather than confusing.
25 tools is on the heavy side for an MCP server, even though the Kaia blockchain domain is broad. The surface is usable but could likely be consolidated, especially around account, token, and contract queries.
The server covers a wide read-only surface: balances, accounts, tokens, NFTs, transactions, blocks, gas, contract ABI/source, and contract reads. Notable gaps include no send/broadcast transaction tool and no explicit event-log query, though these may be outside the intended read-only scope.
Maintenance
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Hosted MCP server for live public-data APIs and Skills for AI agents.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Related MCP Servers
- AlicenseCqualityCmaintenanceA comprehensive MCP server for tooling interactions(40+) and resource accessibility(60+) with Algorand blockchain, plus many useful prompts.100241 npm44MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables token listing, trading, and interaction with the Kaia blockchain via Claude Desktop.1Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA production-ready MCP server that wraps the Kxcoscan blockchain explorer API into structured endpoints for AI agents. It enables users to query wallet balances, transaction histories, token transfers, and contract details via natural language.-
- AlicenseAqualityBmaintenanceMCP server with 43 tools for blockchain data — token lookups, wallet balances, live chain queries across 10+ networks, and full API documentation search.27610 npmApache 2.0