mcpField
K
Khalti Mcp

Khalti Mcp

Local
github.com/AbiditFinance2Updated 8w ago

About Khalti Mcp

Khalti Mcp is a TypeScript monorepo with MCP servers for Nepal’s Khalti and eSewa payment gateways. It lets Claude initiate and manage payments in conversations, with HMAC-SHA256 signing for eSewa requests.

Key features

  1. 01Khalti payment gateway integration
  2. 02eSewa payment gateway integration
  3. 03HMAC-SHA256 signed eSewa requests
  4. 04Payment actions in conversations

Use cases

  1. 01Initiating Khalti payments through Claude
  2. 02Managing eSewa payments through Claude

MCP support

The two MCP servers expose Khalti and eSewa payment gateway capabilities to MCP clients such as Claude. Credentials are configured in the local environment.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"eSewa-Khalti": {
"command": "npx",
"args": [
"-y",
"khalti-mcp"
],
"env": {
"KHALTI_SECRET_KEY": "<KHALTI_SECRET_KEY>",
"KHALTI_ENVIRONMENT": "<KHALTI_ENVIRONMENT>"
}
}
}
}
Run commandnpx -y khalti-mcp
Environment variables to set
KHALTI_SECRET_KEYSecret
KHALTI_ENVIRONMENT

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmkhalti-mcp

Tools

3

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountintegerYesAmount in PAISA (NOT rupees). Minimum 1000 paisa (~10 NPR). Convert from rupees: amount_rupees * 100
return_urlstringYesFull URL to redirect to after payment completion. Must be publicly accessible.
website_urlstringYesYour website URL (used for verification and branding)
customer_infoobjectNoOptional customer information
customer_info.namestringNoCustomer name
customer_info.emailstringNoCustomer email
customer_info.phonestringNoCustomer phone number
product_detailsarrayNoOptional list of products being purchased
amount_breakdownarrayNoOptional breakdown of the total amount into line items
purchase_order_idstringYesUnique order ID (must be unique across all transactions)
purchase_order_namestringYesHuman-readable description of the purchase (e.g., 'Order #12345')

Details

From the project README

eSewa & Khalti MCP Servers

npm version npm version npm downloads License: MIT

Nepal's first MCP servers for eSewa and Khalti — the two dominant payment gateways in Nepal (eSewa alone serves 15M+ users). This monorepo lets Claude initiate and manage payments directly in conversation, with HMAC-SHA256 request signing so credentials never leave your own environment.

image

What is MCP?

The Model Context Protocol (MCP) is an open standard that enables Claude and other AI models to safely interact with tools, APIs, and data sources. MCP servers allow you to extend Claude's capabilities by exposing custom functionality through a standardized interface.

What's Included

This monorepo contains two MCP servers for Nepali payment gateways:

  • Khalti MCP Server — Integrate Khalti payment gateway with Claude
  • eSewa MCP Server — Integrate eSewa payment gateway with Claude, with HMAC-SHA256 signed requests

Quick Start

Using with Claude Desktop
  1. Install all packages:
    npm install
    npm run build
    
  2. Configure in ~/.config/Claude/claude_desktop_config.json:
    {
      "mcpServers": {
        "khalti-mcp": {
          "command": "npx",
          "args": ["-y", "khalti-mcp"],
          "env": {
            "KHALTI_SECRET_KEY": "your-khalti-secret-key",
            "KHALTI_GATEWAY_URL": "https://a.khalti.com/api/v2"
          }
        },
        "esewa-mcp": {
          "command": "npx",
          "args": ["-y", "esewa-mcp"],
          "env": {
            "ESEWA_SECRET_KEY": "your-esewa-secret-key",
            "ESEWA_PRODUCT_CODE": "your-esewa-product-code",
            "ESEWA_GATEWAY_URL": "https://uat.esewa.com.np/api/epay/main/v2/form"
          }
        }
      }
    }
    
  3. Restart Claude Desktop and start using payment tools in conversations.
Using with Claude Code
claude mcp add khalti-mcp -- npx -y khalti-mcp
claude mcp add esewa-mcp -- npx -y esewa-mcp

Development

# Install dependencies
npm install

# Build all packages
npm run build

# Development mode (watch)
npm run dev

Packages

See individual package READMEs for detailed documentation:

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.