# Conflux MCP

> Conflux queries both Core Space and eSpace network data, allowing you to audit accounts, inspect block hashes, and track transactions directly from your AI agent. Get CFX balances, check account states, or calculate gas requirements for any contract on the Conflux chain without leaving your IDE.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** conflux, web3, smart-contracts, blockchain-explorer, crypto-infrastructure

## Description

You can interact with the entire Conflux ecosystem—both Core Space and eSpace—using plain language prompts. Forget opening multiple browser tabs just to check a balance or debug a smart contract call. This MCP provides direct access to crucial network data, letting you audit account states and monitor transaction flow for any address. Need to know what gas costs an operation? You can calculate that before sending anything. Want to see the full details of a block using its hash? It's right here. Everything flows through your AI client, pulling raw blockchain data into your conversation. If you’re already using Vinkius for other services, adding this MCP means all your smart contract and network queries are in one place.

## Tools

### cfx_get_account
Provides a high-level summary of the current state of an account in Core Space.

### cfx_get_balance
Retrieves the exact CFX balance for a specified address on Core Space.

### cfx_get_best_block_hash
Finds and returns the hash of the block that currently has the highest network weight.

### cfx_get_block_by_epoch_number
Retrieves all the detailed data for a specific block using its epoch number on Core Space.

### cfx_get_block_by_hash
Gets full block details directly when you provide the unique hash in Core Space.

### cfx_get_blocks_by_epoch
Lists all available block hashes that belong to a particular epoch on Core Space.

### cfx_call
Runs a read-only contract call on Core Space to see what the code does without changing anything.

### cfx_client_version
Fetches and reports the current version number of the Conflux Core client running on the node.

### cfx_estimate_gas_and_collateral
Calculates how much gas and storage collateral you'll need for a transaction on Core Space before you send it.

### cfx_get_logs
Searches and retrieves specific logs from Core Space based on defined filters.

### cfx_get_next_nonce
Checks what the next available transaction number (nonce) is for a specified account in Core Space.

### cfx_send_raw_transaction
Sends an already signed (pre-signed) raw transaction to the Core Space network immediately.

### cfx_send_transaction
Submits a standard, unsigned transaction request to the Core Space network for processing.

### cfx_get_sponsor_info
Gets details on gas and storage sponsorship arrangements for smart contracts running on Core Space.

### cfx_get_status
Checks the current operational status of the Conflux Core node, telling you if it's synchronized or having issues.

### cfx_get_transaction_by_hash
Retrieves all details about a single transaction using its unique hash on Core Space.

### cfx_get_transaction_receipt
Gets the full receipt for a specific transaction, showing if it succeeded and how much gas was used in Core Space.

### eth_get_balance
Retrieves the current balance of a specified address within the eSpace network.

### eth_get_block_by_number
Gets block details for eSpace by simply providing its sequential block number.

### eth_call
Runs a read-only contract call on eSpace, simulating execution without spending any gas or changing data.

### eth_estimate_gas
Calculates the estimated gas cost required for an operation on the eSpace network.

### eth_get_logs
Searches and filters logs from the eSpace network based on specific criteria.

### eth_send_raw_transaction
Sends an already signed (pre-signed) raw transaction directly to the eSpace network.

### eth_get_transaction_count
Checks the number of transactions (nonce) that have already occurred for an address in eSpace.

### eth_get_transaction_receipt
Retrieves the full receipt for a transaction executed on the eSpace network.

## Prompt Examples

**Prompt:** 
```
What is the current status and client version of the Conflux node?
```

**Response:** 
```
I've checked the node. The current epoch is 124,502,312 and the client version is 'conflux-rust/v2.3.0'. The network is currently stable and synchronized.
```

**Prompt:** 
```
Check the balance and account state for address cfx:aak2rra2njvd77ezwjvx74749399393939393939.
```

**Response:** 
```
The account has a balance of 1,250.45 CFX. The next available nonce is 42, and the account is currently active in the staking system.
```

**Prompt:** 
```
Get the details of the block with hash 0x8e5f... and include full transactions.
```

**Response:** 
```
I've retrieved block 0x8e5f... It contains 12 transactions. Notable transactions include a contract call to the 'Sponsor' system and several CFX transfers. Would you like to inspect a specific transaction receipt?
```

## Capabilities

### Audit Account Status
Get the current CFX balance, next nonce, and full state summary for any address on Core Space or eSpace.

### Inspect Network Health
Retrieve real-time node status, client versions, and identify the block with the highest weight across the network.

### Analyze Block Details
Fetch detailed information about blocks using either their hash or an epoch number for deep inspection.

