> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up ERPNext in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/erpnext
Last updated: 2026-11-24

Share ERPNext with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or API key + secret sign-in, 12 tools (5 read-only).

---

To give your team ERPNext in Claude, ChatGPT, Cursor and other AI clients, an admin shares the ERPNext integration in a Metorial portal, and each person signs in to ERPNext with their own account. Agents can manage enterprise business processes across ERPNext's integrated ERP platform. The integration has 12 tools, 5 read-only, 5 write and 2 destructive, plus 1 trigger.

**What you will learn**

- How an admin shares ERPNext in a portal and how each person connects
- The 2 OAuth scopes ERPNext can request, and what each one allows
- How to keep the 5 read-only tools and reject the other 7

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with ERPNext for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Key + Secret** | API token | `apiKey` and `apiSecret` |
| **Username & Password** | Custom credentials | `siteUrl`, `username` and `password` |
| **OAuth 2.0** (default) | OAuth | Signs in to ERPNext after entering `siteUrl` |

The portal and `metorial setup` use **OAuth 2.0** unless someone picks another method.

### API Key + Secret

To connect, a person enters these values:

- `apiKey`: ERPNext API Key
- `apiSecret`: ERPNext API Secret

### Username & Password

To connect, a person enters these values:

- `siteUrl`: Full ERPNext site URL (e.g., https://yoursite.erpnext.com)
- `username`: ERPNext username/email
- `password`: ERPNext password

### OAuth 2.0

Before the sign-in, setup asks for:

- `siteUrl`: Full ERPNext site URL (e.g., https://yoursite.erpnext.com)

People sign in to ERPNext and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `all` | All | Full access to all ERPNext resources |
| `openid` | OpenID | OpenID Connect profile information |

### Setup settings

Whichever method you pick, setup also asks for:

- `siteUrl`: Full ERPNext site URL (e.g., https://yoursite.erpnext.com or https://your-self-hosted-domain.com)

## Use your own ERPNext OAuth app

With your own OAuth app, people see your company's name on the ERPNext consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose ERPNext and copy the **Redirect URI**.

2. **Register the app with ERPNext**

   Create an OAuth app or client in ERPNext and add the redirect URI from Metorial as its redirect or callback URL.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the ERPNext integration.

## Admin: share ERPNext in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose ERPNext. Under **Auth Method**, keep **OAuth 2.0** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to ERPNext as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from ERPNext.

4. **Choose who gets it**

   Add the access groups that should see ERPNext. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user ERPNext integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search erpnext
```

## Employee: connect ERPNext

### In the portal

1. **Open ERPNext in the catalog**

   Sign in to your portal and open ERPNext. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. An ERPNext sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search erpnext
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **OAuth 2.0**. To connect with **API Key + Secret** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your ERPNext connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list erpnext
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 5 read-only tools, such as `get_report` and `get_document`, and lose the 5 write tools, such as `call_method` or `amend_document`, and the 2 destructive tools, such as `cancel_document` or `delete_document`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list erpnext
metorial tools <integration-id>
metorial call <integration-id> list_documents -d '{"doctype":"<doctype>"}'
```

`metorial tools` lists the 12 tools, minus any you rejected. `list_documents` needs `doctype`, so replace the placeholders. It lists and search ERPNext documents of any DocType with filtering, field selection, sorting, and pagination.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (5)

- `get_document`: Retrieve a single ERPNext document by its DocType and name. Needs `doctype` and `documentName`.
- `count_documents`: Count the number of ERPNext documents matching a given DocType and optional filters. Needs `doctype`.
- `get_report`: Run an ERPNext report and retrieve its data. Needs `reportName`.
- `list_documents`: List and search ERPNext documents of any DocType with filtering, field selection, sorting, and pagination. Needs `doctype`.
- `get_current_user`: Retrieve the authenticated ERPNext user identifier for the current connection.

### Write tools (5)

- `amend_document`: Amend a cancelled ERPNext document by creating a revised copy linked to the original. Needs `doctype` and `documentName`.
- `update_document`: Update an existing ERPNext document. Needs `doctype`, `documentName` and `documentData`.
- `submit_document`: Submit a draft ERPNext document to finalize it. Needs `doctype` and `documentName`.
- `call_method`: Call a whitelisted server-side method on the ERPNext/Frappe backend via the RPC API. Needs `method`.
- `create_document`: Create a new ERPNext document of any DocType. Needs `doctype` and `documentData`.

### Destructive tools (2)

- `cancel_document`: Cancel a submitted ERPNext document. Needs `doctype` and `documentName`.
- `delete_document`: Permanently delete an ERPNext document by its DocType and name. Needs `doctype` and `documentName`.

## Triggers

ERPNext has 1 trigger, which fire on events in ERPNext:

- `document_event`: Triggers when an ERPNext document is created, updated, submitted, cancelled, deleted, or changed.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use ERPNext there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [ERPNext on metorial.com](https://metorial.com/integrations/erpnext): the integration overview