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 ServerWhat'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
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
- UnifAPIOAuthcom.unifapi
Hosted MCP server for live public-data APIs and Skills for AI agents.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
One AI endpoint to search and call 22k+ MCP servers; 50+ hosted tools work instantly, no key.
Related MCP Servers
- AlicenseCqualityBmaintenanceA comprehensive MCP server for tooling interactions(40+) and resource accessibility(60+) with Algorand blockchain, plus many useful prompts.10052 npm44MIT
- AlicenseNot gradedqualityCmaintenanceAn 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.27723 npmApache 2.0