No-Hallucinate MCP: Real-time Routine Context for ObjectScript
Motivation
Why do we need this?
-
Lack of Compiled Context: AI tools only see source code; they don't know what the final compiled routine looks like.
-
Macro Hallucination: Because AI doesn't see our
#includefiles or system macros, it often makes them up, wasting time during debugging. -
The Documentation Gap: Deep logic optimization often requires understanding internal macros that aren't fully covered in public documentation.
-
Manual Overhead: Currently, the only way to fix this is to manually use the IRIS VS Code extension to find the "truth" in the routine.
The Solution: This MCP server gives our AI "eyes" inside our IRIS instance, allowing it to read routines and expand macros automatically before it suggests code to you.
Quick Start
Try this MCP server with the ObjectScript project apiPub.
Fetch the routine for api.cls:
Press ctrl+shift+v to view the compiled routine. In compiler terminology these are called readable intermediate code. LLMs lack this context — which is why even frontier models invent macros, because they don't know what the expanded code looks like.
They also don't know which .inc files are imported, or what the $$$xxx macros inside them expand to.
For example, a .inc file may explicitly include system macros:
If you are connected to an IRIS instance you can navigate into those macro files directly:
Without explicitly including these system macros there is no way to reach those files — and the LLM has no visibility into them at all.
Under the .vscode folder, add the following to mcp.json:
{
"servers": {
"intersystemsObjectscriptRoutine": {
"type": "stdio",
"command": "npx",
"args": ["-y", "intersystems-objectscript-routine-mcp"],
"env": {
"IRIS_URL": "http://localhost:52773",
"IRIS_NAMESPACE": "IRISAPP",
"IRIS_USERNAME": "_SYSTEM",
"IRIS_PASSWORD": "SYS"
}
}
}
}Open VS Code Copilot in agent mode (the MCP tool is not invoked in other modes). Press ctrl+shift+p and choose MCP: List Servers:
Ask to list all available .inc files:
Fetch the contents of a specific .inc file:
The similar MCP configuration works in other VS Code forks such as Cursor, Antigravity and Windsurf, as well as CLI tools like Claude Code and Codex.
Links:
https://www.npmjs.com/package/intersystems-objectscript-routine-mcp
https://github.com/cjy513203427/intersystems-objectscript-mcp
Comments
Great very useful, i plan to do the same but for classes, it's ok for custom classes they are on your local folder, the LLM claude, codex, copilot can parse them, but not for server side classes for example in Ens.Director or others.
Do you plan to support it too ?

