# MCP Server The Credyt MCP Server connects AI assistants directly to your billing infrastructure. Once installed, you can create products, configure pricing, onboard customers, submit usage events, and inspect wallet balances. All through natural language, without leaving your editor. ## What is an MCP Server?[​](#what-is-an-mcp-server "Direct link to What is an MCP Server?") [MCP (Model Context Protocol)](https://modelcontextprotocol.io) is an open standard that lets AI assistants call external tools and APIs in a structured way. When an MCP server is connected to your AI client, the model can invoke those tools during a conversation, reading and writing real data on your behalf, rather than just generating code for you to run separately. Credyt's MCP Server exposes your billing operations as callable tools. Your AI assistant can manage pricing, customers, and analyze activity directly without switching context. ## What can Credyt's MCP Server do?[​](#what-can-credyts-mcp-server-do "Direct link to What can Credyt's MCP Server do?") * **Products & pricing**: create, version, and manage products with usage-based, fixed, or hybrid pricing. Simulate usage events to verify pricing before going live. * **Customers**: create and look up customers, update their details, and link them to your own external IDs. * **Subscriptions**: subscribe customers to products, activate or deactivate subscriptions, and upgrade or downgrade to different product versions. * **Wallets**: inspect wallet balances and drill into individual account details, including pending transactions. * **Usage events**: submit metered usage events, retrieve event details with generated fees and profitability stats, and review event history per customer. * **Charges & adjustments**: create ad-hoc charges or directly credit and debit wallet accounts for gifts, external top-ups, and refunds. * **Vendors**: set up vendors to track costs associated with usage events and measure profitability. * **Profitability**: query revenue, costs, and margin across products, customers, and vendors. * **Assets**: create and manage custom credit units (tokens, minutes, credits, etc.) with exchange rates. **Example prompts you can use once connected:** > "Create a $29/month Pro plan that includes 1,000 API credits, renewing monthly." > "Show me the wallet balance and recent usage for customer cust\_abc123." > "Simulate 500 `api_call` events against the Pro plan's default version." ## Prerequisites[​](#prerequisites "Direct link to Prerequisites") * A Credyt account — sign up at [app.credyt.ai](https://app.credyt.ai/api/sign-up) * A Credyt API key (found in the **Developers** section of the dashboard) * An MCP-compatible AI client (Claude Code, Claude Desktop, Cursor, Codex, Windsurf, Gemini CLI, or GitHub Copilot) * Node.js installed (required for the `npx`-based setup commands below) Live vs. test mode There is a single MCP endpoint: `https://mcp.credyt.ai`. Whether you're operating in live or test mode is determined by the API key you use — generate separate live and test keys from [app.credyt.ai](https://app.credyt.ai). ## How to use the MCP Server[​](#how-to-use-the-mcp-server "Direct link to How to use the MCP Server") * AI Coding Agents * Vibe Coding Tools The fastest setup path is `npx add-mcp`, which writes the MCP config for your client automatically. * Claude Code * Claude Desktop * Cursor * Codex * Gemini CLI * GitHub Copilot * Windsurf **Step 1 — Connect the MCP server:** ```bash npx add-mcp \ https://mcp.credyt.ai \ --header "Authorization: Bearer key_your_api_key_here" ``` **Step 2 — Install the Credyt plugin** (adds guided skills as slash commands): ```text /plugin marketplace add credyt/ai-tools /plugin install credyt@credyt/ai-tools ``` This gives you `/credyt:billing-setup`, `/credyt:billing-verification`, and `/credyt:billing-integration` as slash commands on top of the raw MCP tools. **Automatic setup via `add-mcp`:** ```bash npx add-mcp "npx mcp-remote https://mcp.credyt.ai --header Authorization:\${CREDYT_API_KEY}" \ --name credyt \ --env "CREDYT_API_KEY=Bearer key_your_api_key_here" \ -a claude-desktop -y ``` Replace `key_your_api_key_here` with your key, then restart Claude Desktop. **Manual setup:** open **Settings → Developer → Edit config** and add: ```json { "mcpServers": { "credyt": { "command": "npx", "args": [ "mcp-remote", "https://mcp.credyt.ai", "--header", "Authorization:${CREDYT_API_KEY}" ], "env": { "CREDYT_API_KEY": "Bearer key_your_api_key_here" } } } } ``` Restart Claude Desktop after saving. ```bash npx add-mcp \ https://mcp.credyt.ai \ --header "Authorization: Bearer key_your_api_key_here" ``` `add-mcp` will detect your Cursor installation and write the config automatically. ```bash npx add-mcp \ https://mcp.credyt.ai \ --header "Authorization: Bearer key_your_api_key_here" ``` ```bash npx add-mcp \ https://mcp.credyt.ai \ --header "Authorization: Bearer key_your_api_key_here" ``` ```bash npx add-mcp \ https://mcp.credyt.ai \ --header "Authorization: Bearer key_your_api_key_here" ``` `add-mcp` doesn't support Windsurf. Instead, add the Credyt server directly to `~/.codeium/windsurf/mcp_config.json`: ```json { "mcpServers": { "credyt": { "serverUrl": "https://mcp.credyt.ai", "headers": { "Authorization": "Bearer key_your_api_key_here" } } } } ``` Then install the Credyt skills from your terminal: ```bash npx skills add credyt/ai-tools ``` Vibe coding tools (Lovable, Bolt, Replit, V0) connect the MCP server through their settings UI rather than the command line. Once connected, you send a single prompt to install the Credyt skills and set up billing in one go — no terminal needed. * Lovable * Bolt * Replit * V0 **Step 1 — Add the MCP server:** Open **Settings → Integrations → MCP Servers** and add a new server: | Field | Value | | ------------- | ------------------------------ | | Name | `credyt` | | URL | `https://mcp.credyt.ai` | | Authorization | `Bearer key_your_api_key_here` | **Step 2 — Set up billing:** Start a new chat and send: ```text Run 'npx skills add credyt/ai-tools' — then set up my Credyt billing ``` **Step 1 — Add the MCP server:** Open the chat input, click **(+) → Connectors → Manage connectors → Custom MCP server** and add a new server: | Field | Value | | ------------- | ------------------------------ | | Name | `credyt` | | URL | `https://mcp.credyt.ai` | | Authorization | `Bearer key_your_api_key_here` | **Step 2 — Set up billing:** Start a new chat and send: ```text Run 'npx skills add credyt/ai-tools' — then set up my Credyt billing ``` **Step 1 — Add the MCP server:** Open **Integrations → MCP Servers for Replit Agent → Add MCP server**: | Field | Value | | ------------- | ------------------------------ | | Name | `credyt` | | URL | `https://mcp.credyt.ai` | | Authorization | `Bearer key_your_api_key_here` | **Step 2 — Set up billing:** Start a new chat and send: ```text Run 'npx skills add credyt/ai-tools' — then set up my Credyt billing ``` **Step 1 — Add the MCP server:** Open **Settings → MCP Connections → Add MCP**: | Field | Value | | ------------- | ------------------------------ | | Name | `credyt` | | URL | `https://mcp.credyt.ai` | | Authorization | `Bearer key_your_api_key_here` | **Step 2 — Set up billing:** Start a new chat and send: ```text Run 'npx skills add credyt/ai-tools' — then set up my Credyt billing ``` ## AI Skills[​](#ai-skills "Direct link to AI Skills") Credyt ships guided AI Skills that walk your assistant through complete billing workflows. Unlike the raw MCP tools, Skills provide step-by-step instructions that keep the AI on track for complex multi-step tasks. | Skill | What it does | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `pricing-strategy` | Guides you through defining your pricing strategy before configuring any billing tooling. | | `billing-setup` | Discovers your pricing model through a guided conversation, then configures products, assets, and pricing via MCP. Runs a full end-to-end billing cycle verification automatically. | | `billing-verification` | Tests the full billing cycle for a specific product — creates a test customer, funds their wallet, sends a usage event, and confirms the fee was charged correctly. | | `billing-integration` | Wires Credyt into your application code. Adds customer creation at signup, usage event tracking, balance checks, billing portal links, and balance display. | **Claude Code** — skills are available as slash commands via the plugin installed above: Pricing strategy ```text /credyt:pricing-strategy ``` Billing setup ```text /credyt:billing-setup ``` Billing verification ```text /credyt:billing-verification ``` Billing integration ```text /credyt:billing-integration ``` **AI coding agents** (Claude Desktop, Cursor, Codex, Windsurf, Gemini CLI, GitHub Copilot) — install skills first, then use the prompts below: ```bash npx skills add credyt/ai-tools ``` Pricing strategy ```text Help me define my pricing strategy with Credyt ``` Billing setup ```text Set up my billing with Credyt ``` Billing verification ```text Verify my Credyt billing is working correctly ``` Billing integration ```text Integrate Credyt billing into my app ``` **Vibe coding tools** (Lovable, Bolt, Replit, V0) — skills are installed and run in one prompt, no terminal step needed: Pricing strategy ```text Run 'npx skills add credyt/ai-tools --skill pricing-strategy' — then help me define my pricing strategy with Credyt ``` Billing setup ```text Run 'npx skills add credyt/ai-tools --skill billing-setup' — then set up my Credyt billing ``` Billing verification ```text Run 'npx skills add credyt/ai-tools --skill billing-verification' — then verify my Credyt billing is working correctly ``` Billing integration ```text Run 'npx skills add credyt/ai-tools --skill billing-integration' — then integrate Credyt billing into my app ``` ## Available tools[​](#available-tools "Direct link to Available tools") The Credyt MCP Server exposes 31 tools across 9 domains. Descriptions match the tool schemas returned to your AI client. ### Customers[​](#customers "Direct link to Customers") | Tool | Description | | ----------------------------- | --------------------------------------------------------------------------------------- | | `create_customer` | Create a customer with optional product subscriptions and metadata. | | `get_customer` | Get a customer's full details including subscriptions, metadata, and external accounts. | | `list_customers` | List customers with optional filtering by external ID. | | `update_customer` | Update a customer's name, email, or external ID. | | `create_subscription` | Add a product subscription to an existing customer. | | `update_subscription` | Activate or deactivate a customer's subscription. | | `update_subscription_product` | Change the product version on a subscription to upgrade or downgrade the customer. | ### Products[​](#products "Direct link to Products") | Tool | Description | | ---------------- | ---------------------------------------------------------------------------------------------- | | `create_product` | Create a new product with pricing. Products define what you bill for. | | `get_product` | Get a product's details including all versions and default version pricing. | | `list_products` | List products with optional filtering by code. | | `delete_product` | Delete or archive a product. Products with active subscribers are archived instead of deleted. | ### Product versions[​](#product-versions "Direct link to Product versions") | Tool | Description | | ------------------------- | --------------------------------------------------------------------------------------------------------- | | `create_product_version` | Create a new version of an existing product with updated pricing, without affecting existing subscribers. | | `get_product_version` | Get details of a specific product version including its pricing configuration. | | `update_product_version` | Publish a draft version or make a published version the default. | | `archive_product_version` | Archive a product version. Archived versions cannot be modified or subscribed to. | ### Wallets[​](#wallets "Direct link to Wallets") | Tool | Description | | -------------------- | ------------------------------------------------------------------------------------ | | `get_wallet` | Get a customer's wallet with account balances. | | `get_wallet_account` | Get detailed balances for a specific wallet account, including pending transactions. | ### Usage events[​](#usage-events "Direct link to Usage events") | Tool | Description | | ---------------- | --------------------------------------------------------------------------------------------- | | `submit_events` | Submit usage events for a customer, identified by `customer_id` or `customer_external_id`. | | `get_event` | Get an event's details including generated usage fees and profitability stats. | | `list_events` | List usage events with optional filtering by customer, ordered by submission date descending. | | `simulate_usage` | Simulate usage events against a product version to test pricing before going live. | ### Charges & adjustments[​](#charges--adjustments "Direct link to Charges & adjustments") | Tool | Description | | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `create_charge` | Create an ad-hoc charge against a wallet account outside normal usage processing. | | `create_adjustment` | Directly credit or debit a wallet account. Use positive amounts to credit (gifts, top-ups, refunds) and negative amounts to debit. | ### Vendors[​](#vendors "Direct link to Vendors") | Tool | Description | | --------------- | ------------------------------------------------------------ | | `create_vendor` | Create a vendor to track costs associated with usage events. | | `get_vendor` | Get a vendor's details. | | `list_vendors` | List vendors with optional filtering by external ID. | ### Profitability[​](#profitability "Direct link to Profitability") | Tool | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | `get_analysis` | Get profitability analysis for an account, including overview metrics, performance over time, breakdowns, and grouped stats. | | `list_customer_stats` | List profitability stats for all customers, sorted by gross revenue descending. Includes a summary aggregating stats across all customers. | | `get_customer_stats` | Get lifetime profitability stats for a customer: gross revenue, total costs, net revenue, and margin. | | `get_vendor_stats` | Get aggregated cost stats for a vendor, broken down by category. | ### Assets[​](#assets "Direct link to Assets") | Tool | Description | | ---------------- | ------------------------------------------------------------------------------------------- | | `create_asset` | Create a custom asset (credits, tokens, coins, minutes, etc.) with optional exchange rates. | | `get_asset` | Get an asset's details including exchange rate history. | | `list_assets` | List all custom assets, sorted alphabetically by code. | | `add_asset_rate` | Add a new exchange rate for an asset. Closes the previous rate automatically. | | `quote_asset` | Get an exchange quote — how many asset units a given source amount buys. | *** For a deeper guide to integrating Credyt into your application using an AI coding assistant, see the [AI Integration Guide](https://docs.credyt.ai/ai-integration.md).