P6XER CPM MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
P6XER CPM MCP Server
mcp-name: io.github.FTDWW/p6xer-cpm-mcp
An MCP (Model Context Protocol) server for Primavera P6 XER schedule files, built on PyP6XER.
It exposes 38 tools, 3 resources, and 2 prompts so any MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.) can parse, query, analyze, edit, recalculate, and export P6 schedules.
Attribution / 工具来源
This project is based on the open-source project osama-ata/p6xer-mcp-server. The original project provides the 13 read-only analysis tools listed in § Tool provenance. This repository adds a deterministic CPM engine, an editable in-memory workspace, XER write-back, validation, and AI-assisted analysis (25 additional tools).
本项目基于开源项目 osama-ata/p6xer-mcp-server: 原有的 13 个只读分析工具来自上游,其余 25 个工具(CPM 重算、工作区编辑、XER 导出、校验、AI 分析) 由本项目新增。公开版已移除与具体项目投标流程、EPC 模板库、内部自动更新工作流相关的工具与数据。
Features
Read-only analysis — projects, activities, WBS, relationships, calendars, resources, critical path, earned value, DCMA-style quality checks.
Schedule graph — build a node/edge graph from an XER file, detect cycles, export JSON.
Deterministic CPM — full forward/backward pass with all four relationship types (FS/SS/FF/SF + lag), P6 calendars, start/finish constraints, completed-activity anchoring, and zero-duration milestones.
Editable workspace — open an XER into memory, apply structured operations, preview changes, recalculate, and export a P6-compatible XER.
Validation — pre-check operations (task existence, field types, relationship/constraint values) before mutating the graph.
AI analysis — send schedule context to any OpenAI-compatible LLM for an open-ended risk/quality review (optional).
Related MCP server: P6-MCP
Installation
# Clone the repository
git clone https://github.com/FTDWW/p6xer-cpm-mcp.git
cd p6xer-cpm-mcp
# Install with uv (recommended)
uv sync
# Or with pip
pip install "p6xer-cpm-mcp"Python 3.10+ is required.
Running
Development / MCP Inspector:
uv run mcp dev src/p6xer_mcp_server/server.pyStdio (Claude Desktop / Claude Code):
uv run p6xer-cpm-mcpClient configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"p6xer": {
"command": "uvx",
"args": ["p6xer-cpm-mcp"]
}
}
}Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Claude Code (CLI)
claude mcp add p6xer -- uvx p6xer-cpm-mcpAI analysis tool (optional)
analyze_schedule_ai calls an OpenAI-compatible chat-completions endpoint.
Set the key before starting the server:
export P6XER_LLM_API_KEY=... # or DEEPSEEK_API_KEY
# optional overrides:
export P6XER_LLM_BASE_URL=https://api.deepseek.com/v1
export P6XER_LLM_MODEL=deepseek-chatThe tool fails gracefully with a clear error if no key is configured. All other tools work without any LLM.
Tools (38)
Upstream read-only analysis (13)
Tool | Description |
| Parse an XER file — project list, totals, status breakdowns |
| Activities filtered by project, status, or task type |
| Critical path activities (float ≤ 0), sorted by early start |
| Planned/actual hours and costs per resource; over-allocation flags |
| DCMA-style check: missing logic, long durations, high float, unresourced tasks |
| List resources, optionally filtered by type |
| Resource–activity assignments with names and costs |
| Work Breakdown Structure hierarchy |
| Predecessor/successor relationships enriched with task codes |
| Calendar definitions with hours-per-period data |
| Counts, date range, and critical count at a glance |
| EVM: PV, EV, AC, CV, SV, CPI, SPI, EAC per project |
| Full detail for one activity (predecessors + successors + resources) |
Added by this project (25)
Schedule graph & CPM
Tool | Description |
| Export the schedule as nodes/edges JSON with cycle detection |
| Open an XER into an editable in-memory workspace |
| Close a workspace and free its memory |
| List all open workspaces |
| Metadata about a workspace |
| Deep-copy a workspace in memory (no disk I/O) |
| Apply a batch of structured operations |
| Run the CPM forward/backward pass |
| Compare recalculated dates against the original XER |
| Write the workspace back to a P6-compatible XER |
| Cycle detection, orphan activities, CPM summary |
| ES/EF/LS/LF/TF/FF for one activity |
| All activities with CPM dates, sorted and paginated |
| All milestone activities ( |
Editing & validation
Tool | Description |
| Pre-validate operations without applying them |
| Set an activity's duration in hours |
| Set an activity's duration in calendar days |
| Add or update a predecessor relationship (upsert) |
| Remove a predecessor relationship |
| Set or remove a date constraint |
| Set an activity's status |
| Create a new activity |
| Rename an activity |
| Delete an activity |
AI analysis
Tool | Description |
| Send schedule context to an OpenAI-compatible LLM for analysis |
Resources (3)
URI | Description |
| Text summary of a specific project |
| Activities summary with status breakdown |
| Resources summary with assignment statistics |
Prompts (2)
Prompt | Types |
|
|
|
|
Typical CPM workflow
open_schedule_workspace("project.xer")
→ resolve_task / get_activity_detail # identify what to change
→ validate_operations([...]) # optional pre-check
→ apply_schedule_operations([...]) # edit the graph
→ recalculate_schedule() # CPM forward/backward pass
→ preview_schedule_changes() # review the diff
→ export_schedule_xer("project_modified.xer") # write back to XERAll date propagation is done by the deterministic ScheduleEngine; the LLM only
chooses operations and parameters.
Example prompts
Parse project.xer and give me an overview of all projects
What are the critical path activities, sorted by start date?
Run a DCMA schedule quality check on project.xer
Calculate earned value metrics — what are the CPI and SPI?
Open project.xer as a workspace, set activity A1020 to 10 days,
recalculate, and show me what moved.Project structure
p6xer-cpm-mcp/
├── src/p6xer_mcp_server/
│ ├── server.py # FastMCP server: tools, resources, prompts
│ ├── schedule_graph.py # Directed graph + cycle detection + topo sort
│ ├── schedule_engine.py # Deterministic CPM engine + calendar arithmetic
│ ├── schedule_workspace.py # In-memory editable workspace + XER export
│ ├── xer_writer.py # Template-based XER writer (P6-compatible)
│ ├── graph_validator.py # Structural validation of operations
│ └── llm_client.py # Optional OpenAI-compatible LLM client
├── manifest.json # MCPB bundle manifest
├── mcp.json # MCP registry metadata
├── server.json # MCP registry server descriptor
├── smithery.yaml # Smithery registry configuration
├── pyproject.toml
└── README.mdTool provenance / 工具来源说明
来源 | 数量 | 工具 |
上游 | 13 |
|
本项目新增 | 25 |
|
公开版移除了与原项目投标/招标进度计划自动调整、EPC 模板库、机组作用域、经验表等内部工作流相关的工具与数据;因此本仓库不包含任何真实项目名称、XER 文件、里程碑编码或内部经验数据。
License
MIT. See LICENSE. The original copyright notice is retained.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Forensic scheduling MCP for Primavera P6 (XER): AACE windows, DCMA-14, Monte Carlo, TIA.
Primavera P6 XER forensic scheduling: AACE windows, TIA, impacted as-planned, DCMA-14, Monte Carlo.
AI-powered project controls tools for Primavera P6 and Primavera Unifier.
Read, analyze, and safely edit Microsoft Project MPP files.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to analyze Primavera P6 XER files for insights into critical paths, schedule health, and project performance. It provides 23 specialized tools for managing schedule data, resources, and earned value through local or remote interfaces.2916MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI clients to query, analyze, and mutate Oracle Primavera P6 schedules from XER files or live P6 EPPM, with tools for critical path, DCMA compliance, earned value, resources, baselines, and exports.38 PyPI2MIT
- AlicenseAqualityCmaintenanceEnables assistants to read and analyze construction schedules like a scheduler: CPM, float, critical paths, DCMA 14-point, logic checks, update-to-update comparison, baseline variance, and S-curves from P6 XER and MS Project files.1730 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other AI agents to build, edit, and analyze Microsoft Project desktop schedules on Windows through natural language, covering tasks, WBS, dependencies, resources, calendars, baselines, critical path, resource leveling, and earned value, with live changes in Project and single-step undo. It also exports results to PDF or CSV and reads project health and time-phased data for S-curves and histograms.MIT