moolre-mcp
OfficialProvides tools for sending WhatsApp messages, managing templates, and checking message status through the Moolre API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@moolre-mcpcheck my account balance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
moolre-mcp (Node.js)
MCP server exposing Moolre's API — accounts, transfers, payments, SMS, WhatsApp — as 24 tools an AI agent can call. This is the Node.js port of the original PHP implementation (mcp_php/mcp.php); behavior is a 1:1 match, verified against it directly.
Built on the official @modelcontextprotocol/sdk for protocol handling (JSON-RPC validation, session management, SSE framing) — Moolre-specific logic (the REST client and 24 tool definitions) is the only custom code.
Requirements
Node.js 18 or later (uses the built-in
fetch; developed and tested on Node 22).npm install(pulls in@modelcontextprotocol/sdk).
Related MCP server: M-Pesa MCP Server
Running locally (stdio — for MCP clients like Claude Code, Cursor)
node mcp.jsWhen run with a plain node mcp.js and no PORT env var, this reads/writes newline-delimited JSON-RPC over stdin/stdout — the shape an MCP client expects when it spawns the server as a subprocess, e.g. "command": "node", "args": ["/path/to/mcp.js"] in the client's MCP config. See CURSOR_SETUP.md / AGENT_SETUP.md for full config examples.
Running as a hosted HTTP server
PORT=3000 node mcp.jsSetting PORT (which most Node hosts — Render, Railway, Fly.io, etc. — inject automatically) switches this to the Streamable HTTP transport: a single endpoint handling
POST— JSON-RPC messages (responds as plain JSON, or as an SSE-framed event if the client sendsAccept: text/event-stream)GET— optional standalone SSE stream (used for server-initiated messages; this server has none to push, so it opens and immediately closes the stream — enough to satisfy clients that check for SSE support)DELETE— explicit session termination
Session IDs are issued on initialize via the Mcp-Session-Id response header (handled by the SDK's StreamableHTTPServerTransport), and required on every subsequent request via the same header. We keep one transport (and one connected MCP Server instance) per session in an in-memory Map — if you ever run multiple instances behind a load balancer without sticky sessions, session lookups will fail against the wrong instance. For a single hosted instance this isn't a concern.
To force HTTP mode without a PORT (rare), set MCP_TRANSPORT=http instead (defaults to port 3000).
Environment variables
Variable | Purpose | Used by |
| Your Moolre username | every endpoint |
| Private API key | account/transfer/payment/list_transactions endpoints |
| Public API key |
|
| VASKEY for SMS endpoints |
|
| VASKEY for WhatsApp endpoints |
|
| Your Moolre wallet account number | most endpoints (not |
All of these are fallbacks only — if a tool call explicitly supplies headers or accountnumber in its arguments, that always takes precedence over the environment.
The single header Moolre actually receives is always X-API-VASKEY — the two env vars just let the server pick the right value automatically depending on which service (SMS vs WhatsApp) the tool being called talks to.
Project structure
mcp.js— REST client (callRest), the MCPServerwiring (tools/list/tools/callhandlers), and both transports (stdio viaStdioServerTransport, HTTP viaStreamableHTTPServerTransport+ a thin session-routing layer)tools.js— the 24 tool schemas and their REST-call configuration (method, path, defaulttype, credential group)
Testing
# stdio
printf '%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| node mcp.js
# HTTP
PORT=3000 node mcp.js &
curl -s -i -X POST http://127.0.0.1:3000/ \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'Note: the SDK validates requests against the real MCP schema, so initialize needs a proper clientInfo/capabilities payload (real MCP clients already send this) — unlike the earlier hand-rolled version, bare {"params":{}} won't pass validation.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moolrehq/mcp_php'
If you have feedback or need assistance with the MCP directory API, please join our Discord server