# MCP Server

The Revenium MCP Server is the fastest way to connect AI agents — like Claude — directly to your Revenium account. Instead of building dashboards and running manual queries, you ask your AI assistant in plain English: "What's driving my AI cost spike this week?" or "Set up an alert if any single transaction exceeds $5." The MCP server handles the rest.

This is MCP-first integration: Revenium's capabilities surface as native tools inside your AI assistant's context, so cost intelligence and governance become part of every conversation

### What You Can Do With the MCP Server

Once connected, your AI agent can:

* **Investigate cost spikes** — ask "Why did my costs spike yesterday?" and get a breakdown by provider, model, customer, agent, or API key
* **Detect anomalies** — find abnormal spend patterns across all dimensions, with configurable sensitivity and dollar thresholds
* **Set budget alerts** — trigger Slack or email notifications when monthly, daily, or per-transaction spend exceeds a threshold
* **Monitor trends** — get cost summaries for any time window (last hour, day, week, or month) broken down any way you need
* **Catch cost increases early** — set relative-change alerts that fire when spend rises or falls by a percentage week-over-week or month-over-month
* **Meter its own usage** — track the agent's own API calls back to your Revenium account for full operational transparency
* **Integrate metering into your app** — get working code examples and implementation guidance for Python and JavaScript without leaving your IDE
* **Track agent job ROI** — measure the business outcomes and return on investment of individual AI agent jobs

### Getting Started

Install `uv` (`pip install uv`) and add this to your MCP client config:

```json
{
  "mcpServers": {
    "revenium": {
      "command": "uvx",
      "args": ["revenium-mcp"],
      "env": {
        "REVENIUM_API_KEY": "rev_sk_your_api_key_here"
      }
    }
  }
}
```

The MCP server needs a write-scope key (`rev_sk_*`) because it both reads Revenium data and can create alerts and modify resources — a metering-only key (`rev_mk_*`) will be rejected. See [API Key Permissions](/integrations/api-key-permissions.md) for the full key tier reference.

For Claude Code shortcuts, IDE-specific install variants, troubleshooting, and the full configuration reference, see the [Revenium MCP server repository](https://github.com/revenium/revenium-mcp).

## Related

* [Rancher Prime Integration](/integrations/mcp-server/rancher-prime.md) — Kubernetes in-cluster deployment
* [Context7 and AI Docs Access](/integrations/context7.md) — AI-readable docs access without running an MCP server


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revenium.io/integrations/mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
