# Sablier MCP

> Sablier MCP Server handles real-time Web3 payroll, token streaming, and airdrop campaigns. Your agent connects directly to on-chain data via GraphQL indexers (like Envio). You can check wallet eligibility using `check_eligibility`, build complex Merkle trees for distributions with `create_merkle_campaign`, or query live flow streams from the network. It puts enterprise finance logic and DeFi operations into one natural language interface.

## Overview
- **Category:** finance-accounting
- **Price:** Free
- **Tags:** token-streaming, real-time-payroll, airdrop-management, merkle-tree, defi, ethereum

## Description

**Sablier MCP Server - Token Payroll & Airdrop Management**

This server handles real-time Web3 payroll, token streaming, and complex airdrop campaigns. Your agent connects directly to on-chain data using GraphQL indexers like Envio. It basically puts enterprise finance logic and DeFi operations into one natural language interface.

To query live flow streams and lockup statuses from the network, you use **`query_graphql`**. This tool lets you pull active token flow streams and gives you a real-time look at how tokens are moving right now through the Sablier indexers. For large Decentralized Autonomous Organizations (DAOs), you can automate monitoring and validation of contributor stream statuses using this GraphQL connection.

Before you do anything else, you gotta make sure your campaign setup is legit. You run **`check_validity`** to confirm that an IPFS CID points to a legitimate, active Sablier campaign definition. If it fails, don't waste time—the config ain't valid. Once the configuration checks out, you can determine if a specific wallet address qualifies for an ongoing token campaign by running **`check_eligibility`**. This tells you exactly if that wallet meets the criteria and even returns the claimable amount.

For managing massive token drops, you use **`create_merkle_campaign`**. You provide it with recipient data—like a CSV list of users and amounts—and the tool handles all the cryptographic math. It generates the necessary Merkle root and the corresponding IPFS CID needed to execute the airdrop distribution records.

It's all about using your AI client to manage these complex, on-chain finance movements without writing a single line of Solidity or querying multiple indexers manually.

## Tools

### check_eligibility
Checks if a specific wallet address meets the criteria for an ongoing token campaign.

### check_validity
Verifies that a given IPFS CID points to a legitimate and active Sablier campaign configuration.

### create_merkle_campaign
Creates a new Merkle tree for an airdrop, returning the necessary Merkle Root and IPFS CID.

### query_graphql
Queries Sablier streams and airdrops directly through GraphQL to pull live on-chain data.

## Prompt Examples

**Prompt:** 
```
Check if address 0x71C7656EC7ab88b098defB751B7401B5f6d8976F is eligible for the campaign with CID QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco.
```

**Response:** 
```
I've checked the eligibility for that address. It is eligible for the campaign! The claimable amount is 500 tokens.
```

**Prompt:** 
```
Create a Merkle campaign for a token with 18 decimals using this CSV: address,amount
0x123...,100.5
0x456...,200
```

**Response:** 
```
The Merkle tree has been created and pinned to IPFS. The Merkle Root is 0xabc... and the IPFS CID is QmZ... You can now use this CID to initialize your Sablier campaign.
```

**Prompt:** 
```
Query the Sablier indexer for all active FlowStreams where the sender is 0x5678...
```

**Response:** 
```
I found 3 active FlowStreams for that sender. Stream #101 is streaming USDC at a rate of 0.01 per second, and Stream #105 is streaming DAI.
```

## Capabilities

### Query real-time streaming data
Use `query_graphql` to fetch active token flow streams and lockup statuses from the Sablier indexers.

### Verify campaign eligibility
Run `check_eligibility` to determine if a given wallet address qualifies for an ongoing token campaign, returning the claimable amount.

### Create Merkle distribution records
Execute `create_merkle_campaign` by providing recipient data (CSV) to generate a cryptographic Merkle root and IPFS CID needed for airdrops.

### Validate campaign configuration
Run `check_validity` to confirm that an IPFS CID points to a legitimate, active Sablier campaign definition.

### Manage DAO payroll flows
Automate the monitoring and validation of large-scale contributor stream statuses for Decentralized Autonomous Organizations (DAOs).

## Use Cases

### Handling a major token distribution
The DeFi team needs to run an airdrop for 5,000 users. Instead of writing a batch script, they prompt their agent: 'Create the Merkle tree using this recipient CSV.' The agent runs `create_merkle_campaign`, gets the CID, and the campaign is ready to initialize.

