# Lago MCP for AI Agents AI Agent Connect

> Lago MCP lets you handle complex usage-based billing and customer subscriptions directly through your AI agent. It connects your agent to your billing infrastructure so you can manage plans, track real-time usage events, and handle financial operations like coupons and invoices without switching tabs.

## Overview
- **Category:** money-moves
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_NNWvW9n3yfSEMxn5gBt3GomfwJtiW443sbi3CFBH/ai-agent-connect
- **Tags:** usage-based-billing, metering, saas-metrics, subscription-management, revenue-operations, api-integration

## Description

Most SaaS companies struggle with the math of usage-based pricing. You often have to build custom logic to track every click, API call, or gigabyte and then sync that to a billing system. This usually involves messy spreadsheets, custom scripts, and a lot of manual corrections when a customer asks why their bill is so high. With this Connector, your AI agent handles the heavy lifting. You can ask it to pull up a customer's current subscription, create new billing plans on the fly, or see how many usage events were logged today. It acts as a direct bridge to your revenue operations, making it easy to manage the lifecycle of a customer from sign-up to renewal. Because Vinkius hosts this Connector, you get a reliable way to connect your existing billing logic to your favorite AI client. You stop copy-pasting IDs and start managing your actual business logic through natural conversation. It is about getting a clear view of your revenue and customer health without the manual data entry.

## Tools

### create_billable_metric
Set up a new metric to track specific customer consumption. Use this to define how you charge for new features.

### create_coupon
Create a new promotional coupon for your customers. This helps you set up marketing campaigns quickly.

### create_plan
Define a new billing plan with specific pricing rules. Use this to launch new tiers for your product.

### create_subscription
Assign a specific plan to a customer record. This connects your users to their chosen billing cycle.

### create_wallet
Set up a wallet for customers using prepaid credits. It is perfect for high-volume API users.

### get_customer
Retrieve a specific customer's profile using their external ID. Use this to check account status quickly.

### get_subscription
Look up the details of an active or past subscription. This helps you verify what a user is currently paying for.

### list_invoices
Pull a list of all invoices from your Lago account. This is great for quick financial audits.

### send_event
Send a single usage event to trigger accurate billing. Use this to log individual user actions.

### upsert_customer
Create or update a customer profile with a unique external ID. This keeps your database and billing in sync.

### batch_events
Send multiple usage events at once to handle high-volume data. This is more efficient for heavy usage logs.

### apply_coupon
Attach a promotional coupon to a specific customer. This lets you reward users without manual dashboard work.

## Prompt Examples

**Prompt:** 
```
Create a new customer for 'Acme Corp' with the ID 'acme_01' and put them on the Pro plan.
```

**Response:** 
```
I've created the customer record for 'acme_01'. I've also assigned them to the Pro plan, so their subscription is active and ready to go.
```

**Prompt:** 
```
Show me the last 5 invoices for the customer with ID 'user_99'.
```

**Response:** 
```
Here are the latest invoices for user_99:

| Date | Amount | Status |
|---|---|---|
| Oct 1 | $45.00 | Paid |
| Sept 1 | $45.00 | Paid |
| Aug 1 | $45.00 | Paid |
| July 1 | $45.00 | Paid |
| June 1 | $45.00 | Paid |
```

**Prompt:** 
```
Give me a 20% discount coupon for the next month for user_44.
```

**Response:** 
```
I've created a 20% discount coupon and applied it to user_44's account. It's set to apply to their next billing cycle.
```

## Capabilities

### Update customer profiles
Modify or create customer records using unique external IDs.

### Assign plans to customers
Connect specific billing plans to customer accounts instantly.

### Create new billing plans
Define new pricing structures and plans within your billing system.

### Track usage data in real-time
Send individual or batched usage events to trigger accurate billing.

### Manage prepaid credits
Create and manage wallets for customers using credit-based systems.

### Apply promotional coupons
Generate and attach discount codes to specific customer accounts.

## Use Cases

### Updating a plan mid-conversation
A customer wants to upgrade. The founder asks the agent to check the current plan with get_subscription and then switch them to a new one using create_subscription.

### Bulk usage logging
An engineer needs to log 500 API calls. They ask the agent to use batch_events to ensure the customer is billed correctly for that spike.

### Promo code deployment
A growth lead wants to run a weekend sale. They tell the agent to use create_coupon and apply_coupon to get the campaign live in seconds.

### Finance audit
A finance person needs to see who hasn't paid. They ask the agent to use list_invoices and filter for any that aren't marked as paid.

## Benefits

- Stop switching tabs by managing customer profiles and subscriptions directly through your agent using upsert_customer and get_subscription.
- Handle high-volume usage data without friction by sending real-time events using send_event or batch_events.
- Launch marketing campaigns faster by having your agent create and apply promotional codes with create_coupon and apply_coupon.
- Track complex pricing models accurately by setting up new consumption metrics with create_billable_metric.
- Simplify revenue operations by pulling full invoice lists or checking customer details with list_invoices and get_customer.
- Manage prepaid accounts easily by creating and tracking user balances with create_wallet.

## How It Works

The bottom line is you get a conversational interface for your entire usage-based billing infrastructure.

1. Subscribe to the Lago MCP on the Vinkius Marketplace.
2. Enter your Lago API Key into your AI client settings.
3. Ask your agent to perform billing tasks like listing invoices or creating subscriptions.

## Frequently Asked Questions

**What does the Lago MCP do for my SaaS?**
It connects your AI agent to your Lago billing account so you can manage customers, plans, and usage-based metrics using natural language.

**Can I use the Lago MCP to track real-time usage?**
Yes, you can have your agent send usage events or batches of events to trigger accurate billing based on customer activity.

**How do I manage customer subscriptions with Lago?**
You can ask your agent to retrieve subscription details, assign new plans to existing customers, or update customer profiles instantly.

**Can my agent handle promotional coupons?**
Yes, your agent can create new coupons, apply them to specific customers, and manage your overall promotional logic.

**Is the Lago MCP good for complex pricing?**
It is specifically designed for usage-based and complex pricing models, making it ideal for SaaS products with variable costs.

**Can I check my invoices using the Lago MCP?**
You can ask your agent to list all invoices or look up specific billing history for any customer in your account.

**Does the Lago MCP support prepaid credits?**
Yes, your agent can create wallets for customers who want to use prepaid credits instead of traditional subscriptions.

**How do I track a new usage event for a customer?**
Use the `send_event` tool. You'll need to provide the customer's external ID and the metric code to record the consumption in real-time.

**Can I create a new billing plan with specific charges?**
Yes, use the `create_plan` tool. You can define the name, interval, and base amount, as well as pass a JSON object for specific charges.

**Is it possible to apply a discount to a customer?**
Absolutely. First, create a coupon using `create_coupon`, then use the `apply_coupon` tool to link it to a specific customer's external ID.