Skip to main content

MCP server for parsing and analyzing Primavera P6 XER files using PyP6Xer

Project description

PyP6Xer MCP Server

AI-powered analysis for Primavera P6 schedules โ€” Parse XER files, analyze critical paths, track progress, and generate insights using Claude Desktop, ChatGPT, or any MCP-compatible AI.

License: MIT Python 3.10+


Quick Start

Claude Desktop (Recommended)

1. Install via uvx (easiest):

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "pyp6xer": {
      "command": "uvx",
      "args": ["pyp6xer-mcp"]
    }
  }
}

2. Restart Claude Desktop

3. Start analyzing:

"Load the file at /path/to/project.xer and analyze the critical path"

That's it! No installation needed โ€” uvx automatically downloads and runs the latest version.

Alternative: Install locally with pip
pip install pyp6xer-mcp

Then configure Claude Desktop:

{
  "mcpServers": {
    "pyp6xer": {
      "command": "pyp6xer-mcp"
    }
  }
}
Alternative: Run via Docker
docker compose up

Then point Claude Desktop to the HTTP endpoint:

{
  "mcpServers": {
    "pyp6xer": {
      "url": "http://localhost:5000/mcp"
    }
  }
}

What Can It Do?

๐Ÿ“Š Schedule Analysis

"What's on the critical path?"
"Show me activities with negative float"
"Run a DCMA 14-point schedule health check"
"Which activities are slipping?"

๐Ÿ“ˆ Progress & Performance

"What's the current progress summary?"
"Calculate earned value metrics (SPI, CPI)"
"Show me work package status by responsible manager"
"Compare baseline to actual performance"

๐Ÿ” Resource Management

"List all resources and their assignments"
"Show me resource utilization over time"
"Which resources are over-allocated?"

๐Ÿ“ Data Export

"Export the critical path to CSV"
"Generate an executive summary report"
"Export schedule dashboard for Excel"

22 tools โ€ข 5 workflow prompts โ€ข 3 data resources โ€” See TOOLS.md for complete reference.


Installation Methods

Method 1: uvx (Recommended)

No installation needed! Just add to claude_desktop_config.json:

{
  "mcpServers": {
    "pyp6xer": {
      "command": "uvx",
      "args": ["pyp6xer-mcp"]
    }
  }
}

Method 2: pip

pip install pyp6xer-mcp

Method 3: Docker

# Clone repo
git clone <repo-url>
cd pyp6xer_mcp

# One-command setup
docker compose up

Method 4: From Source (Developers)

# Clone repo
git clone <repo-url>
cd pyp6xer_mcp

# Install with uv
uv pip install -e .

# Run tests
pytest

Example Workflows

๐ŸŽฏ Critical Path Analysis

You: "Load the file at /Users/me/Desktop/Q1_Project.xer and show me the critical path"

Claude:

  • Loads the XER file
  • Identifies critical activities
  • Shows duration, dates, and relationships
  • Highlights longest path through the network

๐Ÿฅ Schedule Health Check

You: "Run a schedule health check on the loaded project"

Claude:

  • Checks for DCMA 14-point compliance
  • Identifies missing logic, constraints, lags
  • Flags activities with high/negative float
  • Provides recommendations

๐Ÿ“Š Progress Dashboard

You: "Generate a progress summary and export to CSV"

Claude:

  • Calculates percent complete by project, WBS, activity
  • Shows planned vs actual dates
  • Exports formatted CSV for Excel pivot tables

๐Ÿ”„ Baseline Comparison

You: "Compare baseline to actual and identify variances"

Claude:

  • Compares planned vs actual start/finish dates
  • Calculates schedule variance
  • Identifies slipping activities
  • Recommends corrective actions

๐Ÿ’ผ Executive Summary

You: "Create an executive summary for the steering committee"

Claude:

  • Overall project status (on track, at risk, behind)
  • Key milestones and dates
  • Critical path activities
  • Resource concerns
  • Recommendations

Configuration

Claude Desktop Config Location

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

Environment Variables

Create a .env file for local development:

# Optional: API key for HTTP mode
API_KEY=your_secret_key_here

# Optional: Port (defaults to 5000)
PORT=5000

Running as HTTP Server

For remote access or web UI integration:

# Without auth (development only!)
python -m pyp6xer_mcp.cli streamable-http

# With auth (production)
API_KEY=your_secret_key python -m pyp6xer_mcp.cli streamable-http

Live deployment: https://pyp6xer-mcp.fly.dev/mcp

Upload Files via HTTP

curl -X POST -H "Authorization: Bearer <api_key>" \
  -F "file=@project.xer" \
  https://pyp6xer-mcp.fly.dev/upload

Response:

{
  "cache_key": "abc123",
  "projects": [...],
  "activity_count": 250,
  "message": "XER loaded. Use cache_key 'abc123' with MCP tools."
}

Troubleshooting

"Server not found" in Claude Desktop

  1. Check that claude_desktop_config.json is in the correct location
  2. Ensure JSON is valid (no trailing commas)
  3. Restart Claude Desktop completely (Quit, not just close window)
  4. Check Claude Desktop logs:
    • macOS: ~/Library/Logs/Claude/mcp*.log
    • Windows: %APPDATA%\Claude\logs\mcp*.log

"ModuleNotFoundError: No module named 'pyp6xer_mcp'"

