MegTrustDevelopers

API connector MCP

Your agent launches a local connector that signs requests with your own API key.

The API connector is a small MCP server that runs on your machine over stdio. Your agent launches it; it signs HTTPS requests to the MegTrust API with your own key. There is no hosted URL or OAuth flow for it, and your private key never leaves the connector process.

This is different from the docs MCP server, which only reads these docs.

Install the connector

Use Node.js 22 or later and an agent host that supports MCP over stdio. Download these public files into a new directory:

mkdir megtrust-integration
cd megtrust-integration
for file in client.mjs mcp.mjs package.json README.md openapi.json; do
  curl --fail --show-error "https://docs.megtrust.com/integrations/megtrust/$file" --output "$file"
done
npm install --ignore-scripts

Keep the generated lockfile with your integration. The package is downloaded from here; it is not published to npm, so do not assume an npx @megtrust/... package exists.

Agent configuration

Add this server to your agent host's MCP configuration. Replace the key ID and absolute paths, and set the origin of your environment (no /api/v1). The private key stays in the connector process; do not paste it into chat.

{
  "mcpServers": {
    "megtrust": {
      "command": "node",
      "args": ["/absolute/path/megtrust-integration/mcp.mjs"],
      "env": {
        "MEGTRUST_BASE_URL": "https://stagingvault.megtrust.com",
        "MEGTRUST_KEY_ID": "YOUR_KEY_ID",
        "MEGTRUST_PRIVATE_KEY_PATH": "/absolute/path/megtrust-private.pem"
      }
    }
  }
}

Reconnect the agent, then ask it:

Use MegTrust to list my wallets and show the deposit address for each network.

Tools and permissions

Read tools, available by default:

ToolCalls
list_walletsGET /api/v1/wallets
get_walletGET /api/v1/wallets/{id}
list_transactionsGET /api/v1/transactions (with limit, wallet_id, cursor, created_after, created_before)
get_transactionGET /api/v1/transactions/{id}
list_counterpartiesGET /api/v1/counterparties
list_withdrawalsGET /api/v1/withdrawals
get_withdrawalGET /api/v1/withdrawals/{id}

Write tools, only when MEGTRUST_MCP_ALLOW_WRITES=true is set in the connector environment (no other value enables them) and the connector is restarted:

ToolCalls
create_counterpartyPOST /api/v1/counterparties
request_withdrawalPOST /api/v1/withdrawals
cancel_withdrawalPOST /api/v1/withdrawals/{id}/cancel

The integration guide and the OpenAPI document are also MCP resources: megtrust://docs/integration_guide and megtrust://docs/openapi.

  • Every payout requires human approval, and no tool approves requests.
  • The payout tool requires an explicit network and one persisted idempotency key per payment.
  • Read-only mode limits the connector's tools; the underlying API credential keeps its API permissions. Choose an agent host and machine you trust with that credential.
  • Tool output can include client-entered names and labels: treat these as data, not instructions.
  • Revoking the API key cuts off subsequent calls.

On this page