Skip to main content
The FlexPrice MCP server exposes the FlexPrice API as tools for AI assistants. Manage customers, plans, subscriptions, invoices, and events directly from Claude, Cursor, VS Code, or any MCP-compatible client.

Prerequisites

Node.js

Version 20 or higher

npm

Or yarn/pnpm/bun

Quick Start

Run the MCP server with one command:
npx @flexprice/mcp-server start \
  --server-url https://us.api.flexprice.io/v1 \
  --api-key-auth YOUR_API_KEY
Replace YOUR_API_KEY with your FlexPrice API key. Next: Add to your MCP client.

Installation Methods

The base URL must include /v1 with no trailing slash: https://us.api.flexprice.io/v1

Add to Your MCP Client

Configure the FlexPrice MCP server in your AI assistant or editor.

Cursor

1

Open Cursor Settings

Go to Cursor → Settings → Cursor Settings and click the MCP tab
2

Add MCP server configuration

Add this JSON configuration:
{
  "mcpServers": {
    "flexprice": {
      "command": "npx",
      "args": [
        "-y",
        "@flexprice/mcp-server",
        "start",
        "--server-url",
        "https://us.api.flexprice.io/v1",
        "--api-key-auth",
        "YOUR_API_KEY"
      ]
    }
  }
}
3

Verify connection

Open the MCP panel in Cursor to confirm the server is connected and list available tools

VS Code

1

Open MCP configuration

Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run:
  • MCP: Open User Configuration, or
  • MCP: Add Server
2

Add server configuration

Add this configuration:
{
  "servers": {
    "flexprice": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@flexprice/mcp-server",
        "start",
        "--server-url",
        "https://us.api.flexprice.io/v1",
        "--api-key-auth",
        "YOUR_API_KEY"
      ]
    }
  }
}

Claude Code

Add the server via the CLI:
claude mcp add flexprice -- npx -y @flexprice/mcp-server start \
  --server-url https://us.api.flexprice.io/v1 \
  --api-key-auth YOUR_API_KEY
Then run claude and use /mcp to confirm connection.

Claude Desktop

1

Locate configuration file

Open the Claude Desktop config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
2

Add server configuration

Add this configuration:
{
  "mcpServers": {
    "flexprice": {
      "command": "npx",
      "args": [
        "-y",
        "@flexprice/mcp-server",
        "start",
        "--server-url",
        "https://us.api.flexprice.io/v1",
        "--api-key-auth",
        "YOUR_API_KEY"
      ]
    }
  }
}
3

Restart Claude Desktop

Quit and reopen Claude Desktop to load the server

Available Tools

The MCP server exposes FlexPrice API operations as tools. Only operations with certain OpenAPI tags are included (e.g., Customers, Invoices, Events, Plans, Subscriptions). Common tools include:
  • Customers: createCustomer, listCustomers, getCustomer, updateCustomer
  • Events: ingestEvent, listRawEvents
  • Invoices: listInvoices, getInvoice, createInvoice
  • Plans: listPlans, getPlan, createPlan
  • Subscriptions: createSubscription, listSubscriptions, cancelSubscription
For the complete list, check your MCP client’s tool list after connecting or review the filtered OpenAPI spec (docs/swagger/swagger-3-0-mcp.json).

Dynamic Mode (Progressive Discovery)

For large tool sets, dynamic mode reduces context size by exposing meta-tools for on-demand discovery:
  • list_tools – List available tools with descriptions
  • describe_tool – Get input schema for specific tools
  • execute_tool – Run a tool by name with parameters
Enable dynamic mode by adding --mode dynamic:
{
  "mcpServers": {
    "flexprice": {
      "command": "npx",
      "args": [
        "-y",
        "@flexprice/mcp-server",
        "start",
        "--server-url",
        "https://us.api.flexprice.io/v1",
        "--api-key-auth",
        "YOUR_API_KEY",
        "--mode",
        "dynamic"
      ]
    }
  }
}
Dynamic mode is recommended for servers with many tools to improve token efficiency and tool selection.

Scopes (Optional)

Limit tools by scope for read-only or restricted access:
npx @flexprice/mcp-server start \
  --server-url https://us.api.flexprice.io/v1 \
  --api-key-auth YOUR_API_KEY \
  --scope read
Use read for read-only operations when the server defines scope-based restrictions.

Example Usage

Once connected, ask your AI assistant to perform FlexPrice operations:
Create a new customer with email john@example.com and name "John Doe"

Alternative Configurations

Local Repository (Node)

For running from a cloned repo:
{
  "mcpServers": {
    "flexprice": {
      "command": "node",
      "args": ["/path/to/mcp-server/bin/mcp-server.js", "start"],
      "env": {
        "API_KEY_APIKEYAUTH": "your_api_key_here",
        "BASE_URL": "https://us.api.flexprice.io/v1"
      }
    }
  }
}

Docker

For Docker-based stdio:
{
  "mcpServers": {
    "flexprice": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "API_KEY_APIKEYAUTH", "-e", "BASE_URL", "flexprice-mcp"],
      "env": {
        "API_KEY_APIKEYAUTH": "your_api_key_here",
        "BASE_URL": "https://us.api.flexprice.io/v1"
      }
    }
  }
}

Troubleshooting

  • Ensure BASE_URL or --server-url is set to https://us.api.flexprice.io/v1 (no trailing slash)
  • Verify the base URL includes /v1
  • Test the API key: curl -H "x-api-key: YOUR_KEY" https://us.api.flexprice.io/v1/customers
  1. Credentials: Verify API key and base URL are correct
  2. Network: Check firewall/proxy settings
  3. Rate limiting: Reduce request frequency if hitting rate limits
  • Restart your MCP client after adding configuration
  • Check for JSON syntax errors in config file
  • Verify Node.js 20+ is installed: node --version
Run npm install and npm run build in the server directory
  • Check logs: docker logs <container_id>
  • Verify environment variables are passed correctly
  • Try docker run -it --rm flexprice-mcp printenv to inspect env

Regenerating the Server

The MCP server is generated from a filtered OpenAPI spec. To regenerate after API changes:
1

Update API spec

Run make swagger from the repo root to regenerate the OpenAPI spec
2

Filter spec for MCP

Run make filter-mcp-spec to create the filtered spec with allowed tags
3

Generate MCP server

Run make sdk-all to regenerate all SDKs including the MCP server
4

Merge custom files

Run make merge-custom to merge custom README and code into the output
See the main repository README and AGENTS.md for detailed SDK/MCP generation and publishing workflows.

Next Steps

API Reference

Complete FlexPrice API documentation

MCP Specification

Learn more about Model Context Protocol

NPM Package

View package on npm

GitHub Repository

MCP server source code