### Auditing payroll flows
A treasury engineer needs to confirm if a specific contributor stream (e.g., 0x...) is active and what tokens it's sending. They use `query_graphql` to pull the live data, confirming the real-time rate of token movement.

### Pre-launch compliance check
The operations manager gets a list of candidate addresses for an upcoming campaign. Before building anything, they use `check_eligibility` on 10 key wallets to validate their status and confirm the expected claimable amount.

### Verifying data source integrity
Before initiating any transaction involving a new campaign CID, the developer runs `check_validity`. This confirms that the IPFS link is current and hasn't been deprecated by Sablier, saving hours of debugging.

## Benefits

- Check eligibility instantly. Instead of running a separate script, you ask your agent to check if an address is eligible for the campaign using `check_eligibility`. It returns the claimable amount—period.
- Automate distribution setup. Generating Merkle trees used to involve complex code. Now, use `create_merkle_campaign` and give it a CSV list; the server handles the crypto math and gives you the ready-to-use IPFS CID.
- Monitor live payroll streams. Use `query_graphql` to pull data directly from Envio or The Graph indexers. You see streaming flow rates for USDC, DAI, or any token in real time.
- Reduce configuration risk. Before interacting with a campaign, run `check_validity`. This ensures the IPFS CID you're using actually points to an active Sablier setup, preventing deployment failures.
- Speed up DAO operations. The server allows your agent to monitor contributor streams and manage large-scale payouts without manual dashboard switching or custom scripting.

## How It Works

The bottom line is that you manage complex Web3 financial operations by just talking to an agent connected to live blockchain data.

1. First, subscribe to the server and provide your specific Sablier GraphQL URL and Merkle API URL.
2. Next, instruct your AI client to perform a task—for instance, 'Check if wallet 0x... is eligible for campaign QmX...' or 'Create a Merkle tree using this CSV data.'
3. The server executes the required tool (e.g., `check_eligibility`), pulls the necessary on-chain data, and returns the structured result to your AI client.

## Frequently Asked Questions

**How do I query live payroll streams using query_graphql?**
You use `query_graphql` by specifying the required GraphQL endpoint and filters. The tool allows you to pull active Lockup or Flow stream data, showing real-time token movement rates.

**What is the input for create_merkle_campaign?**
The primary input must be a CSV list containing the recipients' addresses and their corresponding amounts. The tool uses this data to generate the cryptographic Merkle tree structure.

**Does check_eligibility only work for active campaigns?**
Yes, `check_eligibility` verifies a wallet address against an existing campaign CID. It confirms if that specific wallet is entitled to claim tokens under the parameters of that campaign.

**Why should I use check_validity before deployment?**
You must run `check_validity` because it validates the IPFS CID against the Sablier configuration. This confirms the CID is pointing to a legitimate, active campaign, preventing failed deployments.

**What credentials do I need when using the `query_graphql` tool?**
You must provide your specific Sablier GraphQL URL and Merkle API URL. These endpoints tell your AI client exactly where to fetch data from the on-chain indexers.

**If I run `check_validity` with a non-existent IPFS CID, what does it report?**
The tool reports an explicit resolution failure. It means the provided CID is either malformed or doesn't point to any recognized Sablier campaign data.

**Is there a limit when I use `create_merkle_campaign` for large recipient lists?**
The underlying API supports substantial datasets, but you should monitor your provider’s rate limits. For extremely large groups, it's safest to chunk the CSV input into multiple requests.

**Are there rate limits when calling `query_graphql` repeatedly?**
Yes, rate limits apply depending on your server subscription tier. If you make complex calls too quickly, expect a 429 error; wait about one second between distinct queries.

**How do I check if a user is eligible for a specific airdrop?**
Use the `check_eligibility` tool. You will need the user's wallet address and the IPFS CID of the Sablier campaign. The agent will query the Merkle API and return the eligibility status.

**Can I create a new distribution list for an airdrop?**
Yes! The `create_merkle_campaign` tool allows you to upload raw CSV content (addresses and amounts). It will generate the Merkle tree, pin it to IPFS, and return the root and CID.

**What data can I retrieve using the GraphQL tool?**
The `query_graphql` tool can fetch any data indexed by Sablier, including LockupStreams, FlowStreams, and Campaign details. You can filter by sender, recipient, or token address.