> For a complete page index of the Captain API documentation, fetch https://docs.runcaptain.com/llms.txt?excludeSpec=true

# Oracle NetSuite

> Connect Oracle NetSuite ERP to Captain for live search. Requires MCP Standard Tools SuiteApp, OAuth 2.0 with PKCE, and a custom role with REST Web Services permissions.

## Agent Quick Reference - NetSuite Integration

* **Type**: Live Search (real-time, no indexing)
* **Auth**: OAuth 2.0 with PKCE (public client, browser-based flow)
* **Prerequisites**: NetSuite admin must enable Server SuiteScript, REST Web Services, OAuth 2.0, and install MCP Standard Tools SuiteApp
* **Available tools**: Search Records (any record type), Get Record (by internal ID), Run SuiteQL Query (SQL-like), Financial Report (saved reports/searches)
* **Setup**: Connect via Captain Studio → 3rd Party Services → Oracle NetSuite → enter Account ID → OAuth login

Captain integrates with Oracle NetSuite via the MCP (Model Context Protocol) Standard Tools SuiteApp. Once connected, Captain can search records, run SuiteQL queries, and pull financial reports directly from your NetSuite account in real-time.

## What You Can Do

* **Search Records**. Find customers, sales orders, invoices, items, vendors, and any other NetSuite record type
* **Get Record Details**. Retrieve full details on a specific record by internal ID
* **Run SuiteQL Queries**. Execute custom SQL-like queries for analytics and complex data retrieval
* **Financial Reports**. Run saved reports, list and execute saved searches

## Prerequisites

Before connecting, a NetSuite administrator must complete the following steps in your NetSuite account.

### 1. Enable Required Features

1. Go to **Setup > Company > Enable Features**
2. On the **SuiteCloud** tab, enable **Server SuiteScript**
3. Under **SuiteTalk**, enable **REST Web Services**
4. Under **Manage Authentication**, enable **OAuth 2.0**
5. Click **Save**

### 2. Install MCP Standard Tools SuiteApp

1. Go to the **SuiteApps** tab
2. Search for **MCP Standard Tools**
3. Click **Install** and wait for installation to complete

### 3. Set Up a Custom Role

1. Go to **Setup > Users/Roles > Manage Roles**
2. Create or edit a role with the following permissions under **Permissions > Setup**:
   * "Log in using OAuth 2.0 Access Tokens"
   * "MCP Server Connection"
   * "REST Web Services" (Full)
3. Assign this role to the user who will connect

### 4. Find Your Account ID

1. Go to **Setup > Company > Company Information**
2. Your Account ID appears at the top (e.g., `TSTDRV1234567`)

## Connecting in Captain Studio

1. Open [Captain Studio](https://runcaptain.com/studio) and go to the **3rd Party Services** panel
2. Find **Oracle NetSuite** and enter your **Account ID**
3. Click **Connect**. a popup will open for NetSuite login
4. Log in with your NetSuite credentials and select the custom role you configured above
5. Authorize the connection

Once connected, NetSuite appears as a Live Search source in your chat. Toggle it "in context" to have Captain proactively search your ERP data.

## Authentication

NetSuite uses **OAuth 2.0 with PKCE** (public client). No client secret or environment variables are required. the connection is established entirely through the browser-based OAuth flow. Each user connects with their own credentials and role, so data access respects NetSuite's role-based permissions.

Tokens are automatically refreshed when they expire.

## Available Tools

| Tool                  | Description                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------- |
| **Search Records**    | Find records by type. customers, sales orders, invoices, items, vendors, etc.               |
| **Get Record**        | Get full details on a specific record by internal ID. Also supports creating new records.   |
| **Run SuiteQL Query** | Execute custom SuiteQL queries for analytics, reporting, or complex data retrieval.         |
| **Financial Report**  | Run saved NetSuite reports, list available saved searches, or execute a saved search by ID. |

## Learn More

* [Oracle NetSuite MCP AI Connector Service](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_0902023508.html#subsect_32122157179)