How to integrate Klarna MCP with Atomic Agent

Connect Atomic Agent to Klarna MCP. List recent klarna orders awaiting capture, retrieve details for klarna order 12345, and more using natural language, with authentication handled for you.

Klarna logoKlarna
Api Key

Klarna is a merchant payments platform for checkout, payments, orders, and settlements. It helps businesses offer flexible payment options with streamlined payment operations.

58 Tools

Introduction

Atomic Agent is an open-source AI agent that runs on your machine and supports local models through llama.cpp. Connect it to 1,700+ apps through Composio, including Klarna.

This guide uses Atomic Agent's built-in Composio integration. You need Atomic Agent v0.5.6 or later, your own Composio API key, and a Klarna account. See the Atomic Agent documentation for installation instructions.

Also integrate Klarna with

How Atomic Agent connects to Klarna

Atomic Agent connects to Composio's Tool Router over Streamable HTTP MCP. It discovers the tools needed for your request, and Composio handles account authentication.

Execution and account-connection tools follow Atomic Agent's configured approval policy. Review any approval prompt before allowing an action on your connected account.

Connect Klarna to Atomic Agent

  1. Sign up or sign in to the Composio dashboard. Copy your API key.
  2. In Atomic Agent, open the Integrations tab and select Composio. Select API key, press e, paste the key, and press Enter. The tools become available immediately, without a restart.
  3. Ask Atomic Agent to do something in Klarna. It searches Composio for the right tool.
  4. On first use, open the sign-in link returned in the chat. Connect your Klarna account, then return to Atomic Agent to continue.

Headless setup

Add the following line to ~/.atomic-agent/.env, replacing YOUR_COMPOSIO_API_KEY with your key. Start Atomic Agent after saving the file.

bash
COMPOSIO_API_KEY=YOUR_COMPOSIO_API_KEY

What is the Klarna MCP server, and what's possible with it?

The Klarna MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Klarna account. It provides structured and secure access to Klarna payments, checkout, orders, disputes, and payout data, so your agent can create payment sessions, manage orders, update shipping details, handle disputes, and retrieve payout reports on your behalf.

  • Payment and order management: Have your agent create payment sessions, acknowledge orders, capture payments, cancel eligible orders, or retrieve current order and payment details.
  • Checkout and hosted payment pages: Let the agent create and retrieve checkout sessions, create hosted payment page sessions, distribute payment links, or disable unfinished sessions.
  • Fulfillment updates: Direct your agent to add carrier and tracking details to orders or captures, extend authorization periods, and adjust eligible capture due dates.
  • Dispute handling: Instruct your agent to retrieve dispute details, download supporting attachments, accept a dispute loss, or enroll a merchant or partner account for dispute handling.
  • Payout reporting: Have your agent retrieve payout details and summaries, or download payout reports in PDF and CSV formats for selected date ranges.

Use Klarna from Atomic Agent

With your account connected, ask Atomic Agent to work with Klarna in natural language. You can connect more apps through the same Composio integration as you need them.

Visit the Atomic Agent website or inspect the Atomic Agent source code.

Troubleshooting

Why is my API key rejected?

Copy the key directly from the Composio dashboard. Atomic Agent requires ASCII characters because it sends the key in an HTTP header. Remove any extra characters introduced when copying.

Why are Composio tools unavailable after saving a key?

Check that you use Atomic Agent v0.5.6 or later and that Composio is enabled in your configuration. A "composio": { "enabled": false } setting disables the integration while keeping the saved key on disk.

Does Composio have a free plan?

The Hobby plan includes 100,000 tool calls per month. Composio-managed OAuth apps have a lower included allowance. See Composio pricing for the current limits that apply to your connection.

TOOLS

Supported Tools

Every Klarna action and event your agent gets out of the box.

Abort Checkout Order

Irreversibly abort an incomplete legacy Klarna Checkout order.

Accept Dispute Loss

Irreversibly request acceptance of the financial loss for a Klarna dispute.

Acknowledge Order

Acknowledge receipt of a Klarna order so order processing can continue.

Add Capture Shipping Info

Append shipping carrier and tracking information to a Klarna capture.

Add Order Shipping Info

Append shipping carrier and tracking information to a Klarna order.

Cancel Authorization

Irreversibly cancel a Klarna payment authorization before an order is created from it.

Cancel Order

Irreversibly cancel an uncaptured Klarna order that is not closed.

Capture Order

Irreversibly capture all or part of an authorized Klarna order and return the created capture ID.

Create Card Promise

Create a Klarna card promise for an order.

Create Card Settlement

Create a Klarna settlement for a completed order and issue its encrypted virtual cards.

Create Checkout Order

Create a legacy Klarna Checkout V3 order and return its checkout details.

Create Customer Token From Authorization

Create a reusable Klarna customer token from a payment authorization token for subscription purchases.

