Alpha Notice: These docs cover the v1‑alpha release. Content is incomplete and subject to change. Expect breaking changes.
For production, pin versions and review the Install guide before shipping.
1
Initialize the SDK
Create a
PayLink client that points to your MCP server.
Here we use a local M‑Pesa server at http://localhost:5002/mcp.2
List available tools
Tools are server‑exposed actions.
list_tools() returns names and metadata
so you can call them by name. In this quickstart, only stk_push is available.3
Initiate a payment (STK Push)
STK Push prompts the customer to approve payment on their phone.
Send the fields below, parse the JSON response, and check
status.- SDK initialized to your MCP server
- Tools listed and how to call them
- STK Push payment initiated and response parsed