# Bitquery MCP for AI Agents AI Agent Connect

> Bitquery MCP lets you pull real-time and historical blockchain data from over 40 chains like Ethereum, Solana, and Bitcoin. It gives your agent the ability to query complex on-chain events, DEX trades, and smart contract interactions using a unified GraphQL interface.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_KU35mdsrfwl05byKZplozxH5s4oOqPEODwO2ZR75/ai-agent-connect
- **Tags:** graphql, web3, ethereum, solana, bitcoin, defi-analytics, on-chain-data

## Description

Getting solid data off the blockchain usually means juggling dozens of different nodes and RPC endpoints. This Connector changes that by giving your agent a single point of entry for data across 40+ chains. Instead of worrying about infrastructure, you can just ask your agent to pull specific metrics, and it'll handle the heavy lifting of querying the right blockchain. Whether you're digging into old transaction history or monitoring live DEX trades, it brings all those disparate data points into one place. It's a huge time saver for anyone who needs to move past just looking at a block explorer and into actual data analysis. You can find this and thousands of other tools in the Vinkius catalog to build out your agent's capabilities quickly. You get a clean way to analyze liquidity, track token performance, and inspect smart contract calls without the headache of managing your own backend.

## Tools

### query_v1
Execute a GraphQL query against the Bitquery V1 Historical API to pull older blockchain data.

### query_v2
Run advanced GraphQL queries on the V2 Streaming API to get live transfers, calls, and DEX trades.

### generate_token
Create an OAuth2 access token using your Client ID and Secret for secure, automated connections.

## Prompt Examples

**Prompt:** 
```
What were the biggest trades on Uniswap in the last hour?
```

**Response:** 
```
### Recent Uniswap V3 Trades

| Token | Volume (USD) | Price Impact |
| :--- | :--- | :--- |
| **USDC** | $45,200 | 0.15% |
| **ETH** | $12,100 | 0.08% |
| **PEPE** | $8,400 | 1.2% |

*Note: These are the top 3 trades fetched from the real-time stream.*
```

**Prompt:** 
```
Find the last 5 blocks on the Bitcoin network.
```

**Response:** 
```
I've pulled the latest Bitcoin block data for you:

*   **Block #834291**: 3,421 transactions
*   **Block #834290**: 2,890 transactions
*   **Block #834289**: 3,105 transactions
*   **Block #834288**: 2,450 transactions
*   **Block #834287**: 3,002 transactions
```

**Prompt:** 
```
Check the last 10 transfers for this wallet address on Solana.
```

**Response:** 
```
Found 10 recent transfers for the requested Solana address:

*   **SOL**: 15.5 units to `...x72a`
*   **USDC**: 500.00 to `...91b`
*   **PYUSD**: 100.00 to `...3c4`
*   **SOL**: 2.1 units to `...88d`

*(Showing 4 of 10 results...)*
```

## Capabilities

### Query historical blockchain data
Fetch old transaction history and trends from over 40 different chains.

### Monitor live smart contract events
Get real-time updates on EVM and Solana transfers and calls as they happen.

### Track DEX liquidity and trades
Pull specific trade data and token performance metrics from decentralized exchanges.

### Inspect internal contract calls
See the underlying instructions and events for complex protocol interactions.

### Generate secure access tokens
Create OAuth2 credentials to keep your agent's connection to the data secure.

## Use Cases

### Debugging a failed smart contract call
A developer asks their agent to check for specific Calls on Polygon to see why a transaction reverted. The agent pulls the data instantly.

### Analyzing price impact on a DEX
An analyst asks for the 10 biggest DexTrades on Uniswap in the last hour. The agent uses query_v2 to find the trades and calculate volume.

### Tracking a multi-chain fund movement
A security researcher asks the agent to map out a series of historical transfers across 5 different chains to track a specific wallet.

### Setting up automated data feeds
A bot developer uses generate_token to let the agent manage a secure session for continuous, automated data fetching.

## Benefits

- Skip the node management. You don't have to host your own infrastructure to get data from Ethereum, Solana, or Bitcoin.
- Get cross-chain data in one go. Use query_v1 to pull historical trends from dozens of chains without switching tools.
- Monitor live DEX activity. Use query_v2 to track DexTrades and DexTradesByTokens as they happen.
- Deep dive into smart contracts. Analyze Calls and Events to see exactly how a protocol is interacting with users.
- Automate your access. Use generate_token to handle OAuth2 credentials so your agent stays connected securely.

## How It Works

The bottom line is you get a unified way to query any chain without managing your own nodes.

1. Subscribe to the Connector and grab your Bitquery Access Token.
2. Provide your credentials to your AI client.
3. Ask your agent to fetch specific blockchain data or trade history.

## Frequently Asked Questions

**Can Bitquery MCP see data on Solana?**
Yes, it supports Solana. You can query live transfers, smart contract calls, and other on-chain events across the Solana network.

**Does this work for Bitcoin?**
Yes, it covers over 40 chains including Bitcoin. You can use it to fetch historical data for audits or trend analysis.

**How do I get real-time DEX data?**
You can pull live trade data and liquidity metrics from various decentralized exchanges using the streaming query capabilities.

**Can I use this for security audits?**
Absolutely. It's built for this. You can use the historical query features to map out past transactions and fund movements across multiple chains.

**Do I need to run my own node?**
No, you don't. This Connector connects directly to the Bitquery infrastructure, so you don't have to worry about managing your own nodes or RPC endpoints.

**How do I keep my credentials safe?**
The Connector includes a tool to generate OAuth2 access tokens. This allows your agent to handle the authentication flow securely without exposing your secrets.

**What is the difference between query_v1 and query_v2?**
Use `query_v1` for historical data across 40+ legacy and non-EVM chains (like Bitcoin). Use `query_v2` for real-time streaming and advanced filtering on EVM chains and Solana, supporting complex joins like 'joinCalls'.

**How do I obtain an access token if I only have a Client ID and Secret?**
You can use the `generate_token` tool. Provide your Bitquery Client ID and Secret, and the tool will return a Bearer token that you can use as your `BITQUERY_ACCESS_TOKEN` credential.

**Can I query data from multiple regions?**
Yes. Both `query_v1` and `query_v2` support an optional `region` parameter. You can choose between 'global', 'asia', or 'us' to optimize latency based on your location.