> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Mercury MCP server

The Mercury MCP connector routes your AI agent's tool calls to Mercury's own MCP server through Scalekit. Each user signs in to Mercury once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 35 tools.

**Authentication:** OAuth 2.1/DCR
**Categories:** Accounting & Finance, Analytics, Productivity
**Tools:** 35: 35 read, 0 write, 0 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=MERCURYMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Mercury MCP connection

   In **AgentKit > Connections**, create a Mercury MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Mercury MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'mercurymcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Mercury MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'mercurymcp_getaccounts',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "mercurymcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Mercury MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="mercurymcp_getaccounts",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'mercurymcp_getaccount',
  toolInput: {
    accountId: '<accountId>',
  },
  connector: 'mercurymcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="mercurymcp_getaccount",
    tool_input={
        "accountId": "<accountId>",
    },
    connection_name="mercurymcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `mercurymcp_getaccount`

GetAccount · Read-only

Retrieve details of a specific Mercury account by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`string`, required): Mercury account ID. Get it from Get Accounts.

Example input: `{"accountId":"<accountId>"}`

### `mercurymcp_getaccountcards`

GetAccountCards · Read-only

Retrieve all debit and credit cards associated with a specific account.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`string`, required): Mercury account ID. Get it from Get Accounts.

Example input: `{"accountId":"<accountId>"}`

### `mercurymcp_getaccounts`

GetAccounts · Read-only

Retrieve a paginated list of all Mercury accounts for the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_getaccountstatements`

GetAccountStatements · Read-only

Retrieve a paginated list of monthly statements for a specific account.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`string`, required): Mercury account ID. Get it from Get Accounts.
- `end` (`string`, optional): Filter by end date (YYYY-MM-DD).
- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `desc`.
- `start` (`string`, optional): Filter by start date (YYYY-MM-DD).
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{"accountId":"<accountId>"}`

### `mercurymcp_getattachment`

GetAttachment · Read-only

Retrieve attachment details including the download URL.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `attachmentId` (`string`, required): Mercury attachment ID.

Example input: `{"attachmentId":"<attachmentId>"}`

### `mercurymcp_getcard`

GetCard · Read-only

Retrieve details of a specific card by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `cardId` (`string`, required): Unique identifier for a card.

Example input: `{"cardId":"<cardId>"}`

### `mercurymcp_getcurrentdate`

GetCurrentDate · Read-only

Get the current date and time.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `mercurymcp_getcustomer`

GetCustomer · Read-only

Retrieve details of a specific customer by their ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `customerId` (`string`, required): Mercury customer ID. Get it from List Customers.

Example input: `{"customerId":"<customerId>"}`

### `mercurymcp_getinvoice`

GetInvoice · Read-only

Retrieve details of an invoice by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `invoiceId` (`string`, required): Mercury invoice ID. Get it from List Invoices.

Example input: `{"invoiceId":"<invoiceId>"}`

### `mercurymcp_getorganization`

GetOrganization · Read-only

Retrieve organization details including EIN, legal business name, and DBAs.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `mercurymcp_getrecipient`

GetRecipient · Read-only

Retrieve details of a specific payment recipient by their ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `recipientId` (`string`, required): Mercury recipient ID. Get it from Get Recipients.

Example input: `{"recipientId":"<recipientId>"}`

### `mercurymcp_getrecipientinvite`

GetRecipientInvite · Read-only

Retrieve details of a specific recipient invite by ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `inviteId` (`string`, required): ID for the invite.

Example input: `{"inviteId":"<inviteId>"}`

### `mercurymcp_getrecipients`

GetRecipients · Read-only

Retrieve a paginated list of all payment recipients.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_getsaferequest`

GetSafeRequest · Read-only

Retrieve a specific SAFE (Simple Agreement for Future Equity) request by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `safeRequestId` (`string`, required): Mercury SAFE request ID. Get it from Get SAFE Requests.

Example input: `{"safeRequestId":"<safeRequestId>"}`

### `mercurymcp_getsaferequests`

GetSafeRequests · Read-only

Retrieve all SAFE requests for the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `mercurymcp_gettransaction`

GetTransaction · Read-only

Retrieve a transaction by account ID and transaction ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`string`, required): Mercury account ID. Get it from Get Accounts.
- `transactionId` (`string`, required): Mercury transaction ID. Get it from List Transactions.

Example input: `{"accountId":"<accountId>","transactionId":"<transactionId>"}`

### `mercurymcp_gettransactionbyid`

GetTransactionById · Read-only

Retrieve a single transaction by its ID including attachments and check images.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `transactionId` (`string`, required): Mercury transaction ID. Get it from List Transactions.

Example input: `{"transactionId":"<transactionId>"}`

### `mercurymcp_gettreasury`

GetTreasury · Read-only

Retrieve a paginated list of all treasury accounts for the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_gettreasurystatements`

GetTreasuryStatements · Read-only

