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: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:Step 3: Verify the connection
/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:
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
OAuth sign-in does not open
OAuth sign-in does not open
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.The Affonso server is pending approval
The Affonso server is pending approval
Start an interactive Claude Code session in the project and approve the configured MCP server. Project-scoped servers require approval before they can run.
API-key authentication fails
API-key authentication fails
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