### Track Transaction Flow
Retrieve transaction receipts, execution logs, and specific transaction details by hash to debug on-chain activity.

### Calculate Costs & Send Data
Estimate gas and collateral for transactions, or send raw, pre-signed transactions directly to the network.

## Use Cases

### Investigating a Failed Smart Contract Call
A developer sees an unexpected failure. Instead of manually fetching logs and receipts, they ask their agent to run `cfx_get_transaction_by_hash` first, then check the detailed receipt using `cfx_get_transaction_receipt`. The agent instantly identifies whether the issue was insufficient gas or a contract logic error.

### Comparing Core vs. eSpace Data
A researcher needs to compare balances across two networks. They prompt their agent to run `cfx_get_balance` for an address on Core Space, and immediately follow up by asking the same thing for eSpace using `eth_get_balance`. The results appear side-by-side in one chat window.

## Benefits

- You stop having to jump between block explorers. By using `cfx_get_account`, you get a full state summary directly in your conversation, allowing immediate verification of an account's worth and current status.
- The gas estimation process is simplified. Instead of manually calculating potential costs, running `cfx_estimate_gas_and_collateral` gives you the exact required collateral before you ever attempt to send a transaction.
- Debugging failed smart contract calls gets easier. You can run a read-only simulation using `eth_call` on eSpace or check execution logs with `cfx_get_logs`, pinpointing exactly where the logic broke down.
- Monitoring network health is instant. Need to know if the node is online? Use `cfx_get_status`. It's a single prompt that gives you everything from client version (`cfx_client_version`) to synchronization status.
- Sending transactions becomes safer. You can check the next nonce with `cfx_get_next_nonce` and then use `cfx_send_transaction`, knowing your account hasn't been double-spent because of stale data.

## How It Works

The bottom line is, your AI client handles all the complex API calls and formatting so you just get an answer.

1. First, subscribe to this MCP and provide your Conflux Core and eSpace RPC URLs.
2. Next, prompt your AI client with a specific request, like 'What is the balance for address X?'
3. Your agent invokes the necessary tool (e.g., `cfx_get_balance`), retrieving raw blockchain data that it then presents to you in natural language.

## Frequently Asked Questions

**How do I check the balance of an address on Core Space? (cfx_get_balance)**
You run `cfx_get_balance` and provide the target address. The MCP returns the current CFX amount for that account directly in your chat.

**Is there a way to see if a transaction will fail before I send it? (eth_estimate_gas)**
Yes, use `eth_estimate_gas`. This function calculates the required gas and collateral for an eSpace operation so you can verify costs without making a real change.

**Can I get all block details by epoch number? (cfx_get_block_by_epoch_number)**
Yes, `cfx_get_block_by_epoch_number` lets you pull the full data set for a specific time slice of blocks on Core Space. This is great for deep historical analysis.

**How do I debug transaction failures? (cfx_get_transaction_receipt)**
Run `cfx_get_transaction_receipt` with the hash. It gives you the full receipt, letting you see if the transaction failed and why it couldn't complete.

**How do I check the current operational status and client version using cfx_get_status?**
Running `cfx_get_status` provides immediate node details. This tool returns the current epoch number, synchronization state, and the specific Conflux Core client version in one call, confirming network health.

**What is the proper procedure for sending a pre-signed transaction using cfx_send_raw_transaction?**
You must use `cfx_send_raw_transaction` when you've generated and signed the data externally. This method bypasses needing the node to manage the sender account keys directly, giving you granular control.

**Before I submit a transaction, how do I get the next available nonce for an address using cfx_get_next_nonce?**
First, call `cfx_get_next_nonce` to confirm the account's current sequence number. You must use this exact nonces value when constructing your signed transaction payload to ensure validity.

**How can I filter specific event logs or data from Core Space using cfx_get_logs?**
You can use `cfx_get_logs` and specify a filter based on the target address, contract signature, or topic. This helps isolate exactly which data packets were emitted during a complex smart contract execution.

**How can I check the CFX balance of a specific Core Space address?**
Use the `cfx_get_balance` tool by providing the Conflux address. You can also optionally specify an epoch (like 'latest_state') to get the balance at a specific point in time.

**Can I see if a smart contract has gas or storage sponsorship?**
Yes! The `cfx_get_sponsor_info` tool returns the sponsorship details for any target contract address, showing who is covering the costs for users interacting with it.

**How do I get the latest state of the Conflux Core network?**
Run the `cfx_get_status` tool. It provides the current epoch number, block height, chain ID, and other essential metrics about the node's synchronization state.