# MCP

Source: https://docs.formance.com/mcp

Stack: v3.2

Connect your AI assistant to Formance Cloud through the hosted Model Context Protocol (MCP) server at `https://mcp.formance.cloud/mcp`.
This guide connects your client so you can list your stacks and inspect their financial data.
The server also provides Numscript validation and sandbox management tools.

## Connect your MCP client

You need a [Formance Cloud account](https://portal.formance.cloud) and an MCP client that supports Streamable HTTP and OAuth authentication.
The hosted server handles the connection to your stacks. You do not need to install `fctl` or enable the MCP module on each stack.

Configure your client to use `https://mcp.formance.cloud/mcp`:

Claude Code

From your project directory, add the remote server:

```bash
claude mcp add --transport http formance https://mcp.formance.cloud/mcp
```

This registers Formance for the current project. In Claude Code, run `/mcp`, select **formance**, and authenticate with your Formance Cloud account.
Review the requested permissions and approve access to complete the connection.

Codex

Add the server to your Codex configuration:

```toml title="~/.codex/config.toml"
[mcp_servers.formance]
url = "https://mcp.formance.cloud/mcp"
```

From your terminal, start the OAuth sign-in:

```bash
codex mcp login formance
```

Sign in with your Formance Cloud account in the browser, review the requested permissions, and approve access.
In a Codex session, run `/mcp` to check the connection.

For other compatible clients, add a remote MCP server with the same URL and follow the client's OAuth sign-in flow.

## Verify the connection

Ask your assistant:

> List the Formance stacks I can access, including their IDs and available modules.

The assistant uses `stack_list` to return the stacks available in your authenticated organization.
Choose a stack from that result before asking the assistant to inspect its data. Stack-specific tools take the returned `stack_id`.

For example, ask:

> On the stack I selected, list the ledgers and show the latest transactions in one of them.

The available data depends on your permissions and the modules enabled on that stack.
If a module is unavailable, select a stack that provides it. If access is denied, check your account's access in Formance Cloud.

## Available capabilities

| Area           | Capabilities                                                                                   |
| -------------- | ---------------------------------------------------------------------------------------------- |
| Stacks         | List accessible stacks and inspect their enabled modules.                                      |
| Sandboxes      | List available versions, create or disable a sandbox stack, and enable or disable its modules. |
| Ledger         | Read ledgers, accounts, balances, volumes, transactions, and related metadata.                 |
| Payments       | Read payments, accounts, bank accounts, pools, payment initiations, connectors, and tasks.     |
| Reconciliation | Read reconciliation records.                                                                   |
| Numscript      | Validate a script before using it in a ledger workflow.                                        |

Ledger, Payments, and Reconciliation tools read data without modifying it.

Stack creation, disabling, and module changes are limited to the hosted service's sandbox region and remain subject to your permissions and sandbox quota.
Module availability depends on the stack's version and configuration.

The MCP server can expose financial data to your assistant and change sandbox stacks.
Use a trusted client and review the requested permissions and tool calls before approving them.
