# OKLink MCP

> OKLink Multi-chain Web3 Blockchain Data API connects your AI agent to real-time blockchain data across dozens of networks like Bitcoin, Ethereum, and BSC. You can query everything: get a wallet summary, trace full transaction histories, list all tokens on a chain, or check the latest block details instantly. It gives your agent instant access to structured on-chain intelligence without manual explorer searching.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** web3-data, multi-chain, blockchain-explorer, crypto-api, on-chain-analysis

## Description

This server connects your AI client directly to **real-time blockchain data** across dozens of networks, including Ethereum, Bitcoin, and BSC. It gives your agent the full ability to query structured on-chain intelligence without needing a manual explorer search.

To start, you'll use `get_supported_chains` to check exactly which blockchains we can access; that’s always good to know first. You can then grab general metadata about any supported network using `get_chain_info`.

### Tracking Addresses and Accounts

If you need a quick read on an address, you've got two options: run `get_address_summary` for a high-level overview that gives you the current balance, total transactions count, and general activity metrics. For a deep dive, use `get_address_transactions`; this pulls a full, chronological list of every single transaction ever linked to that specific wallet or contract address.

### Analyzing Tokens and Assets

The token tools let your agent investigate asset movements thoroughly. To see which tokens exist on a chain, you run `get_token_list`. You can then get detailed metrics—like the contract and full specs—for any type of token using `get_token_detail`. If you want to know how much of a specific token an address holds, you'll use `get_token_balance`.

For NFTs, if you know the collection contract, run `get_nft_collection_info`; this pulls all the metadata and details about that particular NFT set. 

### Inspecting Blocks and Transactions

When it comes to block data, your agent can check for the most recent activity by using `get_latest_block` on any supported chain. If you need granular specifics, running `get_block_detail` retrieves detailed information about a specific **block hash**, including its timestamp and who mined it. To see every transaction that made it into a block, use `get_block_transactions`, which gives you a list of all the associated transaction hashes.

Finally, if your agent finds a specific transaction hash, it can analyze the whole thing using `get_transaction_detail`. This function provides the full payload and status details for that single transaction, letting you see the gas cost, who sent it, and where it went. You'll also find that getting all historical or current transactions linked to an address is handled by `get_address_transactions`.

This suite of tools lets your AI client analyze everything from general wallet activity using `get_address_summary`, to tracing the full life cycle of a single token with `get_token_balance`, making it the definitive source for on-chain intelligence.

## Tools

### get_address_summary
Pulls a high-level summary (balance, total transactions) for any given blockchain address.

### get_address_transactions
Lists all historical and current transactions linked to a specific blockchain address.

### get_block_detail
Retrieves detailed information about any specified block hash on the chain.

### get_block_transactions
Gets a list of all transaction hashes that were included within a specific block.

### get_chain_info
Provides detailed metadata about a particular supported blockchain network.

### get_latest_block
Fetches the most recently mined block data for any specified chain.

### get_nft_collection_info
Retrieves metadata and details about a specific NFT collection contract.

### get_supported_chains
Returns a list and summary of all blockchains currently supported by the server.

### get_token_balance
Checks the balance amount for a specific token held at an address.

### get_token_detail
Gets detailed information, including contract and metrics, for any specified token type.

### get_token_list
Retrieves a list of all available tokens on a specific blockchain network.

### get_transaction_detail
Provides the full payload and status details for a single, specified transaction hash.

## Prompt Examples

**Prompt:** 
```
Show me the balance and transaction summary for address 0x742d35Cc6634C0532925a3b844Bc454e4438f44e on Ethereum.
```

**Response:** 
```
I've retrieved the summary for that Ethereum address. It currently holds 12.5 ETH with a total of 150 transactions. Would you like to see the latest transaction history or specific token balances?
```

**Prompt:** 
```
What is the latest block height on the Polygon network?
```

**Response:** 
```
The latest block on Polygon (MATIC) is at height 64,231,890. It was mined a few seconds ago. Do you want to inspect the transactions included in this block?
```

**Prompt:** 
```
Get the details for transaction 0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22026 on Ethereum.
```

**Response:** 
```
Analyzing transaction... This was a transfer of 500 USDC from 0x... to 0x... confirmed in block 18,402,100. The status is 'Success' and the gas fee was 0.002 ETH.
```

## Capabilities

### Analyze Wallet Status
Get an address summary that includes current balances, total transaction counts, and general activity metrics.

### Trace Address History
Pull a full, chronological list of every transaction associated with a specific wallet or contract address.

### Monitor Network Activity
Retrieve the latest block details for any supported blockchain network.

### Investigate Token Flows
Get detailed token metrics, check specific token balances at an address, or list all tokens available on a chain.

