Payhere MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Payhere MCP or direct API to create payment links, check payment status, list transactions, and manage customers through natural language.

Payhere logoPayhere
Api Key

Payhere is a simple online payment platform for creating and sharing payment links. It makes collecting payments fast and hassle-free for businesses and freelancers.

13 Tools

Try Payhere now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Payhere
Try asking
TOOLS

Supported Tools

Every Payhere action and event your agent gets out of the box.

Create Hook

Tool to subscribe to a REST hook for receiving webhook events.

Create Plan

Create a Payhere payment plan for accepting one-off payments or recurring subscriptions.

Delete Hook

Tool to remove a REST hook listener subscription.

Get Current Company

Tool to fetch company information for the currently authenticated user.

Get Current Company Stats

Tool to fetch payment statistics for the last 30 days with comparison data from the preceding 30-day period (30-60 days ago).

Get User

Tool to fetch information on the currently authenticated user.

List Customers

Tool to list all customers from Payhere, ordered chronologically with most recent first.

List REST Hooks

Tool to list all active REST hooks subscriptions for the authenticated company.

List Payments

List Payhere payments in reverse chronological order to review payment history or check payment statuses.

List Plans

Tool to list all plans in your PayHere account.

List subscriptions

Tool to list all subscriptions ordered chronologically by most recent payment first.

Update Current Company

Tool to update the company information for the currently authenticated user.

Update Plan

Tool to update an existing plan's configuration and settings.

SETUP GUIDE

Connect Payhere MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["payhere"],
  mcp: true,
});
Create a session scoped to Payhere and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Create a payment link for $50 with the description \"Consultation Fee\"",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Payhere request
SETUP GUIDE

Connect Payhere API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["payhere"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Payhere
3

Run Payhere tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Create a payment link for $50 with the description \"Consultation Fee\"" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Payhere tool calls through the session, and print the final answer

Why Use Composio?

AI Native Payhere Integration

  • Supports both Payhere MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Payhere data

Managed Auth

  • Built-in API key handling with secure storage
  • Central place to manage, scope, and revoke Payhere access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Payhere
  • Scoped, least privilege access to Payhere resources
  • Full audit trail of agent actions to support review and compliance

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with Payhere.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Payhere tool your agent needs.Free to start.

Start building