Skip to content

AI · Guides · Engineering

Run your billing from Claude and ChatGPT: TolaPay's MCP server for payments in Nepal

How AI assistants connect to TolaPay through the Model Context Protocol, what they can do with your invoices, eSewa and Khalti payments and subscriptions, and the controls that keep live money safe.

Written by
TolaPay team
Published
Reading time
10 min read

It is the last week of the month. Three customers have not paid, one Khalti payment failed on Tuesday, and you want a Dashain discount code live before the weekend. Until now that meant four dashboard screens and a spreadsheet. With TolaPay connected to your AI assistant, it is three sentences in Claude or ChatGPT.

TolaPay (also written Tola Pay) now runs an MCP server. Any assistant that speaks the Model Context Protocol, including Claude, ChatGPT, Claude Code and Cursor, can connect to your TolaPay workspace after you approve it, read your billing data and, in test mode, create checkouts, discount codes and invoices for you. This guide explains what that means, what you can do with it today, and the controls that stop an assistant from doing anything you did not intend.

What MCP is, in one paragraph

The Model Context Protocol is an open standard for giving AI assistants tools. A tool is a named action with a clear input, such as list_invoices with a status filter, or create_discount with a code and a percentage. The assistant decides which tool answers your question, calls it, reads the result and explains it to you in plain language. The service that offers the tools, in this case TolaPay, decides what each tool may do and who may call it. That last part matters: the assistant never gets a database or a blank cheque, only the specific actions TolaPay exposes, under your account's rules.

How this differs from pasting an API key into a chatbot

An API key is all-or-nothing and lives forever until someone revokes it. TolaPay's MCP connection is different on three counts:

  • You approve it on a TolaPay page. The assistant sends you to TolaPay to sign in, shows you exactly which app is asking and where access goes, and you choose test or live data. No secret is copied into a chat window.
  • Access is short-lived and bound to the MCP server. The assistant receives a token that lasts an hour and renews on its own. That token works only for TolaPay's MCP endpoint, not for the rest of the API.
  • It carries your role, and only your role. If you are a support agent in your workspace, the assistant is too. If you leave the organisation or change your password, its access ends immediately.

What you can ask today

Every question below is answered by a real TolaPay tool. Amounts in TolaPay are stored in paisa (Rs 2,500 is 250000); the assistant converts for you, so you can talk in rupees.

You askTool the assistant usesTest modeLive mode
"How is the business doing this month?"get_overviewYesYes
"Show revenue by month since Shrawan."get_revenueYesYes
"Which invoices are still unpaid?"list_invoicesYesYes
"Show failed eSewa and Khalti payments this week."list_paymentsYesYes
"Who is past due on their subscription?"list_subscriptionsYesYes
"Find the customer with email ram@example.com."list_customers, get_customerYesYes
"Make a checkout for the Growth plan for Phewa Studio."create_checkoutYesNot yet
"Create a payment link for the Momo Box I can share on WhatsApp."create_checkout_linkYesNot yet
"Create a code DASHAIN10 for 10% off, 100 uses."create_discountYesNot yet
"Draft this month's invoice for Everest Labs, then finalize it."generate_invoice, finalize_invoiceYesNot yet
"Void invoice INV-0137." / "Cancel that subscription at period end."void_invoice, cancel_subscriptionYes, after you confirmNot yet

There are 22 tools in all, covering customers, products, plans, subscriptions, invoices, payments, checkouts, payment links, discounts and analytics. There is deliberately no refund tool, and live mode is read-only while the feature is in beta.

Three workflows that save real time

1. Month-end collections

The most common use is also the simplest. Ask for open invoices and past-due subscriptions, and the assistant lists them with customer, amount and how overdue each one is. Follow up with "make a checkout for the oldest one so I can send it", and in test mode it creates a hosted checkout and gives you the link, ready to paste into WhatsApp or email. The buyer pays through eSewa, Khalti, connectIPS or a card on the same hosted checkout your customers already use.

In live mode the assistant does the reading part (who owes what, since when) and you send the reminder or create the link from the dashboard. That split is intentional: an assistant should help you see the problem in seconds, and a person should decide what goes to a real customer.

2. Launching a festival promotion

Dashain and Tihar are when Nepali buyers expect offers. In one conversation you can ask the assistant to create a discount code with a percentage and a usage cap, then create a reusable payment link for the product with discount codes allowed, and later list your payment links and recent payments to see what came in. Set an end date for the offer in the dashboard, where the code's full settings live. Rehearse it in test mode first, look at the checkout page it creates, and repeat the same steps in the dashboard for live.

3. Building your integration with Claude Code or Cursor

Developers get the most out of this. Connect TolaPay to Claude Code or Cursor while you build, and the assistant can create test products, plans and customers, open checkouts against sandbox Khalti, eSewa and Stripe, and read back the resulting payments and invoices, all without you switching to a browser. When you ask "why is this subscription still incomplete?", it can look at the actual subscription and invoice instead of guessing.

The usual integration still applies: create customers, open a checkout, and grant access when the invoice.paid webhook arrives. The assistant simply removes the context-switching. The developer overview has the full picture of keys, idempotency and webhook signatures.

How connecting works

