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.
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
- Check that
claude_desktop_config.jsonis in the correct location - Ensure JSON is valid (no trailing commas)
- Restart Claude Desktop completely (Quit, not just close window)
- Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
"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 protocolpydantic>=2.0.0- Input validationPyP6XER>=0.1.0- XER parsinghttpx>=0.24.0- HTTP clientuvicorn>=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
- TOOLS.md - Complete tool reference
- CLAUDE.md - Developer documentation
- Model Context Protocol Docs
License
MIT License - see LICENSE for details.
Free for commercial and personal use. No attribution required.
Acknowledgments
- PyP6Xer by Hassan Emam - XER parsing library
- Model Context Protocol by Anthropic - Protocol specification
- FastMCP - Python MCP framework
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c62756e88be0bd03d0bb545735428eb1422e1567742c49ab5ec1fb460f15915
|
|
| MD5 |
45e52d2309dc09043856686985f7f543
|
|
| BLAKE2b-256 |
2538c9106854ac52119b0a35f57744544034694a1b6eaa35343eb9586fa1b340
|
File details
Details for the file pyp6xer_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyp6xer_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 49.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b1967c14a38a18693361614d3dc4ea96e1ab82f8b7e2111f32002b167cab668
|
|
| MD5 |
7132d66d49ce0e3a2058244afa39745a
|
|
| BLAKE2b-256 |
fe92cc7afcb195a3665957ad1d74c7ade3eb85ddc4d6e8f53b2128100ea0f432
|