PayMCP
Provides tools for auditing Razorpay payment integrations, identifying common mistakes, scoring, and readiness.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PayMCPaudit my Next.js Razorpay integration for security issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PayMCP
PayMCP is an MCP server that audits Razorpay payment integrations in Next.js App Router + TypeScript projects.
It helps AI coding agents and developers detect common payment-integration mistakes before they become security or production problems.
PayMCP is verification-first and read-only:
π Inspects your project statically
π Detects common payment-security mistakes
π Produces a deterministic engineering score
π§Ύ Returns redacted evidence
π§ͺ Provides Test Mode readiness checks
π οΈ Explains audit findings
π‘ Suggests fixes without modifying your files
Important: A PayMCP static PASS is not a payment, compliance, security, or production certification.
What PayMCP Does
A typical Razorpay integration has several places where things can go wrong:
Your Next.js App
β
ββββββββββββββββΌβββββββββββββββ
β β β
Create Order Checkout Webhook
β β β
βΌ βΌ βΌ
Razorpay API Client Your Server
β
βΌ
Verify Signature
β
βΌ
FulfillPayMCP examines your implementation and looks for problems such as:
Razorpay secrets exposed to the client
Hardcoded API keys
Client-controlled payment amounts
Missing payment signature verification
Missing webhook verification
Incorrect webhook-body handling
Incorrect webhook-secret configuration
Client-side fulfillment before verification
Fulfillment before payment confirmation
Missing idempotency protection
Capture confirmation problems
Test/Live environment mixing
Unsafe refund authorization
Supported Stack
PayMCP V0.1 currently focuses on:
Component | Support |
Payment provider | Razorpay |
Framework | Next.js |
Routing | App Router |
Language | TypeScript |
Static analysis | β |
Test Mode runtime validation | β Controlled |
Payment processing | β |
Live transactions | β |
Credential storage | β |
Automatic source-code modification | β |
Dashboards | β |
Other payment providers | β |
Quick Start
If you only want to get PayMCP running, follow these steps.
Step 1 β Install Node.js
PayMCP is a Node.js application.
Install a current supported Node.js version from:
Check your installation:
node --version
npm --versionStep 2 β Install PayMCP
Related MCP server: shipcheck-mcp
Option A β Recommended: npx
npx -y paymcp-securityThis downloads and runs the published PayMCP package directly. No global installation is required.
Option B β Global installation
npm install -g paymcp-securityThen run:
paymcp-securityIf
paymcp-securityhas not yet been published to npm, use the GitHub installation method below.
Step 3 β Install from GitHub
For development or pre-publication use:
git clone https://github.com/SKSAMIMGOOD/PayMCP.git
cd PayMCP
npm installBuild the project:
npm run buildStart the MCP server:
node dist/index.jsYou normally do not need to manually start this process when your MCP client is configured to launch PayMCP for you.
Step 4 β Connect PayMCP to Your MCP Client
PayMCP uses the MCP stdio transport.
Your MCP client needs to know:
What command to run
Which PayMCP executable to use
Where the project being audited is located
The exact configuration format depends on the MCP client.
Option A β Using npx
After PayMCP is published to npm:
{
"mcpServers": {
"paymcp": {
"command": "npx",
"args": ["-y", "paymcp-security"]
}
}
}This allows the MCP client to launch PayMCP using npx.
Option B β Using a global installation
If you installed:
npm install -g paymcp-securityuse:
{
"mcpServers": {
"paymcp": {
"command": "paymcp-security"
}
}
}Option C β Using the local GitHub build
If you cloned the repository and built it locally:
npm run buildyour MCP configuration can point directly to:
dist/index.jsExample:
{
"mcpServers": {
"paymcp": {
"command": "node",
"args": [
"/absolute/path/to/PayMCP/dist/index.js"
]
}
}
}Windows example
{
"mcpServers": {
"paymcp": {
"command": "node",
"args": [
"C:\\Users\\YourName\\PayMCP\\dist\\index.js"
]
}
}
}macOS/Linux example
{
"mcpServers": {
"paymcp": {
"command": "node",
"args": [
"/Users/YourName/PayMCP/dist/index.js"
]
}
}
}Use an absolute path for the local build.
Step 5 β Restart Your MCP Client
After adding PayMCP to your MCP configuration:
Save the configuration.
Completely restart your MCP client.
Open your Next.js project.
Check that PayMCP is available as an MCP server/tool.
The exact UI and configuration location varies between MCP clients.
Step 6 β Give PayMCP Your Project Root
PayMCP intentionally does not automatically scan your computer.
Every filesystem operation requires an explicit:
projectRootFor example:
C:\Users\YourName\Projects\my-storeor:
/Users/YourName/projects/my-storeThis is an important part of PayMCP's security model.
Why?
Instead of giving the MCP server broad access like:
C:\you give it only:
C:\Users\YourName\Projects\my-storePayMCP then restricts project file access to that supplied root.
Your First Audit
Once PayMCP is connected, open the Next.js project you want to inspect.
Then ask your AI coding agent something like:
Audit my Razorpay payment integration using PayMCP. Use my current project as the projectRoot and explain every security finding.
Your MCP client should use:
audit_payment_integrationwith the appropriate project root.
Conceptually:
{
"projectRoot": "/absolute/path/to/my-nextjs-project"
}PayMCP will inspect the project without modifying it.
What the Audit Returns
The audit provides structured results containing information such as:
Audit
βββ Findings
β βββ severity
β βββ confidence
β βββ rule
β βββ redacted evidence
β
βββ Engineering Score
β
βββ Test Mode Readiness
β
βββ CaveatsThe evidence is deliberately redacted before it is returned over MCP.
Understanding the PayMCP Tools
PayMCP provides several MCP tools.
1. list_payment_providers
Shows the payment providers and technology stacks supported by PayMCP.
Current V0.1 support includes:
Razorpay
Next.js App Router
TypeScriptUse this when you want to check whether your project is supported.
2. get_payment_requirements
Returns the security and architecture requirements PayMCP expects for a Razorpay + Next.js integration.
Useful before implementing a payment system.
Example request to your AI agent:
Show me the Razorpay payment requirements supported by PayMCP.
3. audit_payment_integration
This is the main static auditing tool.
It examines the project for known payment-integration problems.
Example:
Audit my Razorpay integration and show me all high-confidence security findings.
It can identify issues involving:
Client-visible secrets
Hardcoded keys
Client-controlled amounts
Signature verification
Webhooks
Fulfillment
Idempotency
Capture confirmation
Environment configuration
Refund authorization
Important
This tool:
Reads project β Analyzes code β Returns findingsIt does not:
Modify files
Start your application
Contact Razorpay
Process payments4. test_payment_integration
This checks the architecture and readiness of the payment integration.
It is a static/readiness check, not a real payment test.
Example:
Check whether my Razorpay integration is ready for Test Mode.
It does not contact Razorpay or your running application.
5. test_payment_transaction
This is different from the static audit.
It performs a controlled Test Mode runtime validation against an already-running application.
Important restrictions:
Requires an explicit base URL
Uses secure host-environment credentials
Never accepts secrets as tool arguments
Never starts your project commands
Does not perform uncontrolled live transactions
Stops for manual checkout
For example, your application might already be running at:
http://localhost:3000Then the runtime test can validate the controlled payment flow.
Static vs Runtime
PayMCP
β
βββββββββββ΄ββββββββββ
β β
STATIC AUDIT RUNTIME TEST
β β
βΌ βΌ
Read source code Running app
β β
βΌ βΌ
Find architecture Test controlled
problems Test Mode flowA static PASS and runtime result are separate pieces of evidence.
6. generate_payment_integration
This provides a deterministic, self-audited dry-run implementation plan.
It does not write source files.
Think of it as:
Requirements
β
Implementation plan
β
Self-audit
β
File/change planIt is useful when you want to plan a Razorpay integration before actually implementing it.
Example:
Generate a Razorpay payment integration plan for this Next.js project, but do not modify any files.
7. debug_payment
This explains existing audit findings.
Example:
Explain the Razorpay security findings from the PayMCP audit and tell me why each one matters.
It is:
Read-only
Deterministic
Static
It does not modify your project or contact Razorpay.
8. suggest_payment_fix
This creates a read-only, evidence-based plan that an AI coding agent can use to manually fix an issue.
Example:
Suggest fixes for the payment audit findings, but don't modify my files.
The important distinction is:
PayMCP
β
βββ Detects problem
βββ Explains problem
βββ Suggests fix
β
βΌ
AI coding agent
β
βΌ
Developer approves
β
βΌ
Code is modifiedPayMCP itself does not modify your project.
Recommended Workflow
For a real project, I recommend using the tools in this order:
βββββββββββββββββββββββ
β Existing Next.js β
β project β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β list_payment_providersβ
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β get_payment_requirements
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β audit_payment_ β
β integration β
βββββββββββββ¬ββββββββββββ
β
βΌ
Findings?
/ \
YES NO
β β
βΌ βΌ
debug_payment Test Mode
β readiness
βΌ
suggest_payment_fix
β
βΌ
Developer/AI agent
applies fixes
β
βΌ
Run audit again
β
βΌ
test_payment_transaction
β
βΌ
Manual Test Mode checkoutExample Prompts
You don't need to manually understand MCP JSON to use PayMCP.
Your AI coding agent can invoke the appropriate tools based on your request.
Basic audit
Audit my Razorpay integration using PayMCP.
Security audit
Perform a security-focused audit of my Razorpay payment integration. Identify secrets, signature verification, webhook, amount manipulation, and fulfillment issues.
Explain findings
Explain every PayMCP finding in simple terms and tell me what could go wrong in production.
Fix planning
Create a safe implementation plan to fix all PayMCP findings. Do not modify my files.
Test readiness
Check whether my Razorpay integration is ready for Test Mode.
Re-audit after changes
Re-run the PayMCP audit and compare the current implementation against the previous findings.
Security Model
PayMCP is designed to minimize filesystem and credential exposure.
Project access
Filesystem reads are restricted to the supplied:
projectRootPayMCP rejects:
Directory traversal
Symlink escapes
Files PayMCP does not read
.env files are excluded.
Dependency/build directories and binaries are also skipped.
Individual file reads are capped at:
1 MBSecrets
PayMCP does not require you to put payment secrets into MCP tool arguments.
Never put Razorpay secrets into source code.
Your Razorpay Key Secret should remain server-side and should be managed through environment variables or an appropriate secrets-management system.
PayMCP's audit is designed to detect unsafe secret exposure without intentionally exposing the secret itself.
Important: What PayMCP Does NOT Do
PayMCP is not a payment gateway.
It does not:
Process payments
Hold money
Store Razorpay credentials
Perform live transactions
Replace Razorpay
Guarantee production security
Guarantee PCI/compliance status
Automatically modify your application
Deploy your application
Host your application
The relationship is:
Razorpay
β
β Payment processing
βΌ
Your Next.js application
β
β Source code
βΌ
PayMCP
β
βββ Audit
βββ Verify architecture
βββ Explain findings
βββ Suggest fixesTest Mode
PayMCP supports a deliberately constrained Test Mode runtime workflow.
For development:
Use Razorpay Test Mode
β
Create Test Mode keys
β
Configure your application
β
Run your application
β
Use PayMCP static audit
β
Use PayMCP runtime validation
β
Complete manual checkout when requestedDo not use Live Mode credentials for development.
Development
Clone the repository:
git clone https://github.com/SKSAMIMGOOD/PayMCP.git
cd PayMCPInstall dependencies:
npm installRun type checking:
npm run typecheckRun tests:
npm testBuild:
npm run buildRun the built server:
node dist/index.jsAudit Rules
The P0 static rules cover areas including:
Client-visible secrets
Hardcoded key literals
Client-controlled amounts
Missing payment verification
Missing webhook verification
Raw webhook-body misuse
Webhook secret configuration
Client-side fulfillment
Pre-verification fulfillment
Idempotency
Capture confirmation
Environment mixing
Refund authorization
Findings include confidence levels because static source inspection cannot prove every aspect of runtime behavior.
Static Analysis Limitations
Static analysis has limits.
For example, PayMCP can identify code patterns that strongly indicate missing signature verification.
However, source inspection alone cannot prove:
"the production webhook always behaves correctly"or:
"the Razorpay dashboard is configured correctly"Therefore PayMCP reports confidence levels and caveats.
Think of the result as:
Engineering evidence
β
Production certificationTroubleshooting
PayMCP does not appear in my MCP client
Check:
Node.js is installed.
PayMCP builds successfully.
The MCP configuration is valid.
The executable/path is correct.
You restarted the MCP client.
The path to
dist/index.jsis absolute when using a local build.
npx paymcp-security does not work
If the npm package has not yet been published, use the GitHub installation:
git clone https://github.com/SKSAMIMGOOD/PayMCP.git
cd PayMCP
npm install
npm run build
node dist/index.jsThen configure your MCP client to use the local build.
Audit cannot access my project
Make sure the MCP request contains an explicit:
projectRootand that it points to the root directory of your project.
For example:
C:\Users\YourName\Projects\my-shopnot:
C:\Why doesn't PayMCP read my .env file?
This is intentional.
PayMCP is designed to avoid reading .env files and exposing credentials through the MCP interface.
You should never need to send your Razorpay Key Secret to PayMCP as a tool argument.
Frequently Asked Questions
Does PayMCP modify my code?
No.
The audit, testing, debugging, and suggestion workflows are designed to be read-only.
Does PayMCP contact Razorpay?
Static auditing does not contact Razorpay.
The controlled test_payment_transaction workflow is specifically designed for Test Mode runtime validation and is separate from the static audit.
Does PayMCP store my Razorpay credentials?
No.
PayMCP does not provide credential storage or hosted credential management.
Can I use PayMCP with any payment provider?
Not currently.
V0.1 is intentionally focused on:
Razorpay + Next.js App Router + TypeScriptDoes a PASS mean my payment system is secure?
No.
A PASS means PayMCP did not identify the problems covered by its current static rules/readiness checks.
It is not a security certification, compliance certification, or guarantee that your production payment system is safe.
Documentation
Detailed documentation:
Repository
GitHub:
License
MIT License.
Runtime validation is documented in runtime-testing.md. A static PASS and runtime result remain separate evidence.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
Scan, monitor and fix a live web app from your editor: graded security reports with fix prompts.
1India payments for AI agents β UPI, cards, wallets via Razorpay Payment Links. Never holds funds.
Create payment orders, checkout, subscriptions & UPI via PineLabs Plural PG gateway
Related MCP Servers
- AlicenseAqualityAmaintenanceSecurity MCP server with 300+ rules for AI-generated code. Scans Next.js, Supabase, Clerk, Stripe, Prisma, Hono, GraphQL and 20+ modules. Zero config, runs locally.39331 npm5Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI agents to run Shipcheck on local JavaScript/TypeScript repositories, scanning for launch risks like exposed env vars, unsigned webhooks, and missing security guardrails.135 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides code analysis for Next.js projects through the Model Context Protocol, enabling IDE and LLM integration to identify unused files, dead code, and redundant API endpoints.9 npm8MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients to inspect Next.js codebases, analyze App Router and Pages Router structure, discover API routes, and audit build performance through controlled tools.4 npmMIT