casper-network
Production-ready Model Context Protocol (MCP) server for Casper Network blockchain
claude mcp add --transport stdio tairon-ai-casper-network-mcp node /path/to/casper-network-mcp/mcp/index.js \ --env PORT="8080" \ --env CASPER_API_KEY="your_api_key_from_cspr_cloud" \ --env CASPER_RPC_URL="https://node.cspr.cloud/rpc" \ --env CASPER_NETWORK_NAME="casper"
How to use
The Casper Network MCP Server provided here exposes a dual-server setup: an HTTP Express server for REST API access and an MCP stdio server that integrates with Claude Desktop for seamless AI-assisted interactions. It implements the MCP protocol 2024-11-05 and is tightly integrated with the Casper blockchain, offering a suite of blockchain tools such as wallet creation, balance checks, token transfers, and staking operations. You can access the REST endpoints for programmatic control and use the MCP stdio channel to interact with Claude Desktop for conversational prompts that drive on-chain actions. The included tools.js module exposes a collection of Casper-related commands (e.g., create_wallet, get_balance, transfer_cspr, delegate_stake, undelegate_stake, get_staking_rewards, get_validator_info) that can be invoked via a JSON-RPC interface. To start, configure your environment with a Casper API key and network endpoint, then run the HTTP server and the MCP stdio bridge to enable full capability.
How to install
Prerequisites:
- Node.js >= 18.0.0
- npm >= 9.0.0
- Access to a Casper Network API key from cspr.cloud
Installation steps:
- Clone the repository
git clone https://github.com/Tairon-ai/casper-network-mcp.git
cd casper-network-mcp
- Install dependencies
npm install
- Configure environment
cp .env.example .env
Note: In this MCP project, the environment variables required include CASPER_API_KEY, CASPER_RPC_URL, CASPER_NETWORK_NAME, and PORT. Populate them in the .env file or rely on the defaults if provided by the code. 4) Start the HTTP server
npm start
- Start the MCP stdio server for Claude Desktop integration
npm run mcp
- If you want to run via the MCP config, ensure the path to the MCP entry script is correct in your mcp_config and start your process manager or run the node command accordingly.
Optional: Run production optimizations
NODE_ENV=production npm start
Additional notes
Environment variables and security:
- Never commit .env files or private keys to version control.
- Store sensitive data (API keys, private keys) in environment variables and use access-controlled secret managers in production.
- The server operates on Casper mainnet; exercise caution with real CSPR tokens.
- Validate all public keys, addresses, and amounts before processing transactions.
- If using Docker, ensure the environment file (.env) is mounted and accessible inside the container.
- The MCP tools expose powerful operations (wallet creation, transfers, and staking); implement proper access controls when exposing these via HTTP endpoints.
Related MCP Servers
any-chat-completions
MCP Server for using any LLM as a Tool
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities
midnight
Midnight MCP server giving AI assistants access to Midnight blockchain — search contracts, analyze code, explore docs
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
website-publisher
AI Website builder and publisher MCP. Quickly publish and deploy your AI generated code as real website URL. Support html, css, js, python etc.
xgmem
Global Memory MCP server, that manage all projects data.