midtrans-mcp MCP Server
MCP server for Midtrans (Indonesian payment gateway): status, Snap, payment links, cancel, refund.
midtrans-mcp scores 66 (Good), licensed MIT and written in TypeScript. It installs as a local process. It declares 5 tools. Filed under Finance. GitHub shows 0 stars. Package registries report about 468 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
66 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
81/100 for listing completeness. Lost points: short README, 1 of 5 tools barely described, short summary.
How quality is graded
Where the 66 comes from
22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 0 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "ryoangriawan96-midtrans-mcp": { "command": "npx", "args": [ "-y", "midtrans-mcp@0.1.1" ], "env": { "MIDTRANS_SERVER_KEY": "YOUR_MIDTRANS_SERVER_KEY", "MIDTRANS_IS_PRODUCTION": "", "MIDTRANS_READ_ONLY": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
MIDTRANS_SERVER_KEYSecret | Required | Your Midtrans Server Key (use a Sandbox key for testing). |
MIDTRANS_IS_PRODUCTION | Optional | Set to true for the production API; anything else means Sandbox. |
MIDTRANS_READ_ONLY | Optional | Set to true to expose only the read-only transaction-status tool. |
Tools5Tool docs quality grade D
All capabilitiesCancel a cancellable transaction
Create a Payment Link and return its URL
Create a Snap transaction, returns token + redirecturl
Full status of a transaction by orderid
Refund a settled transaction (full or partial)
About
midtrans-mcp
An MCP server for Midtrans, Indonesia's payment gateway. Let your AI coding client or assistant check transactions, create Snap checkouts and payment links, cancel, and refund — without leaving your editor.
Unofficial community project. Not affiliated with Midtrans / GoTo Financial. Midtrans has no official MCP server; this fills the gap.
Tools
| Tool | What it does | Changes state |
|---|---|---|
get_transaction_status | Full status of a transaction by order_id | No |
create_snap_transaction | Create a Snap transaction, returns token + redirect_url | Yes |
create_payment_link | Create a Payment Link and return its URL | Yes |
cancel_transaction | Cancel a cancellable transaction | Yes |
refund_transaction | Refund a settled transaction (full or partial) | Yes — moves money |
Quick start
You need a Midtrans Server Key (dashboard → Settings → Access Keys). Start with a Sandbox key while testing.
Claude Code
claude mcp add midtrans \
-e MIDTRANS_SERVER_KEY=SB-Mid-server-xxxxxxxx \
-- npx -y midtrans-mcp
Cursor / other MCP clients (mcp.json)
{
"mcpServers": {
"midtrans": {
"command": "npx",
"args": ["-y", "midtrans-mcp"],
"env": {
"MIDTRANS_SERVER_KEY": "SB-Mid-server-xxxxxxxx"
}
}
}
}
Run from source
git clone https://github.com/ryoangriawan96/midtrans-mcp.git
cd midtrans-mcp
npm install
npm run build
MIDTRANS_SERVER_KEY=SB-Mid-server-xxxxxxxx node dist/index.js
Configuration
| Variable | Required | Default | Meaning |
|---|---|---|---|
MIDTRANS_SERVER_KEY | Yes | — | Your Midtrans Server Key. Sandbox keys start with SB-. |
MIDTRANS_IS_PRODUCTION | No | false | Set to true to hit the production API. Anything else means Sandbox. |
MIDTRANS_READ_ONLY | No | false | Set to true to expose only get_transaction_status. Create/cancel/refund tools are not registered at all. Recommended whenever the assistant only needs to look things up — and strongly recommended with a production key. |
Example prompts
- “Check the status of order
ORDER-123.” - “Create a Snap transaction for order
ORDER-124, Rp150.000, GoPay and BCA VA only.” - “Make a payment link titled ‘Kelas Online — November’ for Rp299.000, valid 3 days.”
- “Refund order
ORDER-100in full, reason: customer cancelled.”
Security
- The Server Key is read only from the environment and is sent only to Midtrans over HTTPS. It is never logged, and error messages never contain the key or request headers.
- Read-only mode: set
MIDTRANS_READ_ONLY=trueand only the status-check tool exists — the AI physically cannot create, cancel, or refund anything. - Refund and cancel are separate, explicit tools. Nothing calls them implicitly, and your MCP client will ask for approval before running them if you keep tool approvals on (recommended for production keys).
- All inputs are validated before any request is made:
order_idis limited to Midtrans's character set and length, IDR amounts must be positive integers under a sane ceiling, and free-text fields are length-capped. - Every API call has a 30-second timeout, redirects are refused, and responses are size-capped before being handed to the model.
- Use a Sandbox key while developing. Treat a production Server Key like a password: anyone holding it can refund your customers.
Development
npm install
npm run build # type-check + compile to dist/
npm test # smoke test: starts the server, lists tools, checks auth header
License
MIT © Ryo Angriawan
Frequently asked questions
What is midtrans-mcp MCP Server?
MCP server for Midtrans (Indonesian payment gateway): status, Snap, payment links, cancel, refund.
How do I install midtrans-mcp MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. midtrans-mcp MCP Server runs locally from the npm package midtrans-mcp with the command npx -y midtrans-mcp@0.1.1.
Is midtrans-mcp MCP Server free and open source?
Yes. midtrans-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does midtrans-mcp MCP Server support remote (HTTP) connections?
No remote endpoint is listed for midtrans-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does midtrans-mcp MCP Server provide?
midtrans-mcp MCP Server provides 5 tools, including cancel_transaction, create_payment_link, create_snap_transaction, and get_transaction_status. See the full tool list for descriptions and parameters.
How is midtrans-mcp MCP Server's trust score calculated?
midtrans-mcp MCP Server scores 66 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.