Giving an AI a safe door into the ERP: MCP servers for NetSuite and TM1
· By Govind Waghmare · 8 min read
- 3
- read tools
- 1
- write tool
- 2
- test levels
I built an MCP server for NetSuite and another for TM1 (IBM Planning Analytics). Both let finance users ask questions in plain English instead of waiting for a report request.
Neither is public, and they run against my employer's systems, so I cannot show them or give their internals. The screens in this note are recreated with sample data and say so.
What I can give you is the design: the rules I follow when I put an AI in front of a ledger or a planning model. They apply to any ERP or planning system, not only these two.
What is an MCP server, and why build one for an ERP?
MCP is the Model Context Protocol. An MCP server exposes a list of tools to an AI app. Each tool has a name, a short description and a typed input. The AI picks a tool, the server runs it, and the result goes back to the model.
For finance there is one reason to prefer this over ten custom integrations. You decide the tool list once, in one place, and every AI app that connects gets the same limits. The server is a single door. You can lock it, log it and test it.
The alternative is to give an app a database login or an API key with broad rights and hope the prompt keeps it in line. A prompt is a request. It is not a control. An auditor will not accept it as one, and I would not either.
My apps reach SAP, NetSuite, TM1 and Workday through REST APIs and MCP. Here is the public map of that landscape. Tap a node to see where it sits.
Why do I start with read-only tools?
Every server I build starts read-only, and many stay that way. Reading is where the value is. Most finance questions are lookups: what was the balance, why did it move, where does this number come from.
I build the explaining tools before the data tools. For a planning cube that means tools that return the rules and the lineage of a figure. A rule tells you how a number is calculated. Lineage tells you which inputs fed it. With those two, the AI can answer "why is this number 4.2 million" with something checkable.
A read-only server has a small blast radius. The worst case is a wrong or embarrassing answer. A server that can write has a different worst case, which is why I treat writes separately below.
How many tools should the server have?
As few as I can manage. Every tool costs context. The model reads every tool name and description on every turn, so a long list makes the model slower, dearer and worse at picking the right one.
I keep names plain, descriptions short and inputs narrow. A tool that takes an entity, an account and a period beats a tool that takes a free-text query. A narrow input is also easier to test.
Here is a sample tool list in the shape I use. The names and data are made up.

Three tools read. One proposes a write, and its description says a person approves it.
Whose access does the AI use?
The user's own. This is the rule I care about most.
If the AI connects with a powerful service account, every user inherits that power through the chat. A junior analyst could ask a question and get data they cannot open in the ERP itself.
Identity belongs in the data platform, not in the prompt. The server passes the caller's identity through, and the source system applies the caller's roles.
Whose access the AI uses
Service account
- UserJunior analyst asks
- AIService account
- ERPApplies its power
- AnswerData the analyst cannot open
The user's own role
- UserSame question
- ServerPasses identity through
- ERPApplies the caller's roles
- AnswerOnly what the role allows
For NetSuite that means the roles and permissions already set up for each person, such as which subsidiaries they can see. For TM1 it means the security on cubes and dimensions.
For an HR system like Workday it means the narrowest scope of all, because pay data is sensitive. I would rather the AI says "you do not have access to that" than answer.
The way to check this is simple. Have test users with different roles ask the same question. The answers must differ in the way the roles differ.
How does a tool answer a "why" question?
A good tool returns the answer and its evidence together. Here is a sample answer in the shape I aim for.

The result names the source row, the rule that mapped the account and the check that ties it to the trial balance. The reply to the user cites those. No number in the answer comes from the model's memory.
This is where the real work is. Writing the protocol code takes a day. Deciding what counts as evidence, and making every tool return it, takes much longer.
What happens when the AI wants to write?
A person approves it, in the chat, before anything posts.
Writes stop at an approval gate
Read lane
- AskQuestion
- ToolA named tool
- ServerUser's role
- AnswerWith evidence
Write lane
- AskRequest
- ProposeDrafts, stops
- Approval gateApprove, reject, edit
- PostOnly after approval
I keep write tools few. In the sample list there is one, and it only drafts an entry. The server returns a proposal and stops. The chat shows the proposal and three buttons. Nothing is posted until a human presses approve.

My rule at work is that no app writes to a ledger without a human approval step. In the TM1 server, write tools and file saves need an approval in the chat, and the read tools for rules and lineage do not.
I believe an agent that can post to a ledger is a control, and an auditor will examine it like one. It needs an owner, a defined scope and an expiry, the same as a person with access would.
Where do the secrets live?
In a secret store, never in the prompt, the tool descriptions or the tool results. The model must never see a key.
I do not rely on that rule alone. I use a test that proves it. The test calls the server through the real path, captures everything that goes back to the model, and fails if the key appears anywhere in it. Because it is a test, it runs again after every change.
If you add only one test to an MCP server, add this one.
How do I know the answers are right?
Each wrong answer becomes a test. This is the rule I use for the lease question-and-answer app at work. When a user reports a wrong number, the question, the expected answer and the source go into a test set. Nothing ships until the whole set passes.
For MCP servers I test at two levels.
Two test levels
- Unit testsKnown ledger
- Real questionsReal model
Unit tests check each tool with fixed inputs and a known ledger. Then I run real questions through a real model and read what it does, because the failures I care about are in the model's choices.
A model may pick the wrong tool, pass the wrong period, or round a number. Unit tests do not catch those. I learned this on another project, where six validator bugs showed up only against the live model.
I also review the tool list whenever I add to it. Before adding a tool, I check whether an existing tool could take one more input instead.
How does this differ by system?
The rules stay the same. The details change.
| System | What the AI reads | The sharp edge |
|---|---|---|
| NetSuite (ERP) | Records, balances and saved queries, through the user's role | Subsidiary and role scope. The same question gives different answers for different people |
| TM1 (planning) | Cube data, plus the rules and lineage behind a figure | Planning data is modeled, not booked. Label it so |
| Workday (HR) | Headcount and plan data | Pay and personal data. Keep the scope narrow and the output aggregated |
Planning systems add one thing. A planning number is an estimate, and the AI should say so. The answer has to carry that label the same way a filed number carries REAL and a forecast carries MODELED. My dashboard note covers that labeling rule.
The mapping layer between the ERP and the plan is where these projects fail, and nobody owns it. I wrote about that in The EPM integration nobody budgets for. An MCP server does not remove that problem. It makes it visible, because the AI will ask about the gap and the tool has to answer.
What will I not show?
Anything from a work system. No tool counts, no sizes, no server or workspace names, no screens, and no data. The sample screens above are made up from scratch.
If you are building one of these, here is the order I would follow. Start with a read-only tool that explains one account. Make it return its source. Add the test that proves the key never reaches the model. Then add the user's own roles. Only after all of that, think about a write tool.