# MCP server

Connect AI agents such as Claude, ChatGPT, Cursor and Claude Code to your Kling account with the Kling MCP server, hosted at api.kling.is/mcp or run locally with npx @klingis/mcp.

The Kling MCP server ([Model Context Protocol](https://modelcontextprotocol.io)) lets AI agents create checkouts, payment links, products and customers, and read payments, subscriptions and revenue on your Kling account, in Icelandic krónur. It works with a Kling API key; start with a test key, so the agent can only touch test data.

## Hosted (nothing to install)

Kling runs the server at `https://api.kling.is/mcp` (Streamable HTTP). Send your API key as a bearer token.

Claude Code:

```bash
claude mcp add --transport http kling https://api.kling.is/mcp \
  --header "Authorization: Bearer sk_test_..."
```

Apps that only take a URL, such as custom connectors in Claude or ChatGPT: use `https://api.kling.is/mcp/<your-api-key>`. The **AI connector** card on the **API Keys & Docs** page in the dashboard gives you this link ready to copy. Treat it like a password.

## Local (stdio)

For Claude Desktop, Cursor, Windsurf and other clients that run MCP servers on your machine:

```json
{
  "mcpServers": {
    "kling": {
      "command": "npx",
      "args": ["-y", "@klingis/mcp"],
      "env": { "KLING_API_KEY": "sk_test_..." }
    }
  }
}
```

Claude Code:

```bash
claude mcp add kling --env KLING_API_KEY=sk_test_... -- npx -y @klingis/mcp
```

`KLING_API_KEY` is required (`KLING_SECRET_KEY` also works, so the `.env.local` that `kling init` writes is enough). `KLING_API_URL` defaults to `https://api.kling.is`.

## Tools

Create (not available with a read-only key):

- `create_checkout_session`, `create_payment_link`, `create_product`, `create_customer`, `create_webhook`

Read:

- `get_checkout_session`, `get_payment_intent`, `list_payment_intents`
- `list_products`, `list_customers`, `list_subscriptions`, `get_subscription`, `list_webhooks`
- `revenue_report`, `mrr_report`, `subscription_breakdown`, `subscription_movement_report`, `cohort_retention_report`, `payment_outcomes_report`, `top_customers_report`
- `get_api_docs`: the Kling API reference, so the agent can write integration code against it

For reporting only, create a read-only key on the API keys page; the agent then gets only the read tools.

## Try it

Ask your agent: "Create a Kling payment link for 4.990 kr." or "What was my revenue last month?"