Create HPP Session

Create a Hosted Payment Page session from an existing Klarna Payments session or Checkout order URL.

Create Order From Authorization

Create a Klarna order from a customer authorization token.

Create Order From Customer Token

Create a Klarna order using a reusable customer token.

Create Payment Session

Create a Klarna Payments session and return its session ID, sensitive client token, and available payment method categories.

Disable HPP Session

Irreversibly disable a Klarna Hosted Payment Page session that has not completed.

Distribute HPP Session

Distribute a Klarna Hosted Payment Page link by email, SMS, or a documented token access ID.

Download Dispute Attachment

Download a merchant or customer evidence attachment from a Klarna payment dispute as a bounded file reference.

Download Payout PDF

Download the PDF settlement report for one payout.

Download Payouts Summary PDF

Download a PDF payout summary for a payout date-time range.

Download Payouts Summary Transactions CSV

Download a CSV summary of Klarna payouts and transactions for an inclusive payout date-time range.

Download Payout Transactions CSV

Download a CSV report containing one payout and its transactions.

Enroll Dispute Merchant

Irreversibly activate Disputes v3 handling for one direct Klarna merchant account.

Enroll Dispute Partner

Irreversibly activate Disputes v3 handling for one Klarna partner account.

Extend Capture Due Date

First call KLARNA_LIST_CAPTURE_DUE_DATE_OPTIONS for this order and capture, then extend the payment due date using one returned option.

Extend Order Authorization Time

Extend the authorization validity period for an order that is still AUTHORIZED and delayed unexpectedly.

Get Capture

Return one Klarna capture by order ID and capture ID.

Get Card Promise

Retrieve a Klarna card promise and its card specifications.

Get Card Settlement

Retrieve a Klarna card settlement by settlement ID or by its associated order ID.

Get Checkout Order

Return a legacy Klarna Checkout order by order ID.

Get Customer Token

Return a reusable Klarna customer token and its current status.

Get Dispute

Return a fully detailed Klarna Disputes v3 record, including associated merchant and customer evidence.

Get HPP Session

Return the current details and distribution state of a Klarna Hosted Payment Page session.

Get Order

Return a Klarna order and its current authorization, capture, refund, shipping, and customer details.

Get Payment Session

Return the current details of a Klarna Payments session by session ID.

Get Payout

Return one Klarna payout by payment reference.

Get Payout Summary

Return Klarna payout totals grouped by currency for an inclusive payout date-time range.

Get Refund

Return one Klarna refund by order ID and refund ID.

Get VCC Order Cancellation

Retrieve the asynchronous cancellation status for a Klarna order with a Virtual Credit Card settlement.

List Capture Due Date Options

List the due-date extension options available for a Klarna capture.

List Disputes

Return one page of Klarna Disputes v3 records using all documented filters.

List Order Captures

Return all captures recorded for a Klarna order.

List Payouts

Return one offset-controlled page of Klarna payouts, optionally filtered by payout date range and currency.

List Settlement Transactions

Return one offset-controlled page of Klarna settlement transactions, optionally filtered by payout reference or order ID.

Refund Order

Irreversibly create a full or partial Klarna refund and return the created refund ID.

Release Remaining Authorization

Irreversibly release the uncaptured authorization remaining on a Klarna order.

Request Customer Token Cancellation

Request asynchronous cancellation of a reusable Klarna customer token by changing its status to CANCELLED.

Request VCC Order Cancellation

Irreversibly request cancellation of a Klarna order associated with a Virtual Credit Card settlement.

Resend Capture Customer Communication

Irreversibly resend Klarna customer communication for a capture.

Respond to Dispute

Submit reason-specific merchant evidence for a Klarna dispute request.

Update Checkout Order

Update a legacy Klarna Checkout order and return the resulting order.

Update Order Authorization

Update the authorized amount and order lines on an existing order.

Update Order Customer Details

Update the permitted customer address details on an existing order.

Update Order Merchant References

Update the merchant reference values stored on a Klarna order.

Update Payment Session

Update mutable data on an existing Klarna Payments session, including order amounts and lines, customer and billing or shipping addresses, merchant references and URLs, purchase locale and currency, payment options, and session intent.

Upload Dispute Attachment

Upload one merchant evidence attachment to a Klarna payment dispute.

Upload Dispute Attachments

Upload 1-10 merchant evidence attachments to one Klarna payment dispute, sequentially in input order.

FAQ

Frequently asked questions

With a standalone Klarna MCP server, the agents and LLMs can only access a fixed set of Klarna tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Klarna and many other apps based on the task at hand, all through a single MCP endpoint.

Yes, you can. Atomic Agent fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Klarna tools.

Yes, absolutely. You can configure which Klarna scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Klarna data and credentials are handled as safely as possible.

Start with Klarna.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Klarna tool your agent needs.Free to start.

Start building