McTaba Labs logo
Software EngineeringThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book Call

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
McTaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Our Work

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2027 McTaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Paystack for African Developers
  3. Connecting the Paystack MCP Server to Claude Code
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Connecting the Paystack MCP Server to Claude Code

Configure in Claude Code via Settings → MCP Servers → Add Server. The MCP server runs locally and holds your PAYSTACK_SECRET_KEY as an environment variable — it makes API calls on your behalf. Claude Code calls MCP tools (list_transactions, verify_payment, etc.) and receives results; it never sees the key itself. Use only your own locally-run or self-hosted MCP server — never a third-party hosted MCP server with a live Paystack key.

Configuring the Paystack MCP Server

Add the MCP server to Claude Code's configuration. The config file is at ~/.claude/settings.json (global) or .claude/settings.json (project-level):

{
  "mcpServers": {
    "paystack": {
      "command": "node",
      "args": ["/path/to/your/paystack-mcp-server/index.js"],
      "env": {
        "PAYSTACK_SECRET_KEY": "sk_test_xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

A minimal Paystack MCP server exposes these tools:

// paystack-mcp-server/index.js — minimal MCP server for Paystack
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

var server = new Server({ name: 'paystack', version: '1.0.0' }, { capabilities: { tools: {} } });

server.setRequestHandler('tools/list', async () => ({
  tools: [
    { name: 'list_transactions', description: 'List recent Paystack transactions', inputSchema: { type: 'object', properties: { perPage: { type: 'number' }, status: { type: 'string' } } } },
    { name: 'verify_transaction', description: 'Verify a transaction by reference', inputSchema: { type: 'object', properties: { reference: { type: 'string' } }, required: ['reference'] } },
  ],
}));

server.setRequestHandler('tools/call', async (req) => {
  var headers = { Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY };
  if (req.params.name === 'list_transactions') {
    var p = new URLSearchParams(req.params.arguments || {}).toString();
    var res = await fetch('https://api.paystack.co/transaction?' + p, { headers });
    return { content: [{ type: 'text', text: JSON.stringify((await res.json()).data) }] };
  }
  if (req.params.name === 'verify_transaction') {
    var res = await fetch('https://api.paystack.co/transaction/verify/' + req.params.arguments.reference, { headers });
    return { content: [{ type: 'text', text: JSON.stringify((await res.json()).data) }] };
  }
});

await server.connect(new StdioServerTransport());

Once connected, ask Claude Code: "List my last 5 successful transactions" and it will call the MCP tool automatically.

Learn More

See the Paystack MCP server overview for a conceptual introduction before configuring.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓The MCP server runs locally and holds the Paystack secret key — Claude Code never sees the key directly.
  • ✓Configure via Claude Code settings: add the MCP server command and PAYSTACK_SECRET_KEY env var.
  • ✓Use only locally-run or self-hosted MCP servers with live keys — never third-party hosted.
  • ✓Start with read-only MCP tools (list, verify, get) before adding write tools (transfer, charge).
  • ✓MCP server tools appear in Claude Code as native capabilities — call them conversationally.

Frequently Asked Questions

Is there an official Paystack MCP server?
As of July 2026, Paystack has not published an official MCP server. Community MCP servers exist on GitHub — search for "paystack mcp" to find them. Evaluate any community server carefully before connecting it to a live key: read the source code, check what it does with your key, and verify it makes calls only to api.paystack.co. When in doubt, write your own — it is under 100 lines of code.
Can Claude Code execute transfers or refunds through the MCP server?
Only if you expose those tools in the MCP server. Start with read-only tools (list, verify, get) for development use. If you add write tools, build safety rails: transfer amount limits, recipient allowlists, and confirmation prompts before execution. Claude Code will ask you before calling tools that look destructive — but the guardrails at the tool level are your real protection.
Should I use test mode or live mode for the MCP server in development?
Use your test mode key (sk_test_...) for development. The MCP server configuration lets you set PAYSTACK_SECRET_KEY per environment — use a test key in your dev/project config and only switch to a live key in controlled production setups. Never put a live key in a project-level config file that might be committed to git.

Learn Paystack Integration

KES 2,999

The definitive guide to building payment systems with Paystack — from your first transaction to production-grade payment infrastructure across Africa. 9 modules, 47 lessons. Free preview available.

Start Paystack Course

Not ready? Create Free Account

Keep reading

Paystack AI Agents and the MCP Server: The Complete Guide

A comprehensive guide to building AI agents that interact with Paystack through the Model Context Protocol (MCP) server. Covers connecting the MCP server to Claude Code, querying transactions with natural language, building payment support chatbots, AI-assisted reconciliation, agentic payouts with safety rails, secret key security, human-in-the-loop design, prompt injection risks, and audit trails for AI-initiated financial actions.

Read more

Using an LLM to Explain Failed Payments to Customers

"Insufficient Funds" is clear. "Do Not Honor", "Restricted Card", or "Transaction Not Permitted to Cardholder" are not. An LLM translates these into actionable, customer-friendly messages without revealing implementation details.

Read more

Why You Should Never Give an LLM Your Paystack Secret Key

Your Paystack secret key can initialize transactions, trigger transfers, and access all your transaction data. Giving it to an LLM — even once — creates risks that do not go away when you close the chat window.

Read more

Building a Voice Agent That Collects Payment

A customer calls your number. They say what they want to pay for. The voice agent creates a Paystack payment link and texts it to their phone. No human operator needed. Here is how to build it.

Read more

Verify Paystack Payments in Android with Kotlin

After Paystack checkout in Android, send the transaction reference to your backend for verification. This guide shows how to call your backend verify endpoint with Retrofit and Kotlin coroutines, handle success and failure, and update your UI.

Read more

Explore related topics

M-Pesa & African Stack

M-Pesa Daraja API tutorials, USSD development, and WhatsApp Business API guides. The African Stack that global bootcamps do not teach.

Learn to Code in Kenya

Everything a Kenyan needs to know before writing their first line of code. Career paths, real costs, hardware requirements, and honest answers about what it takes.

Learning to Code

Roadmaps, language guides, and practical advice for learning to code and launching a programming career.

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

The African Stack: Skills for This Market

The skills that make Kenyan developers hard to replace: M-Pesa, USSD, WhatsApp, fintech, and building for the African market.

Bonaventure Ogeto

Bonaventure Ogeto

Founder, McTaba Labs

Bonaventure is the founder of McTaba Labs, a coding bootcamp in Nairobi, Kenya. He has spent years building products for the African market and mentoring the next generation of developers across the continent.