Skip to main content
Glama
margint-ai

@margint-ai/mcp

Official
by margint-ai

@margint-ai/mcp

Query your Margint per-customer AI margin from Claude Desktop, Cursor, or any MCP client.

Ask the LLM "which customers are losing me money this month?" and have it pull the answer from your Margint workspace. Read-only, scoped to a single API key.

Install

Add to your MCP client config (Claude Desktop example, ~/Library/Application Support/Claude/claude_desktop_config.json):

{
    "mcpServers": {
        "margint": {
            "command": "npx",
            "args": ["-y", "@margint-ai/mcp"],
            "env": {
                "MARGINT_API_KEY": "m_live_..."
            }
        }
    }
}

For Cursor: same JSON, in Settings → Features → MCP.

Get a key at app.margint.devSettings → API Keys.

Related MCP server: CRMy

Tools exposed

Tool

What it does

margint_list_customers

List tracked customers with margin, revenue, cost

margint_get_customer

Drill into one customer's costs by feature/model

margint_cost_overview

Workspace-wide totals + breakdowns by provider/model/feature

margint_check_budget

Check whether a customer is at/over their monthly budget

All tools accept a range parameter (7d, 30d, 90d — default 30d).

Configuration

Env var

Default

Notes

MARGINT_API_KEY

required

Your workspace API key

MARGINT_BASE_URL

https://app.margint.dev

Override for self-hosted Margint

Privacy

The MCP server only forwards your prompts to Margint's read API — it never reads your LLM call payloads. The API key scopes access to a single workspace.


MIT licensed. © Margint. Questions: hi@margint.dev.

Available Tools

4 tools
margint_check_budgetA

Check whether a customer is still within their configured monthly budgets. Agents can call this before making an LLM call to self-gate. Returns { allowed: true | false } with any warnings or breaches. Cached 60s server-side.

ParametersJSON Schema
NameRequiredDescriptionDefault
customerYesThe customer's external ID.
featureNoOptional feature for feature-scoped budgets.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses the return shape ({ allowed, warnings, breaches }) and caching behavior (60s). It implies a read-only check, though it does not explicitly state absence of side effects or authentication needs. Still, it provides key behavioral traits beyond basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (2.5 lines) and front-loaded with the core purpose. Each sentence adds value: purpose, usage, return, caching. No extraneous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple budget-check tool with two parameters and no output schema, the description covers purpose, usage context, return shape, and caching. It lacks error handling details (e.g., missing customer) but is largely complete for the agent to understand invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for both parameters ('customer external ID' and 'optional feature-scoped'). The description adds no additional meaning beyond what the schema provides, meeting the baseline for covered parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks whether a customer is within monthly budgets, with a specific verb ('check') and resource ('customer budget'). It also distinguishes from sibling tools (cost_overview, get_customer, list_customers) by focusing on budget allowance for self-gating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells agents to call this before making an LLM call to self-gate, providing clear when-to-use context. It does not mention when not to use or alternatives, but the self-gating context suffices.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

margint_cost_overviewA

Aggregate cost, revenue, and margin across the whole workspace over a rolling window. Returns totals, per-day sparks, and the count of unprofitable customers. Use this for "how are we doing this week?" questions.

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeNoRolling window size (default 30d).

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries the full burden. It implies read-only behavior ('Aggregate', 'Returns') and lists the returned data. While it does not explicitly state it is non-destructive, the nature of the tool suggests it is safe. Additional details about side effects or performance are not necessary given the simplicity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences that cover the tool's purpose, output, and a usage example. No filler or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one simple parameter and no output schema, the description is complete. It explains what the tool does, what it returns, and when to use it. No additional information is needed for proper selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage for the single parameter 'range' is 100%, so the description does not need to add much. It mentions 'rolling window' in the tool description, which aligns with the parameter description. No additional parameter-specific details are provided beyond what the schema already contains.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool aggregates cost, revenue, and margin across the workspace over a rolling window, and it specifies the return values (totals, per-day sparks, unprofitable customer count). This distinguishes it from siblings like 'margint_check_budget' and 'margint_get_customer'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear usage hint ('how are we doing this week?'), but does not explicitly state when not to use it or mention alternatives. However, the context makes it obvious that this is for overview, not for checking budgets or getting specific customer details.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

margint_get_customerA

Get detailed cost, revenue, margin, and recent events for a single customer by your external ID (the one you pass to the SDK as customerId). Includes per-feature cost breakdown and up to 50 recent cost events.

ParametersJSON Schema
NameRequiredDescriptionDefault
externalIdYesThe customer's ID as you pass it to the SDK.
rangeNoRolling window size (default 30d).

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must disclose behavior. It mentions per-feature cost breakdown and a cap of 50 recent events, giving useful insight into the response. It does not explicitly state read-only but 'get' suggests idempotence. Adequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences that front-load the core purpose and then detail included features. Every word adds value; no repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-customer detail tool with no output schema, the description covers key return elements (cost, revenue, margin, events, per-feature breakdown) and limits (50 events). A minor gap: no mention of whether the response includes metadata or pagination for events beyond 50.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the baseline is 3. The description adds value by clarifying externalId as 'the one you pass to the SDK as customerId,' bridging terminology. Range parameter is adequately described in schema; description reinforces but doesn't add new info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves detailed cost, revenue, margin, and recent events for a single customer using an external ID. This differentiates it from siblings like margint_list_customers (multiple customers) and margint_cost_overview (aggregate).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It specifies use for a single customer by external ID, signaling when to use. While not explicitly stating alternatives, the sibling list implies that for overview or budget checks, other tools are appropriate. A small gap in explicit when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

margint_list_customersA

List tracked customers with AI cost, MRR, and margin over a rolling window. Returns at most 100 rows, sorted worst-margin first. Use this to answer questions like "which customers are losing me money?" Optional feature filter narrows the cost calculation to specific features.

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeNoRolling window size (default 30d).
featuresNoOptional feature names to scope costs to.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that it returns at most 100 rows, sorted worst-margin first, and explains the optional feature filter. With no annotations, this provides adequate behavioral context for a read-only listing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with purpose, and contains no redundant information. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, it sufficiently describes the return values (customer metrics, sort order, row limit). For a simple listing tool, this is complete enough for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the feature filter narrows cost calculation and reinforcing the default range.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists customers with specific metrics (AI cost, MRR, margin) and provides a use-case example. It distinguishes from siblings implicitly, but does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes a concrete usage example ('which customers are losing me money?') and mentions the return limit and optional filtering. Does not explicitly state when not to use or compare to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedmargint_check_budget
    • First observedmargint_cost_overview
    • First observedmargint_get_customer
    • First observedmargint_list_customers

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool serves a distinct purpose: budget check for self-gating, cost overview for aggregate metrics, get customer for detailed per-customer data, and list customers for overview of all customers. No overlap in functionality.

Naming Consistency5/5

All tools follow a consistent pattern: 'margint_' prefix followed by a verb_noun in snake_case (e.g., check_budget, cost_overview). The naming is uniform and predictable.

Tool Count5/5

With 4 tools, the set is well-scoped for a cost monitoring server. It covers essential operations without unnecessary complexity.

Completeness5/5

The tools provide comprehensive read-only coverage for budget and cost monitoring: budget check, aggregate overview, per-customer details, and customer listing. No gaps for the intended use case.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides AI agents with operational customer context, including typed revenue objects, persistent state, scoped tools, and human-in-the-loop handoffs through MCP, REST, and CLI.
    11 npm
    12
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Budget management and cost tracking MCP server for autonomous agents, enabling budget creation, cost recording, spending projections, and alert rules.
    MIT