A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/blustAI/paymcp below:

blustAI/paymcp: Provider-agnostic payment layer for MCP (Model Context Protocol) tools and agents.

Provider-agnostic payment layer for MCP (Model Context Protocol) tools and agents.

paymcp is a lightweight SDK that helps you add monetization to your MCP-based tools, servers, or agents. It supports multiple payment providers and integrates seamlessly with MCP's tool/resource interface.

The payment_flow parameter controls how the user is guided through the payment process. Choose the strategy that fits your use case:

All flows require the MCP client to support the corresponding interaction pattern. When in doubt, start with TWO_STEP.

Install the SDK from PyPI:

Initialize PayMCP:

from mcp.server.fastmcp import FastMCP, Context
from paymcp import PayMCP, price, PaymentFlow

mcp = FastMCP("AI agent name")
PayMCP(
    mcp,  # your FastMCP instance
    providers={
        "provider_name": {"apiKey": "your-api-key-here"},
    },
    payment_flow=PaymentFlow.ELICITATION
)

Use the @price decorator on any tool:

@mcp.tool()
@price(amount=0.19, currency="USD")
def add(a: int, b: int, ctx: Context) -> int:
    # `ctx` is required by the PayMCP tool signature — include it even if unused
    return a + b

Demo server: For a complete setup, see the example repo: python-paymcp-server-demo.

MIT License


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4