Turn your MCP server into a business.
Portmii adds authentication, paid access and usage limits to the MCP server you already host. Customers buy from you, on your Stripe account. You set price, billing rules and terms. Your tools keep running in your infrastructure.
Before you start
- A running MCP server and a Portmii account.
- A Stripe account for paid plans, plus access to your server code.
What you’ll have
A plan for selling access to your MCP tools, with a clear integration and test path.
Decide what customers receive.
Choose the tools your plan unlocks and how many calls it includes. Give the plan a clear name and describe its value in terms your customers use.
Set the price for each plan. Portmii creates the matching price on your Stripe account and passes the subscription status to your server, which decides whether a customer can use your tools.
MCP preview. Contact us to confirm availability before integrating. Ask about MCP.
Connect your server and plan.
Add your MCP server to Portmii, link your Stripe product and define access rules. These rules connect each customer’s identity and plan to the tools they can use.
Set the product’s authMode to API_KEY, OAUTH or API_KEY_AND_OAUTH. In the SDK, use the matching authType: API_KEY, OAUTH or OAUTH_OR_API_KEY. Keep provider credentials on the server and out of browser code, public repositories and logs.
Check access before running a tool.
With the TypeScript SDK, set PORTMII_PROVIDER_KEY and call createPortmii with authType, your public HTTPS serverUrl and onUnavailable. onUnavailable is required: deny or allow decides whether tools run while Portmii cannot answer. Mount portmii.auth before the MCP HTTP route and wrap each registered handler with portmii.tool(name, handler). The SDK supports Node.js 20.19+ or 22.12+ and official MCP SDK v1 and v2. On Python, the Python integration provides the same portmii.auth and portmii.tool flow for the official MCP Python SDK 2.x.
The wrapper reserves usage, commits when the handler resolves and releases when it throws. Throw for failed calls that should not consume usage; returning { isError: true } still commits. Other languages can use the HTTP Runtime API for the same reserve, commit and release flow.
Check runtime readiness and product access in your deployment. The API reference covers configuration, request fields, retry behavior and downloadable examples.
Test the whole customer journey.
Try a customer with an active plan, a customer whose subscription has ended and a customer who has reached the usage limit. Confirm that only the allowed request runs the tool.
Use test billing data first. Check the access decision and usage record together, then review your live Stripe setup before inviting paying customers.