An MCP server that provides seamless integration with the Neo N3 blockchain, allowing Claude to interact with blockchain data, manage wallets, transfer assets, and invoke smart contracts.
https://mainnet1.neo.coz.io:443
https://testnet1.neo.coz.io:443
You can easily add the Neo N3 MCP server to your Claude MCP configuration in different ways:
Add this to your claude_desktop_config.json
or MCP settings:
{
"mcpServers": {
"neo-n3": {
"command": "npx",
"args": ["-y", "@r3e/neo-n3-mcp"]
}
}
}
Add this to your claude_desktop_config.json
or MCP settings:
{
"mcpServers": {
"neo-n3": {
"command": "docker",
"args": ["run", "--rm", "-i", "r3e/neo-n3-mcp"]
}
}
}
To build the Docker image locally:
docker build -t r3e/neo-n3-mcp .
# Clone the repository
git clone https://github.com/R3E-Network/neo-n3-mcp.git
cd neo-n3-mcp
# Start the server with Docker Compose
docker-compose up -d
# Clone the repository
git clone https://github.com/R3E-Network/neo-n3-mcp.git
cd neo-n3-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
To add the Neo N3 MCP server to your MCP settings, you can use the provided script:
# Build the project first
npm run build
# Add to MCP settings
npm run add-to-mcp
The server can be configured using environment variables:
NEO_RPC_URL
: Default URL of the Neo N3 RPC node (default: https://mainnet1.neo.coz.io:443
)NEO_MAINNET_RPC_URL
: URL of the Neo N3 mainnet RPC node (default: same as NEO_RPC_URL
or https://mainnet1.neo.coz.io:443
)NEO_TESTNET_RPC_URL
: URL of the Neo N3 testnet RPC node (default: https://testnet1.neo.coz.io:443
)NEO_NETWORK
: Default network type: 'mainnet' or 'testnet' (default: mainnet)WALLET_PATH
: Path to the wallet files (default: ./wallets
)LOG_LEVEL
: Log level: 'debug', 'info', 'warn', 'error' (default: info)LOG_CONSOLE
: Whether to log to console (default: true)LOG_FILE
: Whether to log to file (default: false)LOG_FILE_PATH
: Path to log file (default: ./logs/neo-n3-mcp.log
)MAX_REQUESTS_PER_MINUTE
: Maximum number of requests per minute (default: 60)REQUIRE_CONFIRMATION
: Whether to require confirmation for sensitive operations (default: true)All tools now support an optional network
parameter to specify which network to use ('mainnet' or 'testnet').
Get general information about the Neo N3 blockchain.
{
"name": "get_blockchain_info",
"arguments": {
"network": "testnet"
}
}
Get block details by height or hash.
{
"name": "get_block",
"arguments": {
"hashOrHeight": 12345,
"network": "mainnet"
}
}
Get transaction details by hash.
{
"name": "get_transaction",
"arguments": {
"txid": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"network": "testnet"
}
}
Get account balance for a specific address.
{
"name": "get_balance",
"arguments": {
"address": "NXV7ZhHiyM1aHXwvUNBLNAkCwZ6wgeKyMZ",
"network": "mainnet"
}
}
Transfer assets between addresses.
{
"name": "transfer_assets",
"arguments": {
"fromWIF": "KwDZGCUXYAB1cUNmZKQ5RFUBAYPjwXvpavQQHvpeH1qM5pJ3zurn",
"toAddress": "NXV7ZhHiyM1aHXwvUNBLNAkCwZ6wgeKyMZ",
"asset": "NEO",
"amount": "1",
"confirm": true,
"network": "testnet"
}
}
Invoke a smart contract method.
{
"name": "invoke_contract",
"arguments": {
"fromWIF": "KwDZGCUXYAB1cUNmZKQ5RFUBAYPjwXvpavQQHvpeH1qM5pJ3zurn",
"scriptHash": "0x8c23f196d8a1bfd103a9dcb1f9ccf0c611377d3b",
"operation": "transfer",
"args": [
{
"type": "Hash160",
"value": "NXV7ZhHiyM1aHXwvUNBLNAkCwZ6wgeKyMZ"
},
{
"type": "Hash160",
"value": "NXV7ZhHiyM1aHXwvUNBLNAkCwZ6wgeKyMZ"
},
{
"type": "Integer",
"value": "1"
},
{
"type": "Any",
"value": null
}
],
"confirm": true,
"network": "testnet"
}
}
Create a new wallet.
{
"name": "create_wallet",
"arguments": {
"password": "your-secure-password",
"network": "mainnet"
}
}
Import an existing wallet from WIF or encrypted key.
{
"name": "import_wallet",
"arguments": {
"key": "KwDZGCUXYAB1cUNmZKQ5RFUBAYPjwXvpavQQHvpeH1qM5pJ3zurn",
"password": "your-secure-password",
"network": "testnet"
}
}
Default network (based on configuration):
neo://network/status
Specific networks:
neo://mainnet/status
neo://testnet/status
Default network:
neo://block/{height}
Specific networks:
neo://mainnet/block/{height}
neo://testnet/block/{height}
Default network:
neo://address/{address}/balance
Specific networks:
neo://mainnet/address/{address}/balance
neo://testnet/address/{address}/balance
The Neo N3 MCP server includes comprehensive tests to ensure its functionality. There are two primary ways to run tests:
Jest tests provide comprehensive testing with proper mocking:
# Install dependencies first
npm install
# Run Jest tests
npm test
A simplified JavaScript test runner is also available for quick testing:
# Run the simplified test
node tests/simple-test.js
To publish the package to NPM and/or Docker registries:
# Publish to NPM
npm run publish:npm
# Build and publish Docker image
npm run publish:docker
# Publish to both
npm run publish:all
For development, use:
# Build with TypeScript watching
npm run dev
The Neo N3 MCP server is structured around several key components:
src/index.ts
- Handles MCP protocol communication.src/services/neo-service.ts
- Core Neo N3 blockchain interactions.src/utils/validation.ts
- Parameter validation.src/utils/error-handler.ts
- Standardized error responses.Errors are standardized through the handleError
function which:
The server automatically handles network retries and errors when connecting to the Neo N3 blockchain network. Connection parameters like timeouts and retry attempts can be configured through environment variables.
The project is organized as follows:
neo-n3-mcp/
├── src/
│ ├── services/
│ │ └── neo-service.ts # Core Neo N3 blockchain interaction
│ ├── utils/
│ │ ├── validation.ts # Input validation
│ │ └── error-handler.ts # Error handling and responses
│ ├── config.ts # Configuration settings
│ └── index.ts # MCP server and tool definitions
├── tests/
│ ├── neo-service.test.ts # Jest tests for NeoService
│ └── simple-test.js # Simple JavaScript test runner
├── scripts/
│ ├── add-to-mcp-settings.js # Script to add to MCP settings
│ ├── publish-npm.js # Script to publish to NPM
│ └── publish-docker.sh # Script to build and publish Docker image
├── wallets/ # Wallet storage directory
├── dist/ # Compiled TypeScript output
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker container definition
├── package.json # Node.js package definition
└── tsconfig.json # TypeScript configuration
This project would not be possible without the following:
This MCP server is licensed under the MIT License. See the LICENSE file for details.
The Neo N3 MCP Server now includes support for interacting with famous Neo N3 contracts like:
list_famous_contracts
: List all supported famous Neo N3 contracts.get_contract_info
: Get details about a specific famous contract.neofs_create_container
: Create a storage container in NeoFS.neofs_get_containers
: Get containers owned by an address.neoburger_deposit
: Deposit NEO to NeoBurger to receive bNEO tokens.neoburger_withdraw
: Withdraw NEO from NeoBurger by returning bNEO tokens.neoburger_get_balance
: Get bNEO balance of an account.neoburger_claim_gas
: Claim accumulated GAS rewards from NeoBurger.flamingo_stake
: Stake FLM tokens on Flamingo.flamingo_unstake
: Unstake FLM tokens from Flamingo.flamingo_get_balance
: Get FLM token balance.neocompound_deposit
: Deposit assets into NeoCompound.neocompound_withdraw
: Withdraw assets from NeoCompound.neocompound_get_balance
: Get balance of deposited assets in NeoCompound.grandshare_deposit
: Deposit assets into GrandShare pool.grandshare_withdraw
: Withdraw assets from GrandShare pool.grandshare_get_pool_details
: Get details about a GrandShare pool.ghostmarket_create_nft
: Create a new NFT on GhostMarket.ghostmarket_list_nft
: List an NFT for sale on GhostMarket.ghostmarket_buy_nft
: Buy a listed NFT on GhostMarket.ghostmarket_get_token_info
: Get information about an NFT on GhostMarket.const result = await callTool('list_famous_contracts', {
network: 'mainnet'
});