An autonomous agent can hit its free-tier ceiling, purchase a Pro upgrade, and keep working โ with no human in the loop โ using the Dodo Payments MCP server.
Instead of exposing hundreds of API endpoints as separate tools, Dodo uses just 2 tools โ keeping the agent's context window lean and execution fast:
docs_search โ searches Dodo documentation.code_execution โ writes + runs TypeScript in a sandbox against the Dodo SDK.Add Dodo's knowledge + payments MCP servers to the agent's MCP config (alongside AgentMemo's memory server).
{
"mcpServers": {
"dodo-knowledge": {
"command": "npx",
"args": ["-y", "mcp-remote@latest",
"https://knowledge.dodopayments.com/mcp"]
},
"dodopayments": {
"command": "npx",
"args": ["-y", "mcp-remote@latest",
"https://mcp.dodopayments.com/sse"]
}
}
}curl -X POST https://agentmemo.dev/signup \ -H "Content-Type: application/json" \ -d '{"name": "my-agent"}'
{
"api_key": "am_sk_xxx",
"tier": "free",
"upgrade_via_mcp": {
"dodo_mcp": "https://mcp.dodopayments.com/sse",
"product_id": "pdt_0NhKvw8RSLuiPu2bD2IQH"
}
}The agent calls the code_execution tool to run TypeScript against the Dodo SDK:
import DodoPayments from "dodopayments"; const client = new DodoPayments({ bearerToken: process.env.DODO_PAYMENTS_API_KEY }); const subscription = await client.subscriptions.create({ product_id: "pdt_0NhKvw8RSLuiPu2bD2IQH", quantity: 1, metadata: { agentmemo_key_id: YOUR_PUBLIC_KEY_ID } }); console.log("Subscribed:", subscription.id);
Pass your public key ID (am_pk_xxx), never your secret key (am_sk_xxx). Your secret stays on your side only. This also enables automatic Pro upgrade without an email address โ perfect for fully autonomous agents.
Dodo fires a signed webhook to agentmemo.dev/webhooks/dodo. AgentMemo reads metadata.agentmemo_key_id, matches it to your key, and upgrades it to Pro automatically (falling back to customer email if no metadata key id is present). The agent now has unlimited memory operations โ its very next /memory/store call already runs on Pro.
Discovery โ payment โ upgrade is fully programmatic. This is what fully autonomous agent operation looks like.