Skip to content

Commit c4b9568

Browse files
committed
mcp: bump version and document ask_lago_analytics tool
1 parent 194d295 commit c4b9568

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ For operators deploying Managed Agents to their own customers and needing per-se
4242
"--name", "lago-mcp-server",
4343
"-e", "LAGO_API_KEY=your_lago_api_key",
4444
"-e", "LAGO_API_URL=https://api.getlago.com/api/v1",
45+
"-e", "LAGO_AGENT_API_URL=https://agent.getlago.com",
4546
"getlago/lago-mcp-server:latest"
4647
]
4748
}
@@ -54,16 +55,24 @@ For operators deploying Managed Agents to their own customers and needing per-se
5455

5556
For self-hosted Lago, replace `LAGO_API_URL` with your instance URL.
5657

58+
> **Analytics tool**: `ask_lago_analytics` additionally requires `LAGO_AGENT_API_URL` (the URL of the Lago analytics agent). If it's not set, the other tools work normally and only the analytics tool returns a configuration error. Note: this tool forwards your `X-LAGO-API-KEY` to the analytics agent service (a first-party Lago service that re-validates the key and applies the same per-organization row-level security as the Rails API). It is the one tool that does not route through the Lago REST API — see the PR description / `docs/` for the architecture rationale.
59+
5760
## Example prompts
5861

5962
- *"Show me all pending invoices from last month"*`list_invoices`
6063
- *"Find all failed payment invoices"*`list_invoices`
6164
- *"Give me the total amount of overdue invoices for March 2025"*`list_invoices` + agent aggregation
6265
- *"Preview an invoice for customer X with 500 additional API-call events"*`preview_invoice`
6366
- *"Retry payment on invoice INV-123"*`retry_invoice_payment`
67+
- *"What was our MRR for December 2025, broken down by plan?"*`ask_lago_analytics`
68+
- *"List the top 10 customers by usage volume in Q1 2026."*`ask_lago_analytics`
69+
- *"How many invoices went overdue last month?"* then *"Break that down by customer country."*`ask_lago_analytics` (the second call reuses the returned `session_id`)
6470

6571
## Available Tools
6672

73+
### Analytics
74+
- **`ask_lago_analytics`**: Ask a natural-language question about your billing and usage data (revenue, MRR, invoices, customers, subscriptions, usage volumes). The analytics agent generates a read-only SQL query, runs it, and returns the SQL, a plain-language explanation, and a results table. The response includes a `session_id` — pass it back on a follow-up call to refine the same result (filter, aggregate, sort) using the agent's cached rows.
75+
6776
### Invoices
6877
- **`find_invoice_by_number`**: Find an invoice by its number (e.g., "RAF-8142-202601-312") and get its Lago ID
6978
- **`get_invoice`**: Retrieve a specific invoice by Lago ID

mcp/.env.development.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
MISTRAL_AGENT_ID="your_mistral_agent_id"
22
MISTRAL_API_KEY="your_mistral_api_key"
3+
4+
# Analytics agent (ask_lago_analytics tool) — the Python text-to-SQL service
5+
LAGO_AGENT_API_URL="https://agent.getlago.com"
6+
# request timeout for the analytics agent in seconds (default 60 if unset)
7+
LAGO_AGENT_TIMEOUT_SECS="60"

mcp/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mcp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lago-mcp-server"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2024"
55

66
[dependencies]

0 commit comments

Comments
 (0)