Bonaventure OgetoBy Bonaventure Ogeto|

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.

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon