9AI assistants (MCP)
This chapter tells you how to connect an AI assistant to Stratum 4D, and what the assistant can do with your schedules.
What the MCP server does
MCP (Model Context Protocol) is a standard that lets an AI assistant use tools on your computer. The Stratum MCP server gives the assistant the Stratum 4D engine. You ask a question in usual words, for example "Open the last XER and tell me what slipped". The assistant then uses the Stratum tools to find the answer.
What the assistant can do
| Tool | Use |
|---|---|
open_file | Open a P6 .xer, a Microsoft Project .xml or a .stratum.json file |
list_projects, open_project | List and open the projects in the database of the desktop application |
summary, list_open | Dates, counts, status and critical activities of an open schedule |
list_activities, get_activity | Find activities by text, status, dates or float, and show all data of one activity |
schedule | Calculate the schedule (F9), with a new data date if necessary |
critical_path, lookahead | The critical path, and the work that starts or finishes in the next days |
kpis, kpi_activities | SPI, CPI, BEI, finish variance and the DCMA checks, with the activities of each count |
check_schedule | The quality check of Chapter 5 |
compare | The changes between two schedules |
update_activity, update_progress | Record the progress of one activity, or update all activities as planned to a new data date |
export | Make a P6 XER, a Microsoft Project XML, a CSV or a Stratum file |
save_project | Save the project in the database as a new version |
Install the MCP server
You must have Node.js 20 or a newer version. You can get it from nodejs.org.
- On the release page of Stratum 4D, download the file
Stratum-4D-<version>-mcp.zip. - Extract the file to a folder that you keep, for example
C:\Stratum\mcp. - Make sure that
stratum-mcp.cjsandsql-wasm.wasmare in the same folder.
To connect Claude Desktop
- In Claude Desktop, click Settings › Developer › Edit Config.The file
claude_desktop_config.jsonopens. - Add the lines that follow. Use your folder. On Windows, write each
\two times.{ "mcpServers": { "stratum-4d": { "command": "node", "args": ["C:\\Stratum\\mcp\\stratum-mcp.cjs"] } } } - Save the file and start Claude Desktop again.The tools list of the chat shows the Stratum tools.
To connect Claude Code
Type this command. Use your folder.
claude mcp add stratum-4d -- node /path/to/stratum-mcp.cjs
Add --scope user to use the server in all your projects. For a different MCP client, start node stratum-mcp.cjs as a stdio server.
The project database
The MCP server finds the database of the desktop application at these locations:
| System | File |
|---|---|
| Windows | %APPDATA%\Stratum 4D\stratum.db |
| macOS | ~/Library/Application Support/Stratum 4D/stratum.db |
| Linux | ~/.config/Stratum 4D/stratum.db |
To use a different file, set the environment variable STRATUM_DB in the configuration of the server.
Safety settings of the MCP server
The text in a schedule file comes from other persons. A person can write an instruction to an assistant in an activity name or a note. The Stratum MCP server tells the assistant that this text is data, not an instruction. If a result contains text that looks like an instruction, the server adds a note to the result.
The server also writes each tool call to a log file on your computer: ~/.stratum/mcp-ledger.jsonl. Each line contains a fingerprint of the line before it. Thus a changed line or a removed line shows when you check the file.
| Setting (environment variable) | Effect |
|---|---|
STRATUM_MCP_READONLY=1 | The server does not write files or the database. export and save_project stop with a message. |
STRATUM_MCP_ROOTS | The server reads and writes files only in these folders. On Windows, put ; between the folders. |
STRATUM_MCP_LEDGER | A different file for the log of tool calls, or off to stop the log |
To set the safety settings for Claude Desktop
- Open
claude_desktop_config.jsonas in the procedure above. - Add an
envpart to thestratum-4dserver. Use your folders."stratum-4d": { "command": "node", "args": ["C:\\Stratum\\mcp\\stratum-mcp.cjs"], "env": { "STRATUM_MCP_ROOTS": "C:\\Projects\\Schedules", "STRATUM_MCP_READONLY": "1" } } - Save the file and start Claude Desktop again.
To check the log of tool calls
- Open a terminal in the folder of the MCP server.
- Type
node stratum-mcp.cjs --verify-ledger.The result shows the number of entries, andintactor the first entry that is not correct.
export and save_project run without a question.Examples of questions
- "Open
C:\Schedules\Update 12.xer. What is the finish date? Which activities are on the critical path?" - "Compare update 11 and update 12. Which activities slipped more than 5 days?"
- "Do a schedule check and list the open activities that have no successor."
- "Give me a three-week look-ahead for the civil works."
- "Set C-4010 to 60% complete with an actual start of 3 November. Update the progress to 10 November, schedule, and export an XER."
The assistant application shows each tool call before it runs, unless you let the tool run without a question. Do a check of each change before you let it run.