NetSuite AI Connector
Governed MCP bridge that lets AI clients query live ERP data via SuiteQL, saved searches, and records, with role-based permissions and full audit logging.
README
NetSuite AI Connector — Governed MCP ERP Bridge
Source: https://github.com/RITHVIKILLANDULA/netsuite-ai-connector Live demo: https://rithvikillandula.github.io/My-Portfolio/demos/netsuite/
I built a working model of the pattern behind Oracle NetSuite's AI Connector Service. It's an MCP bridge that lets an AI client (Claude, ChatGPT) query live ERP data through governed tools — SuiteQL, saved searches, and records. The AI connects as a finance role, inherits that role's permissions on every call, and every call is audit-logged. I treat the AI as a governed user, not as a way around the controls.
The thesis I wanted to prove is simple: an agent answers from whatever data layer you give it. Put the agent behind a reconciled, governed finance data layer and its answers become trustworthy by construction. The wrong-grain or not-permitted answer gets closed off at the source, not in the prompt.
Run it
make demo # spawns the MCP server as 4 roles, runs identical requests, prints the matrix + audit log
make test # 11 governance tests
make serve ROLE=AR # run the MCP server for one role over stdio
Zero dependencies. The server, the governance layer, and the MCP stdio transport are all standard library.
What the demo shows
I run the same request across four connected roles and the results differ:
| Request | CFO | Controller | AR | AP |
|---|---|---|---|---|
SELECT bank_account, tax_id FROM customer |
both visible | bank NULL | both NULL | DENY (no customer grant) |
SELECT COUNT(*) FROM bill |
110 | 110 | DENY | 58 (subsidiary-scoped) |
SELECT DISTINCT subsidiary_id FROM invoice |
1,2,3 | 1,2,3 | 1,2 only | DENY |
DELETE FROM invoice … |
DENY | DENY | DENY | DENY (read-only) |
SELECT 1; DROP TABLE customer |
DENY | DENY | DENY | DENY (single stmt) |
SELECT … FROM main.invoice (base bypass) |
140 | 140 | DENY (row-scoped) | DENY |
saved search trial_balance |
✓ | ✓ | DENY | DENY |
Every one of those decisions gets written to erp/audit.db.
How the governance works
I enforce at the database engine, with a SQLite authorizer bound to the
connected role (server/governance.py). It holds no matter what SuiteQL the AI
writes. There is no query, and no prompt, that talks its way past it.
- Table allowlist — a read of any relation the role isn't granted is denied.
- Read-only. Every write, DDL,
PRAGMA, orATTACHaction is denied. Only a singleSELECT/WITHstatement gets through. - Column masking. Sensitive columns (
tax_id,bank_account) read back asNULLper role, viaSQLITE_IGNORE. - Row-level scoping. Row-filtered relations are reachable only through
per-role
TEMP VIEWs that embed the subsidiary / document-typeWHEREclause. Direct access to the base table is denied, so a role cannot widen its own row scope even by qualifying the table name.
I declare the roles as pure policy in server/roles.py so an auditor can read
exactly what CFO / Controller / AR / AP can and cannot touch:
CFO all subsidiaries · AR + AP · sensitive fields visible
Controller all subsidiaries · AR + AP · bank_account masked
AR subs 1-2 · customers + invoices + AR GL · tax_id & bank_account masked
AP subs 1-2 · vendors + bills + AP GL · tax_id & bank_account masked
The governed tools (MCP tools/list)
| Tool | Purpose |
|---|---|
whoami |
the connected role and the permissions it inherits |
describe_schema |
role-scoped catalog: relations, columns (masked flagged), row filters |
suiteql_query |
run a read-only SuiteQL SELECT under the role's permissions |
saved_search_run |
invoke a pre-vetted saved search by id (params always bound) |
record_get |
fetch one record, masked and row-scoped |
list_saved_searches |
saved searches available to the role |
Saved searches (server/saved_searches.py) are the safer counterpart to raw
SuiteQL. An analyst authors and reviews the SQL once. The AI can only invoke it
by id with bound parameters, never string-formatted, and it still runs
through the role's filters and masks.
Wire it to a real MCP client
The server speaks JSON-RPC 2.0 over stdio (initialize → tools/list →
tools/call). See mcp_client_config.example.json. Each entry connects the AI
as a fixed role:
{ "command": "python3", "args": ["-m", "server.mcp_server", "--role", "AR"],
"cwd": "/absolute/path/to/netsuite-ai-connector" }
Layout
server/erp_seed.py synthetic NetSuite-shaped ERP (subs, AR, AP, COA, GL)
server/roles.py CFO / Controller / AR / AP policy (pure declaration)
server/governance.py authorizer-based enforcement (the core guarantee)
server/saved_searches.py pre-vetted, parameter-bound saved searches
server/audit.py append-only audit log of every call
server/tools.py governed tool surface + audited dispatch
server/mcp_server.py MCP JSON-RPC stdio server
client/demo_client.py spawns the server per role, runs the governance matrix
tests/ 11 enforcement tests (pytest or stdlib runner)
Why this is the interesting half of the portfolio
My other projects, Foundry and Forecast, build a reconciled, governed finance data layer. This one shows what that layer is worth once an agent is pointed at it. The reconciliation and lineage stop being back-office plumbing and become the thing that makes every AI answer trustworthy.
Resume line: Built a governed MCP connector that lets AI clients query live ERP data through role-scoped tools (SuiteQL, saved searches, records), where every call inherits the connected role's permissions and is audit-logged.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。