Connect Claude Code

Connect Harmonize MCP to Claude Code, Anthropic's assistant that runs in your terminal.

Before you start: every user must first join their Harmonize organization. See MCP Setup Guide. You also need a Claude Pro, Max, Team, Enterprise or Console account (the free claude.ai plan does not include Claude Code) and a terminal on macOS, Linux or WSL, or PowerShell on Windows. Commands are labeled by platform where they differ. Unlabeled commands work on every platform.

Install Claude Code and sign in

Every user, once per machine

  1. Open a terminal and run the installer for your platform. It shows no progress while it downloads, so give it a minute.

    macOS, Linux or WSL

    Bash
    curl -fsSL https://claude.ai/install.sh | bash
    

    Windows PowerShell (the remaining steps are the same)

    PowerShell
    irm https://claude.ai/install.ps1 | iex
    
  2. Open a new terminal and confirm the install. You should see a version number such as 2.1.xxx (Claude Code).

    Bash
    claude --version
    
  3. If you see command not found or 'claude' is not recognized, add the install folder to your PATH with the command for your platform, then run claude --version again.

    macOS

    Bash
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
    

    Linux or WSL

    Bash
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
    

    Windows PowerShell (then open a new PowerShell window)

    PowerShell
    $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
    [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
    

    On a Mac set to the older Bash shell, use ~/.bash_profile in place of ~/.zshrc.

  4. Run claude and choose your account type: a Claude subscription (Pro, Max, Team or Enterprise) or an Anthropic Console account. A browser window opens for sign-in. On a VM or over SSH it may not open: press c to copy the login URL, paste it into the browser on your own computer, and paste the code back into the terminal if one is shown.

  5. When the terminal shows Login successful, press Enter.

Add Harmonize MCP and sign in

Every user, once per machine

Already connected Harmonize in claude.ai? If you sign in to Claude Code with that same Claude subscription (not an API key or Console account), Harmonize is already available. Start a new session and look for claude.ai Harmonize in /mcp. If you see it, skip the steps below and go to Start asking. If it's only listed under Show unused connectors, you haven't connected it in claude.ai yet: connect it at claude.ai › Customize › Connectors, then start a new session. If it's missing, run /status to check how you're signed in.

  1. Add the server in a normal terminal. --scope user makes Harmonize available in every folder. Replace <client-id> with the OAuth client ID: please refer to the Connection Guide in your onboarding email.

    macOS, Linux or WSL

    Bash
    claude mcp add --transport http --scope user harmonize https://mcp.optimizedpayments.com/mcp \
      --client-id <client-id> --callback-port 8787
    

    Windows PowerShell

    PowerShell
    claude mcp add --transport http --scope user harmonize https://mcp.optimizedpayments.com/mcp `
      --client-id <client-id> --callback-port 8787
    

    You should see Added HTTP MCP server harmonize. The status says Needs authentication until you sign in.

  2. Sign in to Harmonize:

    Bash
    claude mcp login harmonize
    

    A login URL opens in your browser, or is printed in the terminal. Enter your Organization ID, followed by your email address and password for Harmonize. If your company uses single sign-on, you'll be sent to your company's sign-in page instead of entering a Harmonize password. You may occasionally need to sign in again.

  3. If the browser shows ‘can’t reach this page’: this is normal on a remote VM or over SSH. After you sign in, the browser is sent to http://localhost:8787/callback. Copy the full URL from the address bar and paste it into the terminal prompt. Over plain SSH, connect with ssh -t so the paste prompt works.

  4. Confirm it's connected. harmonize should show ✔ Connected.

    Bash
    claude mcp list
    

    If sign-in said it was successful but claude mcp list still shows Needs authentication, run claude mcp login harmonize again.

Important: keep --client-id and --callback-port 8787 exactly as shown. Without the client ID you'll see "does not support dynamic client registration"; with another port you'll see "callback URL mismatch". No client secret is needed. If port 8787 is already in use, close the app using it and try again.

Start asking

Every user

  1. Start a session in the folder you want to work in: cd ~/your-project, then claude.

  2. Type /mcp. harmonize (or claude.ai Harmonize) should show ✔. Select it to see its tools, then press Esc.

  3. Ask a question. Mentioning "Harmonize MCP" nudges Claude to use it, but it isn't required.

  4. The first time Claude calls a Harmonize tool it asks for permission. Choose Yes to allow it once, or the "don't ask again" option to allow that tool from then on.

Test it: ask "Using Harmonize MCP, how did Visa authorization approval rates trend last quarter?" More examples in MCP Example Questions and Troubleshooting.

If something goes wrong

  • Harmonize works in one folder but not another: it was added without --scope user. Run claude mcp remove harmonize, then add it again with the full command above.

  • Harmonize shows "Needs authentication": run claude mcp login harmonize, or open /mcp inside a session and choose to authenticate.

  • "Callback URL mismatch": the callback port must be 8787. Remove the server and add it again with --callback-port 8787.

  • "Does not support dynamic client registration": the --client-id flag is missing. Remove the server and add it again with the full command.

  • "MCP server harmonize already exists": run claude mcp remove harmonize first, then add it again.

  • Switch Harmonize accounts: run claude mcp logout harmonize, then claude mcp login harmonize.

  • Anything else: email [email protected] with the output of claude mcp get harmonize and the time of the attempt.