NS MCP China
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NS MCP ChinaCreate a customer named Acme Corp with email info@acme.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NS MCP China
Connect any MCP-compatible AI assistant to NetSuite ERP in under 2 minutes.
One command opens a web form. Fill in 3 fields. Click connect. Done.
┌─────────────────────────────────────────────────────┐
│ WorkBuddy / Claude / Cursor │
│ │ stdio │
│ ▼ │
│ ns-mcp-connector.js │
│ │ │ │
│ Token auto-refresh JSON-RPC proxy │
│ (refresh_token) │ │
│ ▼ │
│ NetSuite Official MCP Endpoint │
│ https://{account}.suitetalk.api.netsuite.com │
│ /services/mcp/v1/all │
└─────────────────────────────────────────────────────┘Quick Start
1. Clone & Setup
git clone https://github.com/letian940-prog/ns-mcp-china.git
cd ns-mcp-china
node bin/ns-mcp-connector.js --setupYour browser opens automatically:
Field | What to enter |
服务端点 URL |
|
客户端 ID | Your OAuth 2.0 Client ID |
客户端密钥 | Your OAuth 2.0 Client Secret |
Click "连接" → NetSuite authorization page opens → Click "Authorize" → Done.
The connector automatically:
Completes OAuth 2.0 Authorization Code + PKCE flow
Saves tokens to
~/.ns-mcp/tokens.jsonUpdates
~/.workbuddy/mcp.json(if WorkBuddy is installed)
2. Restart Your AI Assistant
Cmd+Q to fully quit, then reopen. Go to Connectors → Custom Connectors → Trust.
3. Start Asking
"查询 NetSuite 的所有 subsidiary"
"Create a customer named Acme Corp with email info@acme.com"
"Run the trial balance report for January 2026"
Related MCP server: NetSuite MCP Server
Prerequisites
Node.js >= 18
The connector uses only built-in modules — no npm install needed.
node --version # Must be >= 18.0.0NetSuite Configuration
Complete these steps in your NetSuite account before running setup:
Step 1: Enable OAuth 2.0
Setup > Company > Enable Features > SuiteCloud → Check OAuth 2.0
Step 2: Create an Integration
Setup > Integration > Manage Integrations > New
Field | Value |
Name |
|
Authorization Code Grant | Check |
Public Client | Check |
Audience |
|
Scopes |
|
Redirect URI |
|
Token Lifetime | 3600 (default, or longer) |
Save and copy the Client ID and Client Secret (shown once).
Important: Check "Public Client" — if unchecked, NetSuite rejects the PKCE flow.
Step 3: Install MCP Standard Tools SuiteApp
Customization > SuiteBundler > Search & Install Bundles → Search MCP Standard Tools → Install
Without this bundle, the MCP endpoint returns 0 tools.
Step 4: Create a Non-Admin Role
Oracle's official FAQ states: "Administrator role does not work for AI Connector Service."
Setup > Users/Roles > Manage Roles > New
Add these permissions:
Setup > MCP Server Connection(Full)Setup > Log in using OAuth 2.0 Access Tokens(Full)Setup > REST Web Services(Full)
Assign this role to a user, and use that user to authorize during setup.
How It Works
Two Modes, One File
Mode | Command | Purpose |
Setup |
| Web UI for first-time configuration |
Proxy |
| Forwards MCP messages + manages tokens |
Token Lifecycle
access_token (60min) ──expires──> refresh_token ──auto──> new access_token
│
expires too
│
▼
Connector opens browser
for re-authorizationAccess token: Stored in
~/.ns-mcp/tokens.json, auto-refreshed before expiryRefresh token: Used to silently renew access tokens
Full re-auth: If both expire, connector automatically opens browser
Security
Tokens stored in
~/.ns-mcp/tokens.jsonwith permission600mcp.jsoncontains no credentials — only a path to the connector scriptAll OAuth traffic goes through
localhostcallback (port 38271)Zero external dependencies — no supply chain risk
Configuration
WorkBuddy
After running --setup, the connector automatically updates ~/.workbuddy/mcp.json:
{
"mcpServers": {
"ns-mcp-china": {
"command": "node",
"args": ["/path/to/ns-mcp-china/bin/ns-mcp-connector.js"],
"env": {},
"description": "NetSuite MCP (auto-managed token)"
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ns-mcp-china": {
"command": "node",
"args": ["/path/to/ns-mcp-china/bin/ns-mcp-connector.js"],
"env": {
"NETSUITE_MCP_URL": "https://YOUR_ACCOUNT_ID.suitetalk.api.netsuite.com/services/mcp/v1/all",
"NETSUITE_CLIENT_ID": "YOUR_CLIENT_ID",
"NETSUITE_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
}
}
}
}Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"ns-mcp-china": {
"command": "node",
"args": ["/path/to/ns-mcp-china/bin/ns-mcp-connector.js"],
"env": {
"NETSUITE_MCP_URL": "https://YOUR_ACCOUNT_ID.suitetalk.api.netsuite.com/services/mcp/v1/all",
"NETSUITE_CLIENT_ID": "YOUR_CLIENT_ID",
"NETSUITE_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
}
}
}
}When env variables are set, the connector can auto-trigger OAuth on first run without
--setup.
Environment Variables
Variable | Required | Description |
| No | Full MCP endpoint URL (account ID extracted from this) |
| No | OAuth 2.0 Client ID (enables auto-OAuth) |
| No | OAuth 2.0 Client Secret |
If env variables are omitted, the connector relies on tokens saved by --setup.
Available Tools (17)
The connector forwards all MCP calls to NetSuite's official MCP endpoint, which provides:
Record Operations
Tool | Description |
| Create a new record (customer, salesOrder, invoice, etc.) |
| Retrieve a record by internal ID |
| Update fields on an existing record |
SuiteQL
Tool | Description |
| Execute a custom SuiteQL query with pagination |
| Discover available tables and column definitions |
Saved Searches
Tool | Description |
| List saved searches, optionally filtered by record type |
| Execute a saved search by ID |
Reports
Tool | Description |
| List all available financial and operational reports |
| Run a report (trial balance, P&L, AR/AP aging, etc.) |
| Get available filter options for reports |
Metadata
Tool | Description |
| Get field definitions and sublists for a record type |
| List all subsidiaries with currencies and hierarchy |
| List accounting books (primary and secondary) |
| List accounting contexts for multi-currency |
| List tax nexus records by country |
Interactive Helpers
Tool | Description |
| Browse pre-built prompt templates |
| Discover valid record types and their key fields |
Troubleshooting
Browser shows page_not_found.jsp
Cause: OAuth 2.0 not enabled, or Integration type is wrong.
Fix:
Setup > Company > Enable Features > SuiteCloud→ Enable OAuth 2.0Verify Integration has "Authorization Code Grant" checked (not just Client Credentials)
Verify "Public Client" is checked
redirect_uri_mismatch error
Cause: Redirect URI in NetSuite doesn't match.
Fix: Ensure Redirect URI is exactly http://127.0.0.1:38271/callback
Port 38271 already in use
lsof -i :38271
kill -9 <PID>0 tools returned after connection
Cause: MCP Standard Tools SuiteApp not installed.
Fix: Customization > SuiteBundler > Search & Install Bundles → Install "MCP Standard Tools"
Authorization succeeds but API calls return 401
Cause: Used Administrator role for authorization.
Fix: Create a non-admin role with MCP Server Connection + OAuth 2.0 Access Tokens + REST Web Services permissions. Re-run --setup and authorize as that user.
Token expired and not refreshing
rm ~/.ns-mcp/tokens.json
node bin/ns-mcp-connector.js --setupDevelopment
npm install # Install TypeScript deps (for src/ legacy server)
npm run build # Compile TypeScript
npm run dev # Watch modeThe connector (bin/ns-mcp-connector.js) is plain JavaScript with zero dependencies — it can be edited and run directly without compilation.
Project Structure
ns-mcp-china/
├── bin/
│ └── ns-mcp-connector.js # Main connector (zero deps)
├── src/ # Legacy stdio MCP server (TypeScript)
│ ├── index.ts
│ ├── netsuite-client.ts
│ └── tools/
│ ├── records.ts
│ ├── suiteql.ts
│ ├── searches.ts
│ ├── reports.ts
│ ├── metadata.ts
│ └── apps.ts
├── server.json # MCP Registry description
├── package.json
├── tsconfig.json
├── .env.example
├── LICENSE
└── README.mdLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI assistants to query and manage NetSuite data via natural language, supporting SuiteQL queries and record operations through Token-Based Authentication.2MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server providing access to NetSuite data through OAuth 2.0 with PKCE authentication. Works seamlessly with any MCP-compatible client including Claude Code, Cursor IDE, and Gemini CLI.24219MIT
- AlicenseAqualityBmaintenanceConnects OpenXE ERP with AI assistants via MCP, enabling natural language queries to read and write ERP data locally.21MIT
- Alicense-qualityDmaintenanceConnects any MCP-compatible AI assistant directly to a Salesforce org for querying data, exploring schema, running Apex, and managing deployments.24MIT
Related MCP Connectors
Connect e-commerce and marketing data to AI assistants via MCP.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/letian940-prog/ns-mcp-china'
If you have feedback or need assistance with the MCP directory API, please join our Discord server