Skip to main content
Glama
mcp-netsuite-practice

mcp-netsuite-practice

by awnt9

MCP NetSuite Practice

Python MCP server that exposes read-only NetSuite tools for agents such as Claude Desktop or Claude Code. It lets an LLM query warehouse stock and order status without putting API keys in the client.

Tool

Arguments

Description

get_stock_level

sku: str

Available units for a SKU in warehouse

get_order_status

order_id: str

Current status of an order

admin_reload_catalog

(none)

Admin-only mock catalog reload (RBAC demo)

NetSuite access goes through a stable client interface. Local development uses a mock with sample inventory data; the same interface can later target a real sandbox via environment variables.

Product specification: project.md.
Agent quality harness: AGENTS.md (also CLAUDE.md).

Stack

  • Python 3.12+

  • uv

  • Official mcp SDK (stdio and HTTP/SSE)

  • FastAPI + Uvicorn for remote transport

  • OAuth2 authorization-code + PKCE (demo IdP) and JWT bearer auth

  • Pydantic / pydantic-settings for schemas and config

  • Docker, Kubernetes manifests, Terraform module for cluster deploy

Related MCP server: MCP API Tool Demo

Architecture

flowchart TD
    Agent[Agent: Claude Desktop / Claude Code]
    OAuth[OAuth2 PKCE demo IdP]
    MCP[MCP Server FastAPI SSE]
    RBAC[RBAC by role]
    Tools[Tools: stock / order / admin]
    Schemas[Pydantic schemas]
    Client[NetSuite client interface]
    Mock[Mock data]
    Sandbox[NetSuite sandbox]

    Agent -->|stdio local| MCP
    Agent -->|HTTP SSE + Bearer JWT| MCP
    Agent --> OAuth
    OAuth -->|access token| Agent
    MCP --> RBAC
    RBAC --> Tools
    MCP --> Schemas
    Tools --> Client
    Client --> Mock
    Client -.-> Sandbox

The MCP server exposes typed tools to the agent. Remote mode validates a JWT from the PKCE flow and enforces least privilege (for example sales cannot call admin_reload_catalog). Tools call a NetSuite client interface so the protocol layer stays decoupled from the ERP.

How to use

Requirements: Python 3.12+, uv.

Local stdio (Claude Desktop / Claude Code)

uv sync
uv run python -m mcp_netsuite_practice
{
  "mcpServers": {
    "netsuite-practice": {
      "command": "uv",
      "args": [
        "--directory",
        "C:/Users/antonio/Desktop/MCP-netsuite-practice",
        "run",
        "python",
        "-m",
        "mcp_netsuite_practice"
      ]
    }
  }
}

Example prompts:

  • “How much stock do we have for SKU BARRIER-01?”

  • “What is the status of order SO-10042?”

Remote SSE (FastAPI)

cp .env.example .env
uv run python -m mcp_netsuite_practice --transport sse

Endpoints:

Path

Purpose

GET /healthz

Liveness/readiness

GET /oauth/authorize

PKCE authorize (demo login via query params)

POST /oauth/token

Exchange code + code_verifier for JWT

GET /sse

MCP SSE transport

POST /messages/

MCP SSE message endpoint

Obtain a token (PKCE), then call MCP with Authorization: Bearer <token>.

Roles: sales, ops, admin. Sales may use stock/order tools only.

Docker

docker compose up --build

Kubernetes / Terraform

  • Manifests: deploy/k8s/

  • Terraform module: deploy/terraform/ (see its README)

Variable

Purpose

MCP_TRANSPORT

stdio (default) or sse

PUBLIC_BASE_URL

Issuer / resource base URL for OAuth metadata

JWT_SECRET

HS256 signing secret

OAUTH_CLIENT_ID

Public PKCE client id

REQUIRE_AUTH

Enable bearer auth on SSE (true/false)

NETSUITE_MODE

mock (default) or sandbox once a real client exists

uv run pytest

Available Tools

2 tools
get_order_statusA

Return the current status of a global sales order.

Use when the user asks about an order, shipment progress, or fulfillment state for an order id (for example SO-10042).

Inputs: order_id (required). Returns: Current status of a sales order.

get_stock_levelA

Return available warehouse units for an A-SAFE product SKU.

Use when the user asks about inventory, stock on hand, or availability for a specific SKU (for example ASAFE-BARRIER-01).

Inputs: sku (required). Returns: Available warehouse stock for a single SKU.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools target completely distinct domains: inventory (stock levels by SKU) and order fulfillment (order status by ID). There is no overlap in purpose or arguments, so an agent can easily select the correct tool.

    Naming Consistency5/5

    Both tools follow a consistent get_noun_noun pattern (get_stock_level, get_order_status), using snake_case and a clear verb prefix. The naming is predictable and uniform.

    Tool Count3/5

    With only two tools, the server feels minimal. For a practice server this may be intentional, but it borders on too sparse to represent a meaningful integration, though each tool covers a distinct, useful query.

    Completeness2/5

    The tool surface only provides single-record lookups (by SKU and order ID) with no list, create, update, or delete operations. This is a significant gap for an ERP domain like NetSuite, where typical workflows require broader coverage.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      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.
      2
      41 npm
      22
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight, local inventory-intelligence MCP server that enables querying structured inventory schemas with read-only, zero-config tools for stock levels, velocity metrics, and purchase orders.
      4 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that provides mock APIs and deterministic seed data for ERP/OMS, WMS, and CRM systems, enabling supply chain data exploration and integration testing.
      -