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"
]
}
}
}
This will automatically download and run the Neo N3 MCP server without any local installation.
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
This will automatically add the Neo N3 MCP server to your Claude MCP settings file, making it available for use with Claude.
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
The test suite includes tests for:
A simplified JavaScript test runner is also available for quick testing:
# Run the simplified test
node tests/simple-test.js
This test covers the core API functionality without requiring TypeScript compilation.
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 communicationsrc/services/neo-service.ts
- Core Neo N3 blockchain interactionssrc/utils/validation.ts
- Parameter validationsrc/utils/error-handler.ts
- Standardized error responsesErrors 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 contractsget_contract_info
: Get details about a specific famous contractneofs_create_container
: Create a storage container in NeoFSneofs_get_containers
: Get containers owned by an addressneoburger_deposit
: Deposit NEO to NeoBurger to receive bNEO tokensneoburger_withdraw
: Withdraw NEO from NeoBurger by returning bNEO tokensneoburger_get_balance
: Get bNEO balance of an accountneoburger_claim_gas
: Claim accumulated GAS rewards from NeoBurgerflamingo_stake
: Stake FLM tokens on Flamingoflamingo_unstake
: Unstake FLM tokens from Flamingoflamingo_get_balance
: Get FLM token balanceneocompound_deposit
: Deposit assets into NeoCompoundneocompound_withdraw
: Withdraw assets from NeoCompoundneocompound_get_balance
: Get balance of deposited assets in NeoCompoundgrandshare_deposit
: Deposit assets into GrandShare poolgrandshare_withdraw
: Withdraw assets from GrandShare poolgrandshare_get_pool_details
: Get details about a GrandShare poolghostmarket_create_nft
: Create a new NFT on GhostMarketghostmarket_list_nft
: List an NFT for sale on GhostMarketghostmarket_buy_nft
: Buy a listed NFT on GhostMarketghostmarket_get_token_info
: Get information about an NFT on GhostMarketconst result = await callTool('list_famous_contracts', {
network: 'mainnet'
});
const result = await callTool('get_contract_info', {
contractName: 'flamingo',
network: 'mainnet'
});
const result = await callTool('neoburger_deposit', {
fromWIF: 'your-private-key-wif-format',
confirm: true,
network: 'mainnet'
});
const result = await callTool('flamingo_stake', {
fromWIF: 'your-private-key-wif-format',
amount: '100',
confirm: true,
network: 'mainnet'
});
const result = await callTool('neocompound_deposit', {
walletPath: '/path/to/wallet.json',
walletPassword: 'your-password',
assetId: '0xd2a4cff31913016155e38e474a2c06d08be276cf',
amount: '100',
network: 'mainnet'
});
const result = await callTool('ghostmarket_create_nft', {
walletPath: '/path/to/wallet.json',
walletPassword: 'your-password',
tokenURI: 'https://example.com/nft/metadata.json',
properties: [
{ key: "artist", value: "ExampleArtist" },
{ key: "edition", value: "1/1" }
],
network: 'mainnet'
});
const result = await callTool('grandshare_get_pool_details', {
poolId: 1,
network: 'mainnet'
});
{
"mcpServers": {
"neo-n3": {
"env": {},
"args": [
"-y",
"@r3e/neo-n3-mcp"
],
"command": "npx"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.