As AI agents and the Model Context Protocol (MCP) ecosystem grow, developers need a frictionless way to charge for usage, and users need a seamless way to pay.AgentPay is the payments layer for MCP Servers, purpose-built for the agent economy.It integrates with the latest MCP standards and tooling, making it effortless for MCP Developers to monetize and for MCP Users to connect and pay.
Before we delve into the architecture of how it works, let’s simplify the core concept.
Typical AI Service
Imagine the way you currently interact with many modern AI services (like OpenAI, Anthropic, or various cloud APIs). You typically sign up, get an API key, and preload a balance. Your API key then grants you access, and you’re billed against your balance based on your usage.AgentPay brings this familiar, battle-tested model to the world of MCP Servers.
For MCP Users ⎯ It’s like having a universal access pass:
You maintain an AgentPay account with a single balance.
When you want to use a specific MCP Server that’s integrated with AgentPay, you obtain a unique API Key for that server.
You then add your API Key to your MCP client configuration (e.g. Claude, Cursor) to use this key to make requests.
If the tool has a cost, AgentPay seamlessly deducts it from your balance upon successful use.
No complex per-server payment setups, just straightforward, metered access.
For MCP Developers ⎯ It’s your turnkey monetization solution:
You’ve built valuable features ⎯ tools, resources, prompts, and more ⎯ on your MCP Server.
By integrating AgentPay, you can define a price for each usage of each feature, and start earning immediately.
When an authenticated user (with a valid API Key and sufficient balance) successfully uses a feature, AgentPay handles the balance transfer to your earnings, which are then paid out to you.
No need to build and maintain your own complex infrastructure for payments, API, or metering, just one simple, flexible integration.
At its heart, AgentPay establishes a clear, trusted, and standardized “pay-as-you-go” relationship between MCP Users and MCP Server Developers, all facilitated by API keys and managed balances, and built to conform with MCP standards. This allows developers to focus on building great tools and users to access them with ease and transparency.
AgentPay provides a standardized, end-to-end solution for MCP Servers to manage access and bill for usage from MCP Clients. It provides API Keys for Users and Service Tokens for Developers, allowing AgentPay to:
Authenticate requests from MCP Clients to MCP Servers.
Track usage of MCP Server resources.
Handle payments, like user balances and developer payouts.
Generally speaking, there are three key aspects to understand:
Once setup is complete, here’s how a typical interaction unfolds when an MCP Client makes a request to an MCP Server:
MCP Client (with API Key configured) ⎯ When called by the User or Agent:
Makes a request to the remote MCP Server.
Sends the User’s API Key to the target MCP Server as part of the request (typically in a header).
MCP Server (with AgentPay SDK integrated) ⎯ Upon receiving a request:
Extracts the User’s API Key (e.g. using AgentPay SDK auth helpers).
(Optionally) Validates the API Key via the AgentPay Service.
Processes the client’s request (executes its core tool logic).
If the tool logic is successful, it consumes the User’s balance via the AgentPay Service (using the SDK, the User’s API Key, and its own Service Token) for an agreed amount_cents.
AgentPay Service (via the AgentPay SDK) ⎯ The core AgentPay backend service which:
Validates API Keys and Service Tokens.
Processes usage requests by debiting the user’s balance and crediting the developer’s earnings.
Manages the ledger for all balances and transactions.