Skip to main content

Overview

Connect Affonso to Claude Code to manage your affiliate program from your development workflow. Affonso uses the Streamable HTTP transport and supports OAuth 2.1 and API-key authentication.
OAuth is recommended. It keeps your Affonso API key out of your Claude Code configuration.

Connect with OAuth

Step 1: Add the server

Run this command in your terminal:
The user scope makes Affonso available in every local Claude Code project. Omit --scope user to limit it to the current project.

Step 2: Sign in to Affonso

Start the OAuth flow:
Your browser opens automatically. Sign in to Affonso, choose your team if prompted, and approve the requested permissions.

Step 3: Verify the connection

Start Claude Code and enter /mcp to check the server status. You can now ask Claude Code something like:

Connect with an API Key

Use an API key when OAuth is not available in your environment.

Step 1: Create an environment variable

Get an API key from the Affonso dashboard, then expose it in the shell where you run Claude Code:

Step 2: Add a project configuration

Create or update .mcp.json in your project root:
Claude Code expands AFFONSO_API_KEY when it connects, so do not put the key itself in .mcp.json or commit it to version control. When Claude Code first loads a project-scoped MCP server, review and approve it in the interactive session.

Troubleshooting

Run claude mcp login affonso in an interactive terminal. If your browser cannot open automatically, Claude Code prints an authorization URL that you can open manually.
Start an interactive Claude Code session in the project and approve the configured MCP server. Project-scoped servers require approval before they can run.
Confirm that AFFONSO_API_KEY is available in the same shell that starts Claude Code and that the key is active in the Affonso dashboard.

Next Steps

Explore Tools

See all available MCP tools

Example Queries

Try Affonso prompts in Claude Code