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.

Your computer AI assistant app Claude Desktop, Claude Code or other MCP client Shows each tool call to you Stratum MCP server node stratum-mcp.cjs The Stratum 4D engine: schedule, KPIs, checks, compare Schedule files .xer .xml .stratum.json Project database stratum.db (desktop app) tool call result The server sends nothing to other computers. Your assistant app sends your question and the results to its AI service.
Figure 9-1. The assistant, the Stratum MCP server and your data.
The Stratum MCP server sends no data to other computers. But the assistant application sends your questions and the tool results to its AI service. Obey the data rules of your company before you use an assistant with project data.

What the assistant can do

ToolUse
open_fileOpen a P6 .xer, a Microsoft Project .xml or a .stratum.json file
list_projects, open_projectList and open the projects in the database of the desktop application
summary, list_openDates, counts, status and critical activities of an open schedule
list_activities, get_activityFind activities by text, status, dates or float, and show all data of one activity
scheduleCalculate the schedule (F9), with a new data date if necessary
critical_path, lookaheadThe critical path, and the work that starts or finishes in the next days
kpis, kpi_activitiesSPI, CPI, BEI, finish variance and the DCMA checks, with the activities of each count
check_scheduleThe quality check of Chapter 5
compareThe changes between two schedules
update_activity, update_progressRecord the progress of one activity, or update all activities as planned to a new data date
exportMake a P6 XER, a Microsoft Project XML, a CSV or a Stratum file
save_projectSave 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.

  1. On the release page of Stratum 4D, download the file Stratum-4D-<version>-mcp.zip.
  2. Extract the file to a folder that you keep, for example C:\Stratum\mcp.
  3. Make sure that stratum-mcp.cjs and sql-wasm.wasm are in the same folder.

To connect Claude Desktop

  1. In Claude Desktop, click Settings › Developer › Edit Config.The file claude_desktop_config.json opens.
  2. 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"]
        }
      }
    }
  3. 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:

SystemFile
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.

Close the desktop application before you tell the assistant to save a project. If the two save at the same time, one of the saves can fail. Reading is safe while the desktop application is open.

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=1The server does not write files or the database. export and save_project stop with a message.
STRATUM_MCP_ROOTSThe server reads and writes files only in these folders. On Windows, put ; between the folders.
STRATUM_MCP_LEDGERA different file for the log of tool calls, or off to stop the log

To set the safety settings for Claude Desktop

  1. Open claude_desktop_config.json as in the procedure above.
  2. Add an env part to the stratum-4d server. 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"
      }
    }
  3. Save the file and start Claude Desktop again.

To check the log of tool calls

  1. Open a terminal in the folder of the MCP server.
  2. Type node stratum-mcp.cjs --verify-ledger.The result shows the number of entries, and intact or the first entry that is not correct.
These settings make a hidden instruction easy to see. They cannot stop all of them. Do not let export and save_project run without a question.

Examples of questions

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.

← 8. Dashboards and reports10. Stratum Server: users, security and AiSOC →