paystack-mcp-server

paystack-mcp-server

Enables AI assistants to interact with the full range of Paystack APIs, allowing operations like transaction management, customer creation, and payments through natural language.

Category
访问服务器

README

Paystack MCP Server

A Model Context Protocol (MCP) server that enables AI assistants to interact with the full range of Paystack APIs.

[!WARNING] Public Preview: This MCP server is currently in public preview. We're seeking early feedback to improve the next iteration, so use cautiously and report any issues you encounter.

Quick Start

Install and run via npm (recommended):

npx @paystack/mcp-server --api-key sk_test_your_key_here

Or for local development, clone and build:

git clone https://github.com/PaystackOSS/paystack-mcp-server.git
cd paystack-mcp-server
npm install
npm run build

Then configure your MCP client to use the server (see Client Integration).

Requirements

  • Node.js v18+
  • npm or yarn
  • A Paystack test secret key (starts with sk_test_)

Configuration Options

Environment Variable Purpose
PAYSTACK_TEST_SECRET_KEY Your Paystack test secret key (fallback if no CLI arg)

You can provide your API key in two ways:

  1. CLI argument (recommended): --api-key sk_test_...
  2. Environment variable: Set PAYSTACK_TEST_SECRET_KEY

Security note: Only test keys (sk_test_*) are allowed. The server validates this at startup and will reject live keys.

Client Integration

The Paystack MCP Server works with any MCP-compatible client. Below is the standard configuration schema used by most clients (Claude Desktop, ChatGPT Desktop, Cursor, Windsurf, etc.).

Using npm (recommended)

For npm-installed server:

{
  "mcpServers": {
    "paystack": {
      "command": "npx",
      "args": ["@paystack/mcp-server", "--api-key", "sk_test_..."]
    }
  }
}

Using a local build

If you've cloned and built the server locally:

{
  "mcpServers": {
    "paystack": {
      "command": "node",
      "args": ["/path/to/paystack-mcp-server/build/index.js"],
      "env": {
        "PAYSTACK_TEST_SECRET_KEY": "sk_test_..."
      }
    }
  }
}

[!IMPORTANT] When setting command: "node", you should ensure you're using Node v18+. If you are using a package manager, you might need to get the path of your Node binary by running this command in your CLI:

Linux and MacOS

which node

Windows

where node

Once you have the path, use it as the value of the MCP Server command in the JSON configuration. e.g., command: "path/to/installation/bin/node"

Where to add this configuration

Client Config file location
VS Code .vscode/mcp.json
Claude Desktop claude_desktop_config.json
ChatGPT Desktop MCP settings in app preferences
Cursor .cursor/mcp.json or global MCP settings
Windsurf MCP configuration in settings
Claude Code ~/.claude/mcp.json or project-level .mcp.json

How It Works

The Paystack MCP Server exposes the entire Paystack API to AI assistants by parsing Paystack's OpenAPI specification at runtime. Instead of hardcoding individual endpoints, the server dynamically discovers all available operations and makes them accessible through a small set of tools.

Available Tools

Tool Description
get_paystack_operation Fetch operation details (method, path, parameters) by operation ID
make_paystack_request Execute a Paystack API request

Available Resources

Resource URI Description
paystack_operation_list paystack://operations/list List all available Paystack operations and their details

Example

When you ask your AI assistant something like "Get me the last 5 transactions on my Paystack integration", here's what happens behind the scenes:

  1. The assistant calls get_paystack_operation("transaction_list") to look up the endpoint details
  2. It gets back the method (GET), path (/transaction), and available query parameters
  3. It then calls make_paystack_request with { method: "GET", path: "/transaction", data: { perPage: 5 } }
  4. You get your transactions

Prompt recommendation

To get the best results when using this MCP server, be specific in your prompts and always include "Paystack" in your requests. The server provides built-in instructions and a knowledge resource (paystack://skill) that help the AI assistant find the right documentation, code snippets, and API details.

Good prompts:

  • "Initialize a Paystack transaction for 50000 NGN"
  • "Create a customer with email user@example.com on my Paystack account"
  • "How can I send money with the Paystack API?"
  • "Show me a cURL example for verifying a Paystack transaction"

Less effective prompts:

  • "List my transactions" (unclear which service to use)
  • "Charge a customer" (missing context about Paystack)

Being explicit ensures the LLM narrows down to the right tool quickly and reduces ambiguity.

Development

Run locally (without building)

For local development and testing, you can run the TypeScript source directly:

PAYSTACK_TEST_SECRET_KEY=sk_test_... npm run dev

Run with MCP Inspector

npm run inspect

Build

npm run build

Run tests

npm test

Troubleshooting

Issue Solution
Server exits silently at startup Check that PAYSTACK_TEST_SECRET_KEY is set
"Invalid key" error Key must start with sk_test_ — live keys are not allowed
Tools not appearing in client Ensure the server is running and the client config path is correct
Request timeouts Check network connectivity to api.paystack.co

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

See CONTRIBUTING.md for more details.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选