mcp-server-grok-management
MCP server for the xAI Management API — API keys, ACLs, audit logs, and billing
Documentation
mcp-server-grok-management
MCP server for the xAI Management API (`management-api.x.ai`) — team API keys
and billing, over stdio. Pure Rust binary.
Auth uses a management key (not an inference API key) from
console.x.ai → Settings → Management Keys.
For day-to-day spend questions, start with `billing_overview`.
Tools (23)
Billing (primary)
| Tool | Access | Notes |
|---|---|---|
| `billing_overview` | read | Dashboard: period spend, headroom, limits, prepaid, PMs, contact |
| `get_invoice_preview` | read | This month’s postpaid spend + product breakdown |
| `get_spending_limits` | read | Soft/hard limits in USD |
| `set_spending_limit` | write | Soft limit in cents; `confirm="YES-WRITE"` |
| `get_prepaid_balance` | read | Credit ledger |
| `top_up` | write | Charge default PM; `confirm="TOP-UP"` |
| `list_payment_methods` | read | Cards / Stripe Link (add cards in console) |
| `set_default_payment_method` | write | `confirm="YES-WRITE"` |
| `get_billing_info` | read | Name / email / address |
| `set_billing_info` | write | `confirm="YES-WRITE"` |
| `list_invoices` | read | Optional year/month/since/invoice_ids filters |
| `get_invoice` | read | One invoice + line items |
| `get_usage` | read | Analytics (usd sum, group_by, timezone) |
API keys
`validate_key`, `list_api_keys`, `create_api_key`, `update_api_key`,
`delete_api_key` (`DELETE`), `rotate_api_key` (`ROTATE`), `check_propagation`,
`list_models`, `list_endpoints`
Audit
`list_audit_events`
Safety gates
| Tool | Required `confirm` |
|---|---|
| `delete_api_key` | `"DELETE"` |
| `rotate_api_key` | `"ROTATE"` |
| `set_spending_limit` | `"YES-WRITE"` |
| `set_billing_info` | `"YES-WRITE"` |
| `set_default_payment_method` | `"YES-WRITE"` |
| `top_up` | `"TOP-UP"` (charges card) |
Money fields are USD cents (e.g. `10000` = $100.00).
Write billing tools need BillingWrite (or full access) on the management key.
`validate_key` reports whether BillingWrite is listed on the key’s ACLs.
Configuration
`~/.config/mcp-server-grok-management/config.toml` (`chmod 600`):
management_key = "xai-..." # console.x.ai → Settings → Management Keys
# team_id = "uuid" # optional — auto from validate
# base_url = "https://management-api.x.ai"Build
cargo build --release # target/release/mcp-server-grok-management
cargo test
./tests/test-stdio.shArchitecture
No god modules: api/ (HTTP by domain), format/ (pure text), params/ (schemas),
tools/ (MCP handlers composed with `router_keys + router_billing + router_audit`).
See `CLAUDE.md`.
MCP clients
Already wired for Grok (`~/.grok/config.toml`) and Claude Code
(`claude mcp add -s user …`). Restart the client session if tools don’t appear.
Scope notes
- Creating management keys themselves is console-only.
- Adding payment methods is console-only; this server lists them and can set default.
- Collections / Computer Use / Conversations / Files resources are not in the public Management REST surface (only appear as management-key ACL labels).
Docs
Frequently asked questions
What is mcp-server-grok-management?
mcp-server-grok-management is MCP server for the xAI Management API — API keys, ACLs, audit logs, and billing
How do I install mcp-server-grok-management?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-server-grok-management open source?
Yes — it is hosted on GitHub at https://github.com/codeChap/mcp-server-grok-management.
Related MCP tools
an open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Search infrastructure for AI
YC (S26) | Open Computer History | Record your screen continuously locally and provide context to your agents (Claude, Codex, Openclaw, Hermes, Runner...)
The fastest and the most accurate file search SDK for AI agents, Neovim, Rust, C, Python, Bun and NodeJS
Semantic version control => entity-level diffs, blame, and impact analysis on top of git. 28 languages via tree-sitter. Built for coding agents.
Fast, local-first web content extraction for LLMs. Scrape, crawl, extract structured data — all from Rust. CLI, REST API, and MCP server.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP