Skip to main content

A Model Context Protocol (MCP) server for Pine Labs payment APIs

Project description

Pine Labs MCP Server

A Model Context Protocol (MCP) server for Pine Labs payment APIs. Connect your AI assistant — Claude Desktop, Cursor, VS Code, Windsurf, or any MCP-compatible client — to Pine Labs and manage payments, refunds, orders, payouts, settlements, and more through natural language.

Full Documentation · Available Tools · Use Cases · FAQs


Prerequisites


Installation

pip install pinelabs-mcp-server

To verify the installation:

pinelabs-mcp-server --help

Quick Start

1. Set your credentials

Create a .env file in your working directory or export the variables directly:

export PINELABS_CLIENT_ID="your_client_id"
export PINELABS_CLIENT_SECRET="your_client_secret"
export PINELABS_ENV="uat"   # use "prod" for production

2. Start the server

pinelabs-mcp-server

The server starts on http://0.0.0.0:8000/mcp using Streamable HTTP transport by default.

3. Connect your AI client

Point your MCP-compatible AI client to the running server endpoint — see AI Client Configuration below.


AI Client Configuration

Add the following to your AI client's MCP configuration file:

Claude Desktop

File: claude_desktop_config.json

{
  "mcpServers": {
    "pinelabs": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "X-Client-Id": "your_client_id",
        "X-Client-Secret": "your_client_secret"
      }
    }
  }
}

Cursor

File: ~/.cursor/mcp.json

{
  "mcpServers": {
    "pinelabs": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "X-Client-Id": "your_client_id",
        "X-Client-Secret": "your_client_secret"
      }
    }
  }
}

VS Code

File: .vscode/mcp.json (in your project root)

{
  "servers": {
    "pinelabs": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "X-Client-Id": "your_client_id",
        "X-Client-Secret": "your_client_secret"
      }
    }
  }
}

Note: VS Code uses "servers" instead of "mcpServers" as the top-level key.


Environment Variables

Variable Required Default Description
PINELABS_CLIENT_ID Yes Your Pine Labs client ID
PINELABS_CLIENT_SECRET Yes Your Pine Labs client secret
PINELABS_ENV No uat Environment: uat or prod
URL
PINELABS_TOKEN_URL No Auto from env Override the token endpoint URL
HOST No 0.0.0.0 Server bind address
PORT No 8000 Server port
LOG_LEVEL No INFO Logging level (DEBUG, INFO, WARNING, ERROR)
LOG_FORMAT No text Log format: text or json
TOOLS No Comma-separated tool filter (see below)
REDIS_HOST No localhost Redis host for token caching
REDIS_PORT No 6379 Redis port
REDIS_DB No 0 Redis database index

Available Tools

The server exposes 56 tools across these categories:

Category Examples
Payment Links Create, retrieve, cancel, and resend payment links
Orders Create, track, and manage checkout orders
Refunds Create and retrieve refund details
Payouts Initiate and track payouts
Settlements Query settlement details and cancel settlements
Subscriptions Create and manage recurring subscriptions
Card Payments Server-to-server card payment flows with OTP
UPI / QR Generate QR codes for UPI intent payments
API Docs Search Pine Labs API documentation
Code Generation Generate integration code snippets

See the complete tools reference for details.


Tool Filtering

You can control which tools the server exposes using the TOOLS environment variable. Tools are classified by operation (read / write / destructive) and category (e.g., payment_links, orders, refunds). Use a comma-separated mix of operation types and domain categories:

# Only read tools
TOOLS=read pinelabs-mcp-server

# Only payment link tools
TOOLS=payment_links pinelabs-mcp-server

# Read + write tools (excludes destructive)
TOOLS="read,write" pinelabs-mcp-server

# Read tools for orders and payment_links only
TOOLS="read,orders,payment_links" pinelabs-mcp-server

Short aliases are supported:

Alias Expands To
payment payment_links
order orders
refund refunds
payout payouts
settlement settlements
subscription subscriptions

Running with Docker

docker build -t pinelabs-mcp-server .

docker run -p 8000:8000 \
  -e PINELABS_CLIENT_ID="your_client_id" \
  -e PINELABS_CLIENT_SECRET="your_client_secret" \
  -e PINELABS_ENV="uat" \
  pinelabs-mcp-server

Development

# Clone the repository
git clone https://github.com/Plural-Pvt/pinelabs-mcp-server.git
cd pinelabs-mcp-server

# Install dependencies
pip install -r requirements.txt
pip install -r requirements-test.txt  # for running tests

# Run the server locally
python main.py

# Run tests
pytest

Troubleshooting

Issue Fix
pinelabs-mcp-server command not found Ensure pip install pinelabs-mcp-server completed successfully and the install directory is in your PATH
Authentication errors Verify your PINELABS_CLIENT_ID and PINELABS_CLIENT_SECRET are correct
Tools not appearing in AI client Restart your AI assistant after configuring the MCP endpoint; check server logs for errors
Connection refused Ensure the server is running (pinelabs-mcp-server) and the port matches your client config
Redis connection errors Redis is optional for local dev — the server falls back to in-memory token caching

Also Available on npm

If you prefer a Node.js-based setup with automatic AI client configuration, use the npm package instead:

npx pinelabs-mcp configure --client-id=YOUR_ID --client-secret=YOUR_SECRET
npx pinelabs-mcp setup cursor   # or: claude-desktop, vscode, windsurf

See pinelabs-mcp on npm for details.


License

MIT — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinelabs_mcp_server-0.1.4.tar.gz (173.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinelabs_mcp_server-0.1.4-py3-none-any.whl (117.4 kB view details)

Uploaded Python 3

File details

Details for the file pinelabs_mcp_server-0.1.4.tar.gz.

File metadata

  • Download URL: pinelabs_mcp_server-0.1.4.tar.gz
  • Upload date:
  • Size: 173.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for pinelabs_mcp_server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1237ae7bee3cf72e9a83e351c61b60920ca6db91f346eccc9b2f0760e2e75def
MD5 ab37d454bfdb152a282117a193405643
BLAKE2b-256 5b21ae543295efd7eb7049ff45f76312b78e8906a710acd32a6a2e691e03f795

See more details on using hashes here.

File details

Details for the file pinelabs_mcp_server-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pinelabs_mcp_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8beb00affcb5d067054a4f0cb5ec64e1d261f77ba09bc60a1e98e35443693eb1
MD5 d36b2a9087c980b146fb4af03fe92eb2
BLAKE2b-256 4eda0b8b26a00a57902ecc1d933c7f3951665a6dc0c66405be4d53625b9997bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page