Nexus MCP is a powerful multi-chain protocol agent platform that enables seamless interaction with various blockchain networks. This documentation will guide you through the setup and usage of the platform.
Install Nexus MCP using pip:
pip install nexusmcp
Or using Poetry:
poetry add nexusmcp
Create a configuration file with your network settings:
{
"networks": {
"ethereum": {
"rpc_url": "https://mainnet.infura.io/v3/YOUR-PROJECT-ID",
"chain_id": 1
},
"polygon": {
"rpc_url": "https://polygon-rpc.com",
"chain_id": 137
}
}
}
The ProtocolAwareAgent is the core component for managing cross-chain operations:
from nexusmcp.agents import ProtocolAwareAgent
agent = ProtocolAwareAgent(
agent_id="my-agent",
config=config
)
# Initialize the agent
await agent.initialize()
# Find optimal route
route = await agent.find_optimal_route(
source_chain="ethereum",
target_chain="polygon",
amount=1000
)
# Execute cross-chain operation
result = await agent.execute_cross_chain_operation(route)
The Web3Manager provides a unified interface for blockchain interactions:
from nexusmcp.integrations.web3 import Web3Manager
manager = Web3Manager(config)
await manager.initialize()
# Get balance
balance = await manager.get_balance("ethereum", "0x...")
# Send transaction
tx = await manager.send_transaction(
chain="ethereum",
to="0x...",
value=1000
)
Monitor protocol health and performance:
health_status = await agent.monitor_protocol_health()
print(f"Protocol Health: {health_status}")
initialize()
- Initialize the agentfind_optimal_route()
- Find the best cross-chain routeexecute_cross_chain_operation()
- Execute a cross-chain operationmonitor_protocol_health()
- Monitor protocol healthget_balance()
- Get account balancesend_transaction()
- Send blockchain transactionget_contract()
- Get contract instance