from the team behind Truto
Connect ChartMogul to ChatGPT: Analyze Revenue Metrics and Growth
Uday Gajavalli
10 min read
The best way to connect ChartMogul to ChatGPT is Elaichi: connect ChartMogul to Elaichi once, then add Elaichi to ChatGPT as a connector. Two steps, about a minute, with a 14‑day free trial and no credit card required.
-
Start your free trial
14 days free, no credit card required.
-
Connect ChartMogul
Once, in Elaichi. ChatGPT never gets more access than you have.
-
Add Elaichi to ChatGPT
In ChatGPT, open Plugins, press +, and paste the URL into Server URL. Sign in and approve.
https://api.elaichi.ai/mcp
Building ChartMogul into your own product? The guide below is for you. Read the guide ↓ Start free on Truto →
The developer guide
Learn how to connect ChartMogul to ChatGPT using Truto's MCP server to automate subscription analytics, invoice imports, and revenue metric workflows.
If you need to connect ChartMogul to ChatGPT to automate subscription analytics, ingest billing data, or diagnose MRR movements, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and ChartMogul's subscription data APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.
If your team uses Claude, check out our guide on connecting ChartMogul to Claude or explore our broader architectural overview on connecting ChartMogul to AI Agents.
Giving a Large Language Model (LLM) read and write access to a subscription analytics platform like ChartMogul is a significant engineering challenge. You must handle complex data source architectures, differentiate between internal UUIDs and external system IDs, and manage asynchronous export jobs. Every time a new custom attribute is added or an API schema changes, custom server code requires updates, testing, and redeployment.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for ChartMogul, connect it natively to ChatGPT, and execute complex revenue workflows using natural language.
The Engineering Reality of the ChartMogul API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against ChartMogul's specific architectural quirks is painful.
If you decide to build a custom MCP server for ChartMogul, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with ChartMogul:
The Dual-Identity System (UUIDs vs External IDs)
ChartMogul relies on a strict dual-identity system. When ingesting data from a billing system (like Stripe or a custom backend), resources like Customers, Invoices, and Plans typically require an external_id. However, once the record exists in ChartMogul, the API assigns it a uuid. Many endpoints specifically require the uuid for updates, while import endpoints require the external_id. If your MCP server does not clearly define which ID is required for which operation in its JSON Schemas, ChatGPT will inevitably pass an external ID to an endpoint expecting a UUID, resulting in 400 Bad Request errors.
Data Source Partitioning
Almost all ingest operations in ChartMogul - creating customers, importing invoices, or mapping plans - require a data_source_uuid. Data Sources act as the root partition for incoming data, preventing collisions between different billing systems. An LLM cannot simply "create a customer." It must first query the available Data Sources, extract the correct uuid, and explicitly pass it in the creation payload. Building an MCP server means you have to orchestrate these prerequisite lookups and heavily prompt the tool schemas so the LLM understands this dependency chain.
Asynchronous Export Endpoints
Extracting bulk data (like an Activities Export) from ChartMogul is not a synchronous REST call. The POST request to create an export returns a job id with a status of pending. Your integration layer must implement a polling mechanism to check the job status until a file_url is returned. Mapping this asynchronous pattern to a synchronous LLM tool call requires building intermediate state management into your MCP server to hold the LLM's context while the job completes.
Step 1: Generate a ChartMogul MCP Server
Instead of building custom polling logic and JSON Schema mappers for ChartMogul's dual-ID system, you can use Truto to generate a secure MCP server scoped to a specific ChartMogul account.
Truto dynamically generates tools based on the ChartMogul API documentation, ensuring schemas are always up-to-date.
First, authenticate the ChartMogul account via the Truto dashboard. Once connected, you can generate the server using either the UI or the API.
Method A: Via the Truto UI
- Navigate to the Integrated Accounts page in your Truto dashboard and select the connected ChartMogul account.
- Click on the MCP Servers tab.
- Click Create MCP Server.
- Configure the server settings (e.g., name it "ChartMogul Revenue Analytics", select
readandwritemethods, and filter by tags likemetricsandcustomers). - Click Create and immediately copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4...). Treat this URL as a secure credential.
Method B: Via the Truto API
You can programmatically generate MCP servers for your end-users. This is ideal if you are embedding AI agents into your own SaaS application. Make a POST request to the /mcp endpoint using the ChartMogul integrated_account_id.
curl -X POST https://api.truto.one/integrated-account/<INTEGRATED_ACCOUNT_ID>/mcp \
-H "Authorization: Bearer $TRUTO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "ChartMogul ChatGPT Agent",
"config": {
"methods": ["read", "write", "custom"],
"tags": ["metrics", "customers", "invoices", "activities"]
}
}'The API returns a JSON payload containing the url. This URL handles routing, authentication, and tool exposure automatically.
Step 2: Connect the MCP Server to ChatGPT
With the MCP server URL in hand, you must register it with your ChatGPT environment. You can do this via the ChatGPT desktop UI or via a configuration file for custom AI agent runners.
Method A: Via the ChatGPT UI
Note: MCP support in ChatGPT requires a Pro, Plus, Business, Enterprise, or Education plan with Developer mode enabled.
- Open the ChatGPT desktop application.
- Navigate to Settings -> Apps -> Advanced settings.
- Toggle on Developer mode.
- Under the MCP servers / Custom connectors section, click Add new.
- Enter a recognizable name (e.g., "ChartMogul Analytics").
- Paste the Truto MCP URL generated in Step 1 into the Server URL field.
- Save the configuration. ChatGPT will immediately connect, perform an initialization handshake, and list the available ChartMogul tools.
Method B: Via Manual Configuration (Cursor, Claude Desktop, or Custom Agents)
If you are using a local agent or a different client that relies on standard MCP configuration files, you can configure it using the SSE transport protocol.
Add the following JSON block to your client's configuration file (e.g., mcp-settings.json):
{
"mcpServers": {
"chartmogul_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/<YOUR_TOKEN>"
]
}
}
}ChartMogul Hero Tools for AI Agents
ChartMogul's API surface is vast. Truto normalizes this surface into callable tools with strictly typed query and body schemas. Here are the highest-leverage tools available for your ChatGPT agent to execute revenue and customer workflows.
list_all_chart_mogul_metrics_v_2_mrr
Retrieves the Monthly Recurring Revenue (MRR) movements for a specified time period. This is the core analytics endpoint for understanding business growth, contraction, and churn. The agent must provide a start, end, and interval (e.g., month).
Contextual usage notes: ChatGPT uses this to build trend analysis and answer questions about revenue targets.
"Fetch the MRR metrics for the last quarter broken down by month. Summarize the total MRR growth and highlight any months with negative net movement."
create_a_chart_mogul_customer
Establishes a new customer object under a specific data source. This is the foundational step before logging custom subscription events or importing invoices.
Contextual usage notes: The agent must pass a data_source_uuid and a unique external_id. It will fail if the data source is not valid.
"Create a new customer in ChartMogul named 'Acme Corp' with the email 'billing@acme.com'. Use the external ID 'cus_acme_123' and assign them to our primary manual data source."
create_a_chart_mogul_invoice_import
Imports an invoice for a customer using their external ID. ChartMogul parses line items on imported invoices to automatically generate or update subscription objects.
Contextual usage notes: Useful for backfilling historical billing data or integrating custom payment processors.
"Import a new invoice for customer ID 'cus_acme_123'. The invoice date is today, currency is USD, and it includes a single line item for an 'Enterprise Annual License' priced at $12,000."
create_a_chart_mogul_subscription_event
Pushes raw subscription state changes (e.g., subscription_start_date, subscription_cancelled) directly into ChartMogul. This bypasses the invoice-parsing engine and is ideal for custom B2B SaaS billing models.
Contextual usage notes: The agent must provide exact event_type and event_date strings.
"Log a cancellation event for the subscription 'sub_789' belonging to external customer 'cus_acme_123'. The effective date is the end of the current month."
list_all_chart_mogul_activities
Fetches a granular list of historical subscription activities (new business, churn, contraction, expansion) across the entire account or for a specific time period.
Contextual usage notes: Crucial for auditing why MRR changed. ChatGPT can parse these activities to find specific lost accounts.
"List all churn activities for this month. Which customer had the highest ARR loss, and what was the exact date they cancelled?"
create_a_chart_mogul_customer_note
Logs a text note or call record directly to a customer's profile in ChartMogul.
Contextual usage notes: Excellent for augmenting revenue data with qualitative CS (Customer Success) insights. Requires the customer's ChartMogul uuid.
"Add a note to the Acme Corp profile stating: 'Customer requested a downgrade due to budget cuts. Follow up in Q3 to attempt re-expansion.'"
To view the complete inventory of ChartMogul tools - including endpoints for custom attributes, opportunity tracking, and tag management - check out the ChartMogul integration page.
Workflows in Action
When you connect ChartMogul to ChatGPT using Truto's MCP server, the LLM can chain these tools together to execute complex, multi-step operations that would normally require a data analyst and a developer.
Workflow 1: Diagnosing MRR Churn Context
Revenue teams often notice an MRR dip but lack immediate context on why it happened. An AI agent can pull the metrics, find the specific churn events, and fetch the CS notes to build a comprehensive brief.
"Look at our MRR metrics for last month. Identify if we had higher than normal churn. If so, find the specific customers that churned and summarize any notes on their profiles to explain the loss."
list_all_chart_mogul_metrics_v_2_mrr: The agent fetches the top-level MRR data for the previous month to confirm the churn anomaly.list_all_chart_mogul_activities: The agent queries activities filtered by thechurntype for that specific timeframe, extracting thecustomer_uuidfor each lost account.list_all_chart_mogul_customer_notes: Iterating through the churned accounts, the agent pulls the qualitative notes attached to each profile.
The user receives a synthesized report: "Last month saw $4,500 in MRR churn, primarily driven by two accounts. Account A ($3,000) churned due to a company acquisition, according to the latest CS note. Account B ($1,500) cited budget constraints."
sequenceDiagram
participant User as "ChatGPT User"
participant Agent as "ChatGPT (MCP Client)"
participant Truto as "Truto MCP Server"
participant CM as "ChartMogul API"
User->>Agent: "Diagnose last month's churn..."
Agent->>Truto: Call list_all_chart_mogul_metrics_v_2_mrr
Truto->>CM: GET /v2/metrics/mrr
CM-->>Truto: MRR summary data
Truto-->>Agent: JSON result
Agent->>Truto: Call list_all_chart_mogul_activities (type=churn)
Truto->>CM: GET /v1/activities
CM-->>Truto: List of churn events with UUIDs
Truto-->>Agent: JSON result
Agent->>Truto: Call list_all_chart_mogul_customer_notes
Truto->>CM: GET /v1/customers/{uuid}/notes
CM-->>Truto: Qualitative CS notes
Truto-->>Agent: JSON result
Agent-->>User: Synthesized churn analysis reportWorkflow 2: Provisioning a Custom Billing Event
When sales teams close custom deals outside of standard self-serve flows, ops teams must manually construct the billing data in ChartMogul. An agent can automate this data entry.
"We just closed a custom deal with Beta Inc. Create a new customer record for them under our Manual Data Source using external ID 'beta_001'. Then, import an invoice for a $5,000 annual contract starting today."
list_all_chart_mogul_data_sources: The agent searches for the "Manual Data Source" to retrieve its requireduuid.create_a_chart_mogul_customer: The agent creates the customer profile, passing the extracteddata_source_uuidand the external ID 'beta_001'.create_a_chart_mogul_invoice_import: The agent constructs the invoice payload with the $5,000 line item and pushes it to ChartMogul, which automatically spins up the active subscription.
The user gets immediate confirmation that the revenue is now recognized in ChartMogul's reporting engine without touching a CSV file.
Security and Access Control
Giving an LLM access to sensitive financial data requires strict boundaries. Truto's MCP servers provide infrastructure-level governance to restrict what ChatGPT can do.
- Method Filtering: Use
config.methodsto restrict the server to["read"]operations. This ensures the LLM can analyze MRR and query activities, but cannot accidentally delete customers or mutate invoices. - Tag Filtering: Use
config.tagsto limit the server's scope. For example, allowing["metrics"]but excluding["invoices"]keeps the agent focused on high-level analytics rather than transactional data. - Enforced API Token Authentication: Setting
require_api_token_auth: truemeans possession of the MCP URL is not enough. The client must pass a valid Truto API token in the Authorization header, preventing unauthorized access if the URL leaks. - Ephemeral Servers: The
expires_atparameter allows you to create temporary MCP servers. If a financial analyst needs AI assistance for end-of-month reporting, you can generate a server that automatically self-destructs after 48 hours.
Handling ChartMogul Rate Limits
ChartMogul enforces strict rate limits on its API to maintain performance. It is critical to understand that Truto does not retry, throttle, or absorb rate limit errors on your behalf.
When ChatGPT triggers a tool that hits a ChartMogul rate limit, the upstream API returns an HTTP 429 response. Truto passes this 429 error directly back to the caller. To assist your agent in handling these errors, Truto normalizes the upstream rate limit data into standardized headers per the IETF specification:
ratelimit-limit: The total request quota.ratelimit-remaining: The number of requests left in the current window.ratelimit-reset: The timestamp when the quota refreshes.
The caller (the MCP client or the underlying agent framework) is entirely responsible for reading these headers and implementing its own retry logic or exponential backoff.
Strategic Wrap-Up
Connecting ChartMogul to ChatGPT transforms static subscription analytics into an interactive, conversational engine. Instead of forcing revenue teams to manually cross-reference CSV exports with CRM notes to understand churn, AI agents can traverse ChartMogul's relational graph autonomously.
Building this orchestration layer yourself requires parsing complex data source schemas, handling dual-identity mapping, and orchestrating asynchronous jobs. By using Truto's managed MCP servers, you eliminate the integration boilerplate. You can deploy secure, strictly-scoped AI tools in minutes, allowing your engineering team to focus on building agentic reasoning rather than maintaining API wrappers.
FAQ
- What is the easiest way to connect ChartMogul to ChatGPT?
- The best way to connect ChartMogul to ChatGPT is Elaichi: connect ChartMogul to Elaichi once, then add Elaichi to ChatGPT as a connector. Two steps, about a minute, with a 14-day free trial and no credit card required.
- Can I restrict ChatGPT to read-only access in ChartMogul?
- Yes. When creating the Truto MCP server, you can set the configuration methods to ["read"]. This ensures the LLM can query MRR metrics and customer data but cannot create, update, or delete any records.
- How does the MCP server handle ChartMogul's dual UUID and external ID system?
- Truto automatically generates precise JSON Schemas from the ChartMogul API documentation. These schemas explicitly define when a tool requires an internal UUID versus an external ID, guiding the LLM to provide the correct identifier format.
- How do AI agents handle ChartMogul API rate limits?
- Truto does not absorb or retry rate limits. If ChartMogul returns an HTTP 429, Truto passes the error to the caller along with standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). Your client or agent framework must handle the retry and backoff logic.
- Can I connect ChartMogul to Claude instead of ChatGPT?
- Yes. The MCP standard is agnostic. The same MCP server URL generated by Truto can be added to Claude Desktop, Cursor, or custom AI agents.