Documentation

Nexus MCP Documentation

Getting Started

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.

Installation

Install Nexus MCP using pip:

pip install nexusmcp

Or using Poetry:

poetry add nexusmcp

Configuration

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
    }
  }
}

Protocol Agent

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)

Web3 Integration

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
)

Monitoring

Monitor protocol health and performance:

health_status = await agent.monitor_protocol_health()
print(f"Protocol Health: {health_status}")

API Reference

ProtocolAwareAgent

  • initialize() - Initialize the agent
  • find_optimal_route() - Find the best cross-chain route
  • execute_cross_chain_operation() - Execute a cross-chain operation
  • monitor_protocol_health() - Monitor protocol health

Web3Manager

  • get_balance() - Get account balance
  • send_transaction() - Send blockchain transaction
  • get_contract() - Get contract instance