Retrieve a paginated list of statements for a specific treasury account.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `treasuryId` (`string`, required): Mercury treasury account ID. Get it from Get Treasury.
- `documentType` (`string`, optional): Filter statements by document type. One of: `MonthlyStatement`, `TradeConfirmation`, `1099`, `1099R`, `1042S`, `5498`, `5498ESA`, `1099Q`, `FMV`, `SDIRA`.
- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{"treasuryId":"<treasuryId>"}`

### `mercurymcp_gettreasurytransactions`

GetTreasuryTransactions · Read-only

Retrieve paginated transactions for a specific treasury account.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `treasuryId` (`string`, required): Mercury treasury account ID. Get it from Get Treasury.
- `cursor` (`number`, optional): Numeric pagination cursor from the previous response.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `100`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `desc`.

Example input: `{"treasuryId":"<treasuryId>"}`

### `mercurymcp_getuser`

GetUser · Read-only

Retrieve details of a specific user by their ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `userId` (`string`, required): Mercury user ID. Get it from Get Users.

Example input: `{"userId":"<userId>"}`

### `mercurymcp_getusers`

GetUsers · Read-only

Retrieve a paginated list of all users in the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_getwebhook`

GetWebhook · Read-only

Retrieve details of a specific webhook endpoint by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `webhookEndpointId` (`string`, required): Mercury webhook endpoint ID. Get it from Get Webhooks.

Example input: `{"webhookEndpointId":"<webhookEndpointId>"}`

### `mercurymcp_getwebhooks`

GetWebhooks · Read-only

Retrieve a paginated list of all webhook endpoints with optional status filtering.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.
- `status` (`array`, optional): No description.

Example input: `{}`

### `mercurymcp_listcards`

ListCards · Read-only

Retrieve a paginated list of cards.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`array`, optional): No description.
- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `kind` (`array`, optional): No description.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `500`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.
- `status` (`array`, optional): No description.
- `type` (`array`, optional): No description.
- `userId` (`string`, optional): Filter cards by the cardholder's user ID.

Example input: `{}`

### `mercurymcp_listcategories`

ListCategories · Read-only

Retrieve a paginated list of all custom expense categories for the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_listcredit`

ListCredit · Read-only

Retrieve a list of all credit accounts for the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `mercurymcp_listcustomers`

ListCustomers · Read-only

Retrieve a paginated list of all customers.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_listinvoiceattachments`

ListInvoiceAttachments · Read-only

Retrieve all attachments for a specific invoice.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `invoiceId` (`string`, required): Mercury invoice ID. Get it from List Invoices.

Example input: `{"invoiceId":"<invoiceId>"}`

### `mercurymcp_listinvoices`

ListInvoices · Read-only

Retrieve a paginated list of all invoices.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_listmerchants`

ListMerchants · Read-only

Retrieve a paginated list of priority merchants that can be used for spend controls like merchant locking.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `search` (`string`, optional): Case-insensitive search term to filter merchants by name.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_listrecipientinvites`

ListRecipientInvites · Read-only

Retrieve a paginated list of all recipient invites for your organization. Supports filtering by status.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.
- `status` (`string`, optional): Filter by status. One of: `created`, `completed`, `expired`.

Example input: `{}`

### `mercurymcp_listrecipientsattachments`

ListRecipientsAttachments · Read-only

Retrieve a paginated list of all recipient tax form attachments across the organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.

Example input: `{}`

### `mercurymcp_listsendmoneyapprovalrequests`

ListSendMoneyApprovalRequests · Read-only

Retrieve a paginated list of send money approval requests with optional filtering.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`string`, optional): Mercury account ID. Get it from Get Accounts.
- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.
- `status` (`string`, optional): Filter by status. One of: `pendingApproval`, `approved`, `rejected`, `cancelled`.

Example input: `{}`

### `mercurymcp_listtransactions`

ListTransactions · Read-only

Retrieve a paginated list of transactions across all accounts with advanced filtering.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `accountId` (`array`, optional): No description.
- `cardId` (`array`, optional): No description.
- `categoryId` (`string`, optional): Filter by custom expense category ID.
- `end` (`string`, optional): Filter by end date (YYYY-MM-DD).
- `end_before` (`string`, optional): Cursor to fetch the page before this position.
- `limit` (`integer`, optional): Maximum number of items to return per page. Default: `1000`.
- `mercuryCategory` (`string`, optional): Filter by Mercury built-in transaction category.
- `order` (`string`, optional): Sort order: asc or desc. One of: `asc`, `desc`. Default: `asc`.
- `postedEnd` (`string`, optional): Filter transactions posted on or before this date (YYYY-MM-DD).
- `postedStart` (`string`, optional): Filter transactions posted on or after this date (YYYY-MM-DD).
- `search` (`string`, optional): Search term to filter transactions by description or counterparty.
- `start` (`string`, optional): Filter by start date (YYYY-MM-DD).
- `start_after` (`string`, optional): Cursor from the previous response to fetch the next page.
- `start_at` (`string`, optional): Filter by start datetime (ISO 8601).
- `status` (`array`, optional): No description.

Example input: `{}`

## Related

Other Accounting & Finance connectors ([all 20](/agentkit/connectors/?category=accounting-finance)):

- [QuickBooks](/agentkit/connectors/quickbooks/): Scalekit connector, OAuth, 117 tools
- [Xero](/agentkit/connectors/xero/): Scalekit connector, OAuth, 94 tools
- [Stripe](/agentkit/connectors/stripe/): Scalekit connector, Access token, 178 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
