Model Context Protocol

Connect AI tools to SpendGuard through MCP

SpendGuard MCP is a thin wrapper over the same action routes used by the dashboard and SDK. It lets compatible agent clients report AI usage, check budgets, review cost findings, forecast spend, track ROI, and govern paid actions without receiving raw financial or provider credentials.

How it works

A simple MCP control loop for AI spend

The MCP server validates each request with the caller's SpendGuard credential, forwards the request to the SpendGuard API, and returns the API decision. The remote transport is stateless and keeps the MCP layer as a facade, not a separate policy engine or second ledger.

1

Create or choose an agent

Use the dashboard quickstart to create a sandbox agent, API key, and starter budget policy before connecting an MCP client.

2

Add the MCP server

Paste the server configuration into an MCP-compatible client. Store the API key in the client secret settings, not in source control.

3

Let agents report and control spend

Call report_ai_usage after model calls, get_budget_status before expensive runs, and use guard_spend / settle_spend for governed paid actions.

MCP endpoint

Copy this URL into your MCP client

https://spendguard-mcp.onrender.com/mcp

This is the active endpoint from the current frontend configuration. Use https://mcp.spend-guard.com/mcp only after the custom MCP domain is verified and configured.

mcp.json
{
  "mcpServers": {
    "spendguard": {
      "type": "http",
      "url": "https://spendguard-mcp.onrender.com/mcp",
      "headers": {
        "Authorization": "Bearer ${SPENDGUARD_API_KEY}"
      }
    }
  }
}

Add this JSON to an MCP-compatible client and keep the SpendGuard API key in your client's secret settings.

Tools

MCP tools available in the sandbox wrapper

Start with usage reporting, budget status, alerts, findings, recommendations, and ROI. Use guard and settle when an agent needs to reserve or capture governed spend.

setup_autopilot

Idempotently create a bounded starter agent and $500 monthly hard-stop budget when they are missing.

list_agents

List agents available to the authenticated organization identity.

create_agent

Create a starter agent with bounded scopes already held by the caller.

guard_spend

Estimate, authorize, and reserve budget before a paid action runs.

settle_spend

Capture successful spend or release the reservation after a failed action.

report_ai_usage

Report normalized provider, model, token, and cost data without raw prompts.

get_spend_status

Read the current budget and recent usage summary for the connected workspace.

create_budget_policy

Create scoped budgets for orgs, agents, projects, cost centers, departments, or API keys.

update_budget_thresholds

Adjust alert thresholds without changing the policy scope, limit, period, currency, or mode.

get_budget_status

Read usage, remaining budget, utilization, and next threshold.

list_budget_alerts

Review threshold alerts before a customer discovers overruns on an invoice.

list_cost_findings

Find repeated requests, token spikes, and other deterministic cost leaks.

get_cost_finding

Inspect one tenant-scoped cost finding and its bounded diagnostic metadata.

resolve_cost_finding

Mark a reviewed cost finding as resolved without suppressing future recurrence after the cooldown window.

update_model_policy

Set simple allow or block policies for providers and models.

get_model_recommendations

Review advisory lower-cost model recommendations from usage data.

simulate_ai_cost

Estimate cost before launching a new agent workflow.

forecast_ai_spend

Project future spend from recent usage trends.

report_outcome

Report business outcomes for cost-per-outcome and ROI tracking.

get_spend_advisor

Review deterministic actions with the exact spend metrics supporting each recommendation.

get_roi_summary

Read AI spend, outcome value, cost per outcome, and ROI.

get_project_roi

Read project-level AI spend, outcome value, cost per outcome, and ROI.

get_cost_per_outcome

Read cost-per-outcome breakdowns by cost center.

No raw provider keys

SpendGuard MCP uses a SpendGuard credential. It should not receive customer OpenAI, Anthropic, Google, or payment-provider keys.

Bearer per request

Remote MCP requests are validated and forwarded with the caller credential instead of one shared server credential.

Same backend controls

MCP tools call the same SpendGuard API paths used by the dashboard, SDKs, and action schema.

Evidence-gated rollout

Runtime MCP claims should stay tied to wrapper tests and hosted smoke evidence.

Need the full MCP reference?

The repo documentation includes local stdio setup, hosted Streamable HTTP setup, smoke proof commands, and example tool payloads.

Copy setup from dashboard