Model Context Protocol server for Kaspa operations using WASM SDK. Enables LLMs to interact with the Kaspa network through standardized MCP tools.
- π Connect to different Kaspa networks (mainnet, testnet-10, devnet, simnet)
- π Wallet Management - Create, import, and manage HD wallets
- π° Balance Checking - Get balance and UTXO information
- π€ Send Transactions - Send KAS with optional payloads/messages
- π Fee Estimation - Calculate transaction fees
- π Address Validation - Validate Kaspa addresses
- π² Mnemonic Generation - Generate secure wallet mnemonics
npm run install-all
npm run buildThe MCP server supports several environment variables for configuration:
KASPA_DEFAULT_NETWORK: Default network to use (mainnet,testnet-10,devnet,simnet)KASPA_MAINNET_RPC_URL: Custom mainnet RPC endpointKASPA_TESTNET_RPC_URL: Custom testnet RPC endpointKASPA_LOG_LEVEL: Logging level (off,error,warn,info,debug,trace)
KASPA_WALLET_MNEMONIC: Preconfigured wallet mnemonic phrase (12-24 words)KASPA_WALLET_PRIVATE_KEY: Preconfigured wallet private key (hex format)
Security Note: Use environment variables to keep sensitive wallet credentials away from AI agents and conversation logs.
KASPA_DEFAULT_NETWORK=testnet-10
KASPA_TESTNET_RPC_URL=wss://photon-10.kaspa.red/kaspa/testnet-10/wrpc/borsh
KASPA_WALLET_MNEMONIC="your twelve word mnemonic phrase here for testnet use only"
KASPA_LOG_LEVEL=infoAdd to your MCP client configuration:
{
"mcpServers": {
"kaspa": {
"command": "node",
"args": ["/path/to/kaspa-mcp-server/dist/index.js"]
}
}
}Note: The configuration field name varies by MCP client:
- Claude Desktop: Use
"mcpServers" - Other MCP clients: May use
"servers"or"mcp_servers" - Custom implementations: Check your client's documentation for the correct field name
For secure operation with environment variables:
{
"mcpServers": {
"kaspa": {
"command": "node",
"args": ["/path/to/kaspa-mcp-server/dist/index.js"],
"env": {
"KASPA_WALLET_MNEMONIC": "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
"KASPA_DEFAULT_NETWORK": "testnet-10",
"KASPA_LOG_LEVEL": "info"
}
}
}
}Security Note: Replace the example mnemonic with your own wallet's mnemonic phrase. This keeps your wallet credentials secure and away from AI conversation logs.
npm run devConnect to a Kaspa network. This must be called first before using any wallet or transaction tools.
Parameters:
network(required): Network type (mainnet,testnet-10,devnet,simnet) - Usetestnet-10for testingrpcUrl(optional): Custom RPC endpointsessionId(optional): Session identifier (default:default)
Example:
{
"name": "kaspa_connect",
"arguments": {
"network": "testnet-10",
"sessionId": "my-session"
}
}Create or import a Kaspa wallet.
Parameters:
sessionId(optional): Session identifiermnemonic(optional): Import from mnemonic phraseprivateKey(optional): Import from private key
Example:
{
"name": "kaspa_create_wallet",
"arguments": {
"sessionId": "my-session"
}
}Get balance for a Kaspa address.
Parameters:
address(required): Kaspa address to checksessionId(optional): Session identifier
Example:
{
"name": "kaspa_get_balance",
"arguments": {
"address": "kaspa:qq..."
}
}Send a Kaspa transaction.
Parameters:
from(required): Sender addressto(required): Recipient addressamount(required): Amount in KAS (e.g., "1.5")priorityFee(optional): Priority fee in KASpayload(optional): Message/data to attachsessionId(optional): Session identifier
Example:
{
"name": "kaspa_send_transaction",
"arguments": {
"from": "kaspa:qq...",
"to": "kaspa:qr...",
"amount": "1.5",
"payload": "Payment for services"
}
}Estimate transaction fees.
Parameters:
from(required): Sender addressto(required): Recipient addressamount(required): Amount in KASsessionId(optional): Session identifier
Generate a new mnemonic phrase.
Parameters:
wordCount(optional): Number of words (12, 15, 18, 21, 24)
Validate a Kaspa address.
Parameters:
address(required): Address to validatenetwork(optional): Network for validation
Setup wallet using preconfigured credentials from environment variables.
Parameters:
sessionId(optional): Session identifier
Environment Variables Required:
KASPA_WALLET_MNEMONIC: 12-24 word mnemonic phraseKASPA_WALLET_PRIVATE_KEY: Private key in hex format
Example:
{
"name": "kaspa_setup_preconfigured_wallet",
"arguments": {}
}Get wallet information.
Parameters:
sessionId(optional): Session identifier
The server supports multiple concurrent sessions using sessionId parameters. Each session maintains its own:
- Network connection
- Wallet instance
- Configuration
- π Never log or expose private keys or mnemonics
- π Use testnet for development and testing
- πΎ Wallet credentials are kept in memory only (not persisted)
- π§Ή Resources are automatically cleaned up on server shutdown
- π Preconfigured Wallets: Use environment variables to keep sensitive credentials away from AI agents
β οΈ Environment Security: Ensure your .env files are not committed to version control
Default endpoints:
- Mainnet:
ws://seeder2.kaspad.net:17110β Public endpoint - Testnet-10:
wss://photon-10.kaspa.red/kaspa/testnet-10/wrpc/borshβ Public endpoint - Devnet:
ws://127.0.0.1:16610(requires local node) - Simnet:
ws://127.0.0.1:16510(requires local node)
- Mainnet addresses: Start with
kaspa:(e.g.,kaspa:qz...) - Testnet addresses: Start with
kaspatest:(e.g.,kaspatest:qr...) - Devnet addresses: Start with
kaspadev:(e.g.,kaspadev:qp...) - Simnet addresses: Start with
kaspasim:(e.g.,kaspasim:qq...)
All tools return structured error messages with:
- Error code (following MCP standards)
- Descriptive error message
- Context about the failure
- Connect to testnet:
{"name": "kaspa_connect", "arguments": {"network": "testnet-10"}}- Create a wallet:
{"name": "kaspa_create_wallet", "arguments": {}}- Check balance:
{"name": "kaspa_get_balance", "arguments": {"address": "kaspatest:qq..."}}- Send transaction:
{
"name": "kaspa_send_transaction",
"arguments": {
"from": "kaspatest:qq...",
"to": "kaspatest:qr...",
"amount": "0.1",
"payload": "Test transaction from MCP"
}
}When using the preconfigured wallet configuration (with environment variables in your MCP client config):
- Setup preconfigured wallet:
{"name": "kaspa_setup_preconfigured_wallet", "arguments": {}}- Get wallet info:
{"name": "kaspa_get_wallet_info", "arguments": {}}- Send transaction (no private keys exposed to AI):
{
"name": "kaspa_send_from_wallet",
"arguments": {
"to": "kaspatest:qr...",
"amount": "0.1",
"feePriority": "normal",
"payload": "Optional message"
}
}Benefits:
- π Secure: Private credentials never appear in AI conversation logs
- β‘ Fast: No need to manually connect or create wallets each time
- π Consistent: Same wallet used across sessions
- π‘οΈ Safe: Environment variables keep sensitive data away from AI agents
# Install all dependencies (workspace + nested packages)
npm run install-all
# Build everything (SDK first, then MCP server)
npm run build
# Development mode
npm run dev
# Run production server
npm start
# Clean build artifacts
npm run cleanMIT