Overview
Connect Affonso to the Codex CLI, IDE extension, or ChatGPT desktop app to manage your affiliate program without leaving your coding 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 Codex configuration.
Connect with OAuth
Step 1: Add the server
Run the following command in your terminal:Step 2: Sign in to Affonso
Start the OAuth flow:Step 3: Verify the connection
/mcp to see the active server. You can now ask Codex to use Affonso, for example:
Connect with an API Key
Use an API key when OAuth is not available in your environment.1
Create an environment variable
Get an API key from the Affonso dashboard, then expose it in the shell where you run Codex:
2
Add the server
~/.codex/config.toml.
Manual Configuration
If you prefer to edit the configuration file, add this to~/.codex/config.toml:
Troubleshooting
OAuth sign-in does not open
OAuth sign-in does not open
Run
codex mcp login affonso in an interactive terminal. If Codex prints an authorization URL instead of opening a browser, open that URL manually and complete the sign-in flow.The Affonso server is not listed
The Affonso server is not listed
Run
codex mcp list to confirm the configuration. Then restart Codex and use /mcp to check its status.API-key authentication fails
API-key authentication fails
Confirm that
AFFONSO_API_KEY is available in the same shell that starts Codex 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 Codex