The whole flow takes under a minute.

  1. Add the server. In your AI app, add a connector or MCP server with the URL https://api.tola.com.np/mcp. The same URL works for every app.
  2. Sign in to TolaPay. The app opens a TolaPay page. Sign in as usual, including two-factor authentication if your workspace requires it.
  3. Review and approve. The page shows the app's name and the address access goes to. Claude's and ChatGPT's own addresses are marked as recognised, apps running on your computer (Claude Code, Cursor) are labelled as such, and anything else carries a warning. Choose Test mode or Live mode, confirm your password, and click Allow.

Behind the scenes this is standard OAuth 2.1 with PKCE, the same sign-in pattern banks and large SaaS products use, as required by the MCP authorization specification. The assistant never sees your password.

Setup by app

  • Claude (web and desktop): Settings → Connectors → Add custom connector, then paste the URL.
  • ChatGPT: turn on developer mode under Settings → Apps & Connectors, then create a connector with the URL and OAuth sign-in.
  • Claude Code: run claude mcp add --transport http tolapay https://api.tola.com.np/mcp, then /mcp inside Claude Code and choose Authenticate.
  • Cursor: add the server to ~/.cursor/mcp.json and click Connect under Settings → MCP.

The TolaPay MCP page keeps these steps current, with copyable commands.

The controls, stated plainly

Connecting software to your billing deserves scepticism, so here is exactly what TolaPay enforces on the server, not just in the chat window.

  • Approval every time. No app connects without a signed-in member approving it on TolaPay, with a recent password confirmation.
  • Live data is read-only. In live mode the assistant cannot create, change or cancel anything, and no mode can issue refunds.
  • Never more than your role. A connection inherits the approving member's role. Demote the member and the connection is demoted on its next request; remove them and it stops.
  • Destructive actions ask first. Voiding an invoice and cancelling a subscription are marked as destructive, so Claude and ChatGPT ask you to confirm before running them.
  • Only declared inputs get through. Every tool accepts a fixed set of fields with bounded values. An assistant that is "talked into" something by text hidden in a customer's name or a product description cannot add fields the tool does not declare, and the assistant is told to treat customer-written text as data, never as instructions.
  • Stolen tokens die quickly. Access tokens expire within the hour; refresh tokens rotate on every use, and a copied one being reused ends the whole connection.
  • You can see and end every connection. Owners and admins see every connected app under Developers → AI assistants in the dashboard, with who connected it, test or live, and when it was last used. Disconnect takes effect at once, and every approval and disconnection is in the audit log.

What about your data?

When you ask a question, the assistant reads the data needed to answer it, and the AI provider (Anthropic, OpenAI or another) processes that under its own terms and your plan with them. TolaPay shares only what each tool returns, only with apps you approved, and never more than your role allows. If your business has rules about which providers may process customer data, decide which assistants your team may connect before anyone does.

Getting good answers

Assistants are only as precise as the question. A few habits help:

  • Say which mode you mean. "In test mode, create…" removes any doubt.
  • Name customers by email or ID when names are similar. "Phewa Studio" and "Phewa Studios" are different customers.
  • Ask for the link, then check it. For anything a buyer will see, open the checkout the assistant created before you send it.
  • Use it for questions you would otherwise export. "Which customers have more than one unpaid invoice?" is a better use than "show me invoice 142", which is one click in the dashboard.

Who this is for

  • Founders and finance leads at software and subscription businesses in Nepal who want month-end answers without building reports. If you are new to billing in rupees, start with recurring payments without cards and Khalti vs eSewa for SaaS.
  • Developers integrating local payments who already work in Claude Code or Cursor.
  • AI product teams selling usage-based plans, who can pair it with prepaid wallets and spend limits and follow customers, invoices and payments from the same assistant.

Frequently asked questions

Is TolaPay's MCP server free?

Yes. It is part of TolaPay and free during the public beta. Your AI app's own plan and limits apply.

Which AI assistants work with TolaPay?

Claude (web and desktop), Claude Code, ChatGPT with developer-mode connectors, Cursor, and other MCP clients that support OAuth sign-in. All of them use https://api.tola.com.np/mcp.

Can an AI assistant take a payment or issue a refund on its own?

No. There is no refund tool, live mode is read-only, and in test mode the assistant creates checkouts that a buyer still has to pay through eSewa, Khalti, connectIPS or a card. Test checkouts use sandbox rails, so no real money moves.

Do I need to give the assistant an API key?

No. You approve the connection on TolaPay and the assistant receives short-lived access. Developers who prefer keys can still use a tola_test_ key with clients that support headers.

How do I disconnect an assistant?

In the TolaPay dashboard, open Developers → AI assistants and click Disconnect next to the app. It loses access immediately.

Try it in test mode

Create a free workspace, add https://api.tola.com.np/mcp to Claude or ChatGPT, approve it in test mode, and ask your first question: "Create a test product called Momo Box for Rs 500 and make me a checkout for it." Then open the link and pay it with a sandbox wallet. Five minutes from now you will know whether running billing by conversation fits how your team works.

Sources

  1. 01Model Context Protocol: introduction
  2. 02Model Context Protocol: authorization specification
  3. 03OAuth 2.1 (IETF draft)