> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upflow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# [LEGACY] Connect Claude Code with an API key

> Legacy API-key setup for Claude Code CLI. New integrations should use the OAuth flow.

<Warning>
  **API-key authentication for the Upflow MCP server is being deprecated and will stop working at the end of June 2026.** If you set up MCP via Claude Code CLI with an API key, switch to the OAuth flow before then — see [Connect Claude](/en-us/technical-documentation/mcp-server/connect-claude). OAuth is simpler, supports every standard AI client (including Claude Desktop and ChatGPT), and removes the shared-key risk.

  This article is kept available until the deprecation date so existing integrations have a reference for the current setup. After 30 June 2026 it will be removed.
</Warning>

Estimated setup time: **\~8 minutes**.

Use this guide to set up the Upflow MCP server in **Claude Code (CLI)** using API-key authentication.

## Limitations

This flow only supports the Claude Code CLI. It does not work with Claude Desktop, ChatGPT, or other AI clients that require OAuth.

* MCP authentication relies on **Upflow API credentials**, which grant **read-only admin access** across the entire organization.
* API credentials are **scoped to a single organization**. To connect to multiple organizations, you'll need to repeat the setup for each one.

## Prerequisites

* Connect with your CSM so we can confirm:
  * The current status of the MCP Server and that we can support your use case.
  * That your technical team understands the authentication constraints.
* Once confirmed, the Upflow team will activate the feature so you can start using it.

<br />

## Step 1 — Collect your connection parameters

1. In the Upflow app, go to [**Organization settings → Apps → API**](https://app.upflow.io/organization/-/settings/api).
2. Copy the following values:
   * **Host**
   * **Key**
   * **Secret**
3. For the **MCP host**, take the Host value and **append** `/mcp` at the end.
   * Example: `https://api.upflow.io` → `https://api.upflow.io/mcp`
4. For **User email**, use:
   * Your own email, or
   * Any email belonging to a member of the same organization.

You should now have:

* `Host` (with `/mcp` at the end)
* `Key`
* `Secret`
* `User_email`

<br />

## Step 2 — Add Upflow MCP to Claude Code

If you don't have Claude Code yet, follow [Claude Code's quickstart](https://code.claude.com/docs/en/quickstart) to install it. You'll need a Claude Code subscription.

Install Claude Code by running this command in your terminal:

```text theme={null}
curl -fsSL https://claude.ai/install.sh | bash
```

This will prompt you to add Claude Code to your path — copy and paste the command into your terminal.

Then start Claude Code:

```text theme={null}
claude
```

After setting up your preferences, you'll be prompted to log in. Select **Option 2** to open a browser tab and log in with your Google account. When done, quit Claude Code.

Finally, run this command in your terminal (not inside Claude Code), replacing the `<...>` placeholders with the values from Step 1:

```text theme={null}
claude mcp add --transport http <MCP_Name> <Host> \
  --header "X-API-Key: <Key>" \
  --header "X-API-Secret: <Secret>" \
  --header "X-API-User: <User_email>"
```

The convention for naming your MCP server is `upflow-api-<Org_Name>`. If you only need a single organization, you can use `upflow-api`.

<br />

## Step 3 — Verify the connection

Start Claude Code:

```text theme={null}
claude
```

Then verify your MCP connection inside Claude Code:

```text theme={null}
/mcp
```

You should see your MCP server with status `🟢 connected`.

Try one of these prompts:

* **Top debtors** — *Who are the top 5 debtors by outstanding balance?*
* **Recent collections** — *How much have we collected since the beginning of the month?*
* **Customer contact** — *Who is the main contact for \[customer name]?*

<br />

## Troubleshoot

**Verify the MCP entry in Claude configuration**

Open the file `/Users/<your_username>/.claude.json` and check for the `mcpServers` entry.

* If the file doesn't exist, verify your Claude Code installation.
* If there's no `mcpServers` entry, retry Step 2.

**MCP server already exists**

If the command in Step 2 returns an error, you may have already added the server. List existing MCP servers:

```text theme={null}
claude mcp list
```

If you see a server with the same name, delete it:

```text theme={null}
claude mcp remove <mcp_name>
```

Then run the Step 2 command again.

<br />

## Related articles

* [Connect Upflow to your AI client (overview)](/en-us/technical-documentation/mcp-server/overview)
* [Connect Claude](/en-us/technical-documentation/mcp-server/connect-claude)