Using uvx? No action needed โ€” it auto-installs.

Using pip? Run:

pip install pyp6xer-mcp

"Failed to parse XER file"

  • Ensure file is valid P6 XER format (not XML, not .xls)
  • Try opening in P6 to verify file integrity
  • Check file size (very large files may timeout)

Permission Denied

# macOS/Linux: Grant file access
chmod +r /path/to/file.xer

# Or move file to accessible location
mv /restricted/path/file.xer ~/Desktop/

Architecture

Package Structure

pyp6xer_mcp/
โ”œโ”€โ”€ __init__.py           # Package entry point
โ”œโ”€โ”€ server.py             # FastMCP server instance
โ”œโ”€โ”€ cli.py                # CLI entry point
โ”œโ”€โ”€ models/               # Pydantic input models
โ”‚   โ”œโ”€โ”€ common.py         # ResponseFormat, ExportType
โ”‚   โ”œโ”€โ”€ file_ops.py       # Load, write, export models
โ”‚   โ”œโ”€โ”€ activities.py     # Activity models
โ”‚   โ”œโ”€โ”€ analysis.py       # Analysis models
โ”‚   โ””โ”€โ”€ resources.py      # Resource models
โ”œโ”€โ”€ core/                 # Core utilities
โ”‚   โ”œโ”€โ”€ cache.py          # XerCache (in-memory)
โ”‚   โ”œโ”€โ”€ formatters.py     # Format functions
โ”‚   โ””โ”€โ”€ helpers.py        # Helper functions
โ”œโ”€โ”€ tools/                # 22 MCP tools
โ”‚   โ”œโ”€โ”€ file_ops.py       # load, write, export, clear
โ”‚   โ”œโ”€โ”€ projects.py       # list_projects
โ”‚   โ”œโ”€โ”€ activities.py     # list, get, search, update
โ”‚   โ”œโ”€โ”€ analysis.py       # critical_path, float, quality
โ”‚   โ”œโ”€โ”€ resources.py      # list_resources, utilization
โ”‚   โ”œโ”€โ”€ progress.py       # progress, earned_value
โ”‚   โ””โ”€โ”€ calendars.py      # list_calendars
โ”œโ”€โ”€ prompts/              # 5 workflow prompts
โ”‚   โ””โ”€โ”€ analysis.py       # Preset workflows
โ”œโ”€โ”€ resources/            # 3 MCP resources
โ”‚   โ””โ”€โ”€ schedule.py       # Direct data access
โ””โ”€โ”€ http/                 # HTTP layer
    โ”œโ”€โ”€ middleware.py     # Auth middleware
    โ””โ”€โ”€ routes.py         # Health, upload endpoints

Tool Categories

Category Count Tools
File Operations 4 load_file, write_file, clear_cache, export_csv
Project/Activity 5 list_projects, list_activities, get_activity, search_activities, update_activity
Schedule Analysis 6 critical_path, float_analysis, schedule_quality, relationship_analysis, slipping_activities, schedule_health_check
Resource Management 2 list_resources, resource_utilization
Progress/Performance 4 progress_summary, earned_value, work_package_summary, wbs_analysis
Structure 1 list_calendars

See TOOLS.md for complete documentation.


Development

Run Tests

# All tests (27 tests)
pytest

# With coverage
pytest --cov=pyp6xer_mcp

# Specific test file
pytest tests/test_modular_structure.py -v

Linting & Formatting

black --line-length 100 .
ruff check .
mypy .

Build & Publish

# Build package
python -m build

# Publish to PyPI
python -m twine upload dist/*

Requirements

  • Python: 3.10+
  • Dependencies:
    • mcp>=1.0.0 - MCP protocol
    • pydantic>=2.0.0 - Input validation
    • PyP6XER>=0.1.0 - XER parsing
    • httpx>=0.24.0 - HTTP client
    • uvicorn>=0.23.0 - ASGI server

Need Help?

๐Ÿ’ผ Consulting Services

Need custom schedule analysis, integration, or P6 automation?

Contact: [Your consulting page/email]

Services:

  • Custom MCP tool development
  • P6 schedule optimization
  • Integration with project management systems
  • Training and workshops

Minimum engagement: $800

๐Ÿ› Bug Reports & Feature Requests

Open an issue on GitHub Issues (coming soon)

๐Ÿ“š Documentation


License

MIT License - see LICENSE for details.

Free for commercial and personal use. No attribution required.


Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyp6xer_mcp-1.0.0.tar.gz (122.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyp6xer_mcp-1.0.0-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file pyp6xer_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: pyp6xer_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 122.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for pyp6xer_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6c62756e88be0bd03d0bb545735428eb1422e1567742c49ab5ec1fb460f15915
MD5 45e52d2309dc09043856686985f7f543
BLAKE2b-256 2538c9106854ac52119b0a35f57744544034694a1b6eaa35343eb9586fa1b340

See more details on using hashes here.

File details

Details for the file pyp6xer_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyp6xer_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b1967c14a38a18693361614d3dc4ea96e1ab82f8b7e2111f32002b167cab668
MD5 7132d66d49ce0e3a2058244afa39745a
BLAKE2b-256 fe92cc7afcb195a3665957ad1d74c7ade3eb85ddc4d6e8f53b2128100ea0f432

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page