NetSuite MCP Server
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., "@NetSuite MCP ServerShow me the top 10 sales orders by amount this month"
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.
NetSuite MCP Server
A 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.
Motivation and Context
NetSuite provides an official AI Connector SuiteApp that enables AI-powered interactions with NetSuite data. However, NetSuite's AI Connector currently only supports:
Claude via Anthropic's web interface
ChatGPT via custom GPT connections The problem: Developers using MCP-compatible tools like Claude Code, Cursor IDE, Windsurf, or other CLI/IDE environments cannot leverage NetSuite's AI capabilities because there's no MCP server implementation.
This MCP server solves that gap by:
Providing the missing bridge between MCP clients (Claude Code, Cursor, Gemini CLI, etc.) and NetSuite's AI Connector
Enabling the exact same functionality that NetSuite's AI Connector provides, but accessible through any MCP-compatible client
Allowing developers to interact with NetSuite data using natural language directly within their development environment
Maintaining the same security standards (OAuth 2.0 with PKCE) required by NetSuite's official AI Connector
In essence, this MCP server brings NetSuite's AI capabilities to the broader MCP ecosystem, allowing developers to query business data, generate reports, and automate NetSuite operations without leaving their IDE or CLI.
Features
✅ OAuth 2.0 with PKCE - Secure authentication without client secrets
✅ Automatic Token Refresh - Tokens refresh automatically before expiration
✅ Environment Variable Support - Configure credentials once in your MCP config
✅ Session Persistence - Authentication survives server restarts
✅ Universal MCP Integration - Works with Claude Code, Cursor IDE, Gemini CLI, and other MCP clients
✅ NetSuite MCP Tools - Access to all NetSuite MCP capabilities (SuiteQL, Reports, Saved Searches, etc.)
✅ Modular Architecture - Clean, maintainable codebase following single-responsibility principle
Related MCP server: NetSuite MCP Tools
Quick Start
1. NetSuite Setup
Step 1: Install NetSuite AI Connector SuiteApp
Before creating the integration record, you must install and configure the NetSuite AI Connector SuiteApp:
Important: The NetSuite AI Connector SuiteApp is required for MCP functionality. Without it, the MCP tools will not be available even after authentication.
Step 2: Create OAuth Integration Record
After installing the SuiteApp, create an integration record:
Navigate to Setup > Integration > Manage Integrations > New
Fill in the details:
Name: "MCP Server Integration"
OAuth 2.0: Checked Authorization Code Grant Checked Public Client
Redirect URI:
http://localhost:8080/callback(or your custom port)
Save and copy the Client ID (consumer key)
Note: we dont need client secret (since this is public client and Authorization Code Grant with pkce)
2. MCP Client Configuration
Add to your MCP client's configuration file:
Claude Code: ~/.claude.json
Cursor IDE: .cursor/mcp.json
Gemini CLI: Per Gemini's MCP setup
Option A: Using npx (Recommended - No Installation Required)
{
"mcpServers": {
"netsuite": {
"command": "npx",
"args": ["@suiteinsider/netsuite-mcp@latest"],
"env": {
"NETSUITE_ACCOUNT_ID": "your-account-id",
"NETSUITE_CLIENT_ID": "your-client-id",
"OAUTH_CALLBACK_PORT": "8080"
}
}
}
}Benefits:
No manual installation required
Always uses the latest version with
@latestClean, simple configuration
Works immediately after MCP client restart
Optional Environment Variables:
OAUTH_CALLBACK_PORT- OAuth callback port (default: 8080)
Option B: Local Development Setup
For contributing or local development:
# Clone the repository
git clone https://github.com/dsvantien/netsuite-mcp-server.git
cd netsuite-mcp-server
# Install dependencies
npm install
# Test locally with npm link
npm linkThen configure with absolute path:
{
"mcpServers": {
"netsuite": {
"command": "node",
"args": ["/absolute/path/to/netsuite-mcp-server/src/index.js"],
"env": {
"NETSUITE_ACCOUNT_ID": "your-account-id",
"NETSUITE_CLIENT_ID": "your-client-id",
"OAUTH_CALLBACK_PORT": "8080"
}
}
}
}Option C: Without Environment Variables
{
"mcpServers": {
"netsuite": {
"command": "npx",
"args": ["@suiteinsider/netsuite-mcp@latest"]
}
}
}Note: You'll need to provide credentials when calling netsuite_authenticate
3. Authenticate & Use
Start your MCP client and authenticate:
Authenticate with NetSuiteA browser window opens → Login to NetSuite → Authentication complete!
Important: After authentication, you'll need to restart your chat or reconnect the MCP server to see NetSuite tools. This is normal MCP behavior.
Once authenticated, use natural language queries:
Show me all customers
List available saved searches
Run a SuiteQL query to get sales orders from last month
Execute the "Monthly Revenue" reportArchitecture
MCP Client (Claude Code, Cursor, Gemini, etc.)
│
│ stdio (JSON-RPC)
▼
┌──────────────────────────────┐
│ MCP Server (Node.js) │
│ │
│ ┌────────────────────────┐ │
│ │ OAuth Manager │ │
│ │ - PKCE generation │ │
│ │ - Local HTTP server │ │
│ │ (port 8080 default) │ │
│ │ - Token storage │ │
│ └────────────────────────┘ │
│ │
│ ┌────────────────────────┐ │
│ │ MCP Tools │ │
│ │ - ns_runCustomSuiteQL │ │
│ │ - ns_runReport │ │
│ │ - ns_listSavedSearches │ │
│ └────────────────────────┘ │
└──────────────────────────────┘
│
│ HTTPS + Bearer Token
▼
┌──────────────────────────────┐
│ NetSuite MCP REST API │
└──────────────────────────────┘Project Structure
netsuite-mcp-server/
├── src/
│ ├── index.js # Main MCP server entry point
│ ├── oauth/
│ │ ├── manager.js # OAuth flow orchestrator
│ │ ├── pkce.js # PKCE challenge/verifier generation
│ │ ├── callbackServer.js # HTTP callback server with CSRF protection
│ │ ├── sessionStorage.js # Session file management
│ │ └── tokenExchange.js # Token exchange & refresh operations
│ ├── mcp/
│ │ └── tools.js # NetSuite MCP API client
│ └── utils/
│ └── browserLauncher.js # Cross-platform browser launcher
├── sessions/ # OAuth tokens (gitignored)
├── authenticate.js # Standalone CLI authentication utility
├── package.json
├── .gitignore
└── README.mdModular Design Benefits
The codebase follows the single-responsibility principle:
pkce.js - PKCE utilities (base64 encoding, challenge generation)
callbackServer.js - HTTP callback handling (CSRF protection, HTML pages, timeouts)
sessionStorage.js - Session persistence (save, load, clear, isAuthenticated)
tokenExchange.js - NetSuite OAuth API communication (token exchange/refresh)
browserLauncher.js - Cross-platform URL opening (macOS, Windows, Linux)
This modular structure enables:
✅ Independent testing of each module
✅ Easy maintenance and debugging
✅ Reusability in other projects
✅ Clear separation of concerns
Environment Variable Configuration
Configuration Example
Recommended npx setup:
{
"mcpServers": {
"netsuite": {
"command": "npx",
"args": ["@suiteinsider/netsuite-mcp@latest"],
"env": {
"NETSUITE_ACCOUNT_ID": "123456-sb1",
"NETSUITE_CLIENT_ID": "your-client-id-here",
"OAUTH_CALLBACK_PORT": "8080"
}
}
}
}Local development setup:
{
"mcpServers": {
"netsuite": {
"command": "node",
"args": ["path/to/src/index.js"],
"env": {
"NETSUITE_ACCOUNT_ID": "123456-sb1",
"NETSUITE_CLIENT_ID": "your-client-id-here",
"OAUTH_CALLBACK_PORT": "8080"
}
}
}
}Environment Variables
NETSUITE_ACCOUNT_ID - Your NetSuite account ID (required)
NETSUITE_CLIENT_ID - Your OAuth client ID (required)
OAUTH_CALLBACK_PORT - OAuth callback port (optional, default: 8080)
Resolution Order
Check arguments first: If
accountIdorclientIdprovided as arguments, use themFallback to environment variables: If no arguments, use env vars
Validation: If neither source provides credentials, show error with instructions
Security Best Practices
File Permissions: Ensure config file has restrictive permissions
chmod 600 ~/.claude.jsonNo Secrets: Client secrets not required (PKCE authentication)
Local Token Storage: OAuth tokens stored in
sessions/directoryNever Commit: Don't commit config files with credentials to git
Available NetSuite MCP Tools
Once authenticated, you'll have access to NetSuite's native MCP tools:
ns_runCustomSuiteQL- Execute SuiteQL queriesns_listAllReports- List available financial reportsns_runReport- Execute a specific reportns_listSavedSearches- List saved searchesns_runSavedSearch- Execute a saved searchns_getRecord- Retrieve a specific recordns_createRecord- Create a new recordns_updateRecord- Update an existing recordAnd more...
The exact tools available depend on your NetSuite account configuration.
OAuth Flow
Initiation: User calls
netsuite_authenticatewith credentialsPKCE Generation: Server generates code verifier and SHA-256 challenge
Authorization URL: Server generates NetSuite OAuth URL and starts local callback server
User Login: Browser opens NetSuite login page
Authorization: User approves access
Callback: NetSuite redirects to
http://localhost:8080/callbackwith authorization codeToken Exchange: Server exchanges code for access/refresh tokens (public client pattern)
Session Storage: Tokens stored in
sessions/session.json(persists across restarts)Auto-Refresh: Tokens automatically refresh when expiring (5-minute buffer)
Troubleshooting
now uses absolute paths based on script location
Issue: "Port already in use"
Cause: Another application using the OAuth callback port
Solution:
# Check what's using the port (example for port 8080)
lsof -i :8080
# Option 1: Kill the process
# Option 2: Change port via environment variableSet custom port in your MCP config:
{
"env": {
"OAUTH_CALLBACK_PORT": "9000"
}
}Remember to update the redirect URI in your NetSuite integration to match the new port!
Issue: Tools not appearing after authentication
Cause: MCP clients cache tool list at session start
Solution:
Restart chat - Open new conversation
Reconnect MCP - Use
/mcpcommand (Claude Code)Restart app - Close and reopen your IDE
This is normal MCP behavior - tool lists are fetched once per session.
Development
Standalone Authentication
Test authentication without MCP client:
node authenticate.js <accountId> <clientId>Clearing Session
rm -rf sessions/Or use the netsuite_logout tool in your MCP client.
Viewing Logs
All server logs output to stderr. When running in MCP clients, these logs appear in the client's console/logs.
Technical Details
PKCE Implementation
Code Verifier: 32 random bytes, base64url encoded
Code Challenge: SHA-256 hash of verifier, base64url encoded
Challenge Method: S256 (required by NetSuite)
Token Exchange (Public Client Pattern)
POST https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code={authorization_code}
&redirect_uri=http://localhost:8080/callback
&client_id={client_id}
&code_verifier={verifier}Important: No Authorization header (public client).
Token Refresh
Tokens automatically refresh when expiring in < 5 minutes:
POST https://{accountId}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&refresh_token={refresh_token}
&client_id={client_id}Prerequisites
Node.js 18.0.0 or higher
NetSuite Account with MCP access
NetSuite AI Connector SuiteApp (Bundle ID: 522506) installed and configured
NetSuite Integration Record with OAuth 2.0 and PKCE enabled
MCP Client - Any MCP-compatible client (Claude Code, Cursor IDE, Gemini CLI, etc.)
License
MIT
References
Available Tools
2 toolsnetsuite_authenticateA
Authenticate with NetSuite to access MCP tools. Required before using any NetSuite tools. If NETSUITE_ACCOUNT_ID and NETSUITE_CLIENT_ID environment variables are set, they will be used automatically.
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | No | NetSuite Account ID (e.g., 1234567 or 1234567_SB1 for sandbox). Optional if NETSUITE_ACCOUNT_ID env var is set. | |
| clientId | No | OAuth 2.0 Client ID from NetSuite integration record. Optional if NETSUITE_CLIENT_ID env var is set. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states authentication is required but does not disclose side effects (e.g., session duration, token storage, error behavior if credentials are invalid). The agent lacks critical behavioral details for robust execution.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, no unnecessary words. It front-loads the purpose and then provides the env var fallback info. Every sentence is informative and concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple authentication tool with two optional params and no output schema, the description covers the core purpose and prerequisite. However, it lacks info on success/failure signals, idempotency, or what happens if authentication fails, which an agent might need for error handling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for both parameters. The description adds value by explaining that parameters are optional when corresponding environment variables are set, which is not in the schema. This reduces ambiguity for the agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool authenticates with NetSuite and is required before using other NetSuite tools. The verb 'authenticate' and resource 'NetSuite' are specific, and it distinguishes itself from sibling 'netsuite_logout' by being the setup step.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says it's required before using any NetSuite tools, and mentions automatic use of environment variables if set. However, it doesn't specify when not to use the tool or compare to alternatives beyond the sibling, but the context is clear enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
netsuite_logoutA
Clear NetSuite authentication session
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses the core effect of ending session, but lacks details about preconditions or error states. No annotations to compensate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence efficiently communicates purpose with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a zero-parameter tool, though could mention error handling or side effects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist; baseline for zero-param tools is 4. Description adds no param info, which is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description uses a specific verb 'Clear' and resource 'NetSuite authentication session', clearly distinguishing from sibling 'netsuite_authenticate'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implicitly suggests use after authentication, but no explicit when-to-use or when-not-to-use guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
netsuite_authenticate - First observed
netsuite_logout
TDQS
The two tools have distinctly opposite purposes: authenticate vs logout. There is no overlap or ambiguity.
Both tools follow a consistent verb_noun pattern with the 'netsuite_' prefix, e.g., netsuite_authenticate and netsuite_logout.
The server only provides authentication tools, which is too narrow for a 'NetSuite MCP Server'. A typical integration would require many more tools for CRUD operations.
The tool set is severely incomplete; it lacks any tools for actual NetSuite data operations like reading, writing, or searching records, making it practically unusable for real tasks.
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 Connectors
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Codat — companies, connections, invoices, bills and financial statements.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Node.js MCP server with custom OAuth 2.1 + PKCE authentication, enabling secure remote connections to LLMs like Claude and ChatGPT.792MIT
- AlicenseNot gradedqualityCmaintenanceProvides a Streamable HTTP MCP proxy for VS Code Copilot and Claude Code, using JWT client assertion to securely access NetSuite APIs.MIT
- AlicenseNot gradedqualityAmaintenanceConnects MCP-compatible AI assistants to NetSuite ERP with easy OAuth setup. Provides tools for records, SuiteQL, saved searches, reports, and metadata.1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that exposes NetSuite REST Record API tools (create, read, update, delete, SuiteQL query, metadata lookup) plus SDF tools for creating custom fields, enabling Claude to manage NetSuite records and configurations.38MIT
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/dsvantien/netsuite-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server