josephanya/mono-mcp-server
If you are the rightful owner of mono-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Mono Model Context Protocol (MCP) server enables AI assistants to easily interact with the Mono API.
Mono MCP Server
The Mono Model Context Protocol (MCP) server enables AI assistants to easily interact with the Mono API. It is designed to support both local stdio transport and remote StreamableHTTP transport for flexible deployment options.
Requirements
- Node.js 18+ (for native
fetchand modern ESM support) - npm v9+
Install
npm install
Configuration
Set your Mono Secret Key as an environment variable:
export MONO_SECRET_KEY="your_mono_secret_key"
Run
The entrypoint is src/index.ts. You can run in development or after building:
Development (auto-reload)
- Stdio (local):
npm run dev:stdio
- HTTP (remote):
npm run dev:http
Inspector (optional):
npm run dev:inspect
Production (build then run)
npm run build
npm run start:stdio # or
npm run start:http # defaults to port 3000
Then visit the health endpoint at http://0.0.0.0:3000/health when running HTTP mode.
Notes:
- The app will exit early if
MONO_SECRET_KEYis not set.
HTTP Transport
When started in HTTP mode, the server exposes:
GET /health– basic health checkPOST /mcp– client-to-server JSON-RPC (initialization and requests)GET /mcp– server-to-client notifications (requiresmcp-session-idheader)DELETE /mcp– session termination (requiresmcp-session-idheader)
Session header:
mcp-session-id: Used to bind subsequent requests to the same session.
Exposed Tools
Defined under src/server/handlers/tools.ts (tool identifiers in bold):
-
get_wallet_balance
- Returns available balance in your Mono wallet.
-
get_all_customers
- Inputs (optional):
phone?: string,email?: string - Lists customers, supports filtering.
- Inputs (optional):
-
get_customer_transactions
- Inputs:
customerId: string,period: string,page: string,accountId?: string - Returns transactions for a customer.
- Inputs:
-
get_all_customer_linked_accounts
- Inputs:
name?: string,accountNumber?: string - Lists linked accounts with filters.
- Inputs:
-
get_account_details
- Inputs:
accountId: string - Returns account details.
- Inputs:
-
get_account_identity_info
- Inputs:
accountId: string - Returns identity info for an account.
- Inputs:
-
get_account_balance
- Inputs:
accountId: string - Returns account balance.
- Inputs:
-
get_transaction_history
- Inputs:
accountId: string,startDate?: string,endDate?: string,type?: 'debit' | 'credit',narration?: string - Returns transaction history (non-paginated by default).
- Inputs:
-
get_account_credits
- Inputs:
accountId: string - Returns grouped inflows for an account.
- Inputs:
-
get_account_debits
- Inputs:
accountId: string - Returns grouped outflows for an account.
- Inputs:
Using with Claude Desktop
You can connect this MCP server to Claude Desktop either via stdio (local) or HTTP (remote). Below are example configurations you can add to Claude Desktop's MCP settings.
Stdio (local)
Run the server in stdio mode and let Claude communicate over stdio.
- Ensure
MONO_SECRET_KEYis set in your shell (or pass viaenv):
export MONO_SECRET_KEY="your_mono_secret_key"
- Claude Desktop MCP config entry (JSON):
{
"mono-mcp-server": {
"command": "node",
"args": ["./dist/index.js", "stdio"],
"env": {
"MONO_SECRET_KEY": "${MONO_SECRET_KEY}"
}
}
}
If you prefer running directly from TypeScript in development, replace command/args with your dev runner, for example:
{
"mono-mcp-server": {
"command": "npx",
"args": ["tsx", "src/index.ts", "stdio"],
"env": {
"MONO_SECRET_KEY": "${MONO_SECRET_KEY}"
}
}
}
HTTP (remote)
Run the server in HTTP mode and point Claude to the HTTP endpoint.
- Start the server:
npm run dev:http
# or
npm run build && npm run start:http
- Claude Desktop MCP config entry (JSON):
{
"mono-mcp-server-http": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"content-type": "application/json"
}
}
}
Notes:
- HTTP mode uses sessions. Claude will manage the
mcp-session-idheader automatically after initialization. - Keep CORS and allowed hosts as configured in
src/server/transports/http.ts(defaults allow127.0.0.1andlocalhost).
Project Structure
src/
index.ts # Entrypoint: parses args and starts stdio/http
server/
mono_mcp.server.ts # Server wrapper
setup_handlers.ts # Registers tools/resources
handlers/
tools.ts # Mono-backed tool implementations (see list above)
resources.ts # Resource handlers
transports/
http.ts # Streamable HTTP transport wiring
stdio.ts # Stdio transport wiring
client/
mono_client.ts # Minimal client around Mono HTTP API
utils/
error.handler.ts # Global process error handling
Environment
MONO_SECRET_KEY(required): Your Mono Secret Key. The process exits if it is not set.
Built with ❤️