### Examine Block Data
Inspect granular information about any given block hash, including its timestamp and miner details.

### Detail Specific Transactions
Analyze a single transaction hash to see its status, gas cost, sender, and recipient addresses.

## Use Cases

### Auditing a Smart Contract's Funds
A developer needs to know if a contract address (0x...) was funded by specific tokens. They first call `get_token_list` for the chain, then use `get_address_summary` on the contract to confirm balances, and finally run `get_transaction_detail` using recent transaction hashes to trace the exact inflow event.

### Monitoring a New Protocol Launch
A quant wants to know which chains are active. They start by calling `get_supported_chains`. Once they target Polygon, they use `get_latest_block` to see the current activity height and then run `get_block_transactions` to spot suspicious or unusual transaction patterns.

### Verifying an NFT Sale
A user wants proof of purchase for a rare digital asset. They first call `get_nft_collection_info` for the collection, then use `get_address_transactions` on their own wallet to pull the sale transaction hash, and finally run `get_transaction_detail` to confirm the transfer details.

### Debugging Token Ownership
A user suspects an address has tokens that aren't showing up. They call `get_token_list` for the relevant chain, identify the missing token contract, and then use `get_token_balance` to confirm if the balance exists at all.

## Benefits

- Analyze Addresses: Use `get_address_summary` to instantly see a wallet's total activity and balance without querying transaction lists first. It saves multiple steps on the data pipeline.
- Track Full History: Instead of just seeing the latest block, use `get_block_transactions` to pull every hash in that block, then run `get_transaction_detail` on each one for a complete picture.
- Token Visibility: The combination of `get_token_list` and `get_token_balance` lets you programmatically know what assets exist on a chain and how much an address holds of them. No more guessing the asset type.
- Multi-Chain Scope: By calling `get_supported_chains`, your agent knows exactly which chains it can query, making the system robust enough for any cross-chain analysis task you throw at it.
- NFT Specifics: Use `get_nft_collection_info` to pull metadata on specific collections. This is critical when building tools that track digital asset ownership and provenance.

## How It Works

The bottom line is you get structured, multi-chain blockchain data instantly without writing boilerplate API calls yourself.

1. Subscribe to this server and provide your OKLink API Key (Access Key).
2. Instruct your AI agent to call a specific function, passing required parameters like an address or chain ID.
3. The tool executes the on-chain query and returns clean, structured data directly back to your client.

## Frequently Asked Questions

**How do I get a full history of an address using get_address_transactions?**
Calling `get_address_transactions` pulls all historical transaction hashes for that address. You can then pass those hashes into `get_transaction_detail` to see the payload and status of each one.

**What is the difference between get_latest_block and get_block_detail?**
`get_latest_block` only retrieves the most recent block's metadata. Use `get_block_detail` when you already know a specific hash and need to inspect all its contents, like timestamps or miner details.

**Can I check token balances for multiple networks with get_token_balance?**
You must specify the network context in your prompt. While `get_supported_chains` lists available networks, you need to run `get_token_balance` separately for each chain and token type.

**Do I need get_nft_collection_info for every NFT asset?**
Yes, if you want collection metadata (like the contract or total supply), use `get_nft_collection_info`. This provides context beyond just checking the ownership record.

**What credentials do I need to use the `get_address_summary` tool?**
You must provide your unique OKLink API Key when connecting the MCP Server. This key authorizes every single call, so make sure you store it securely within your client environment.

**If I pass an invalid hash to `get_transaction_detail`, what error will my agent receive?**
The server returns a clear 'Not Found' status. This tells your AI client immediately that the specific transaction ID doesn't exist on any supported chain, saving you guesswork.

**Are there rate limits when using the `get_token_list` tool across multiple chains?**
Yes, standard API rate limits apply. If your agent makes too many calls in quick succession, it will hit a 429 error. It's best to space out large batches of token lookups.

**When I use `get_chain_info`, what core metadata can I retrieve about a blockchain?**
You get the chain’s name, native currency symbol, and total supply details. This helps your agent validate if the network is fully active or limited in scope.

**How do I check the balance of a specific wallet address?**
You can use the `get_address_summary` tool by providing the chain name (e.g., 'eth') and the address. For a detailed list of all token holdings, use the `get_token_balance` tool.

**Can I retrieve information about NFT collections?**
Yes! Use the `get_nft_collection_info` tool with the chain name and the NFT contract address to fetch metadata and collection details.

**How do I find the latest block on a specific blockchain?**
Simply use the `get_latest_block` tool and specify the chain (e.g., 'btc', 'eth', 'polygon'). It will return the height and details of the most recently mined block.