Primavera P6 XER文件解析服务器

一个基于Model Context Protocol (MCP)的全功能服务器,用于解析、查询和分析Primavera P6 XER文件。

  • by osama-ata
  • Python
  • 本地部署
  • 12 星标
  • 更新于
在 GitHub 查看 osama-ata/p6xer-mcp-server

使用说明

P6XER MCP服务器

mcp名称:io.github.osama-ata/p6xer-mcp服务器

功能齐全 模型上下文协议(MCP) 服务器 Primavera P6 XER 文件,基于 PyP6XER.

暴露 13工具, 3资源,以及 2提示 因此,任何兼容MCP的AI客户端(Claude Desktop、Claude Code、Cursor等)都可以交互式地解析、查询和分析 .xer 计划文件。


🚀 特性

🔧 工具(13)

工具 说明
parse_xer_file 解析XER文件——项目列表、总计、状态细分
get_project_activities 带有过滤器的活动:project_id、project_short_name、状态、task_type
get_critical_path 关键路径活动(浮动≤0),按提前开始排序
analyze_resource_utilization 每种资源的计划/实际小时数和成本;过度分配标志
check_schedule_quality DCMA风格检查:缺少逻辑、持续时间长、浮点数高、任务未来源
get_resources 列出资源,可选择按类型筛选
get_resource_assignments 资源——具有丰富名称和成本的活动任务
get_wbs 工作分解结构层次结构
get_relationships 任务代码丰富了前后关系
get_calendars 包含每个时段小时数数据的日历定义
get_schedule_summary 一目了然的统计数据:计数、日期范围、临界计数
get_earned_value EVM:每个项目的PV、EV、AC、CV、SV、CPI、SPI、EAC
get_activity_detail 一项活动的全部细节(preds+succs+资源)

📋 资源(3)

URI 描述
xer-project://{file_path}/{project_id} 特定项目的详细文本摘要
xer-activities://{file_path} 活动总结,包括状态细分和持续时间统计
xer-resources://{file_path} 资源摘要,包括类型细分和分配统计数据

💬 提示(2)

提示 类型
analyze_xer_project general · schedule · resources · progress · quality
xer_reporting_prompt executive · detailed · critical_path · resource · milestone

� 从应用商店安装

通过PyPI(uvx——无需安装)

uvx p6xer-mcp-server

通过PyPI(pip)

pip install p6xer-mcp-server
p6xer-mcp-server

通过史密瑟里

搜索 p6xer-mcp-server 上 史密斯艾 然后单击安装。 它将自动生成正确的Claude Desktop配置。

通过GitHub MCP注册表

服务器列在GitHub MCP注册表中。在克劳德代码中:

claude mcp add p6xer -- uvx p6xer-mcp-server

Claude桌面配置(安装PyPI后)

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

�📦 安装

# Clone the repo
git clone https://github.com/osama-ata/p6xer-mcp-server.git
cd p6xer-mcp-server

# Install with uv (recommended)
uv sync

# Or with pip
pip install "mcp[cli]>=1.6.0,<2.0.0" pyp6xer

🏃 跑步

开发/MCP检查员:

uv run mcp dev src/p6xer_mcp_server/server.py

Stdio(克劳德桌面/克劳德代码):

uv run p6xer-mcp-server

🔌 克劳德桌面

添加 claude_desktop_config.json:

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

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 视窗: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

🔌 克劳德代码(CLI)

claude mcp add p6xer -- uvx p6xer-mcp-server

💬 示例提示

连接后:

Parse project.xer and give me an overview of all projects

What are all 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?

Show all resource assignments for "John Smith"

What are the predecessors and successors of activity A1000?

List all over-allocated labor resources

Generate an executive summary report for project.xer

📊 工具参考

过滤器参数(大多数工具都接受)

  • project_id –数字P6项目ID(例如。 "1234")
  • project_short_name –项目短名称字符串(例如。 "PROJ1")

状态码

TK_NotStart · TK_Active · TK_Complete

任务类型

TT_Task · TT_Mile · TT_FinMile · TT_WBS

资源类型

RT_Labor · RT_Mat · RT_Equip


🗂️ 项目结构

p6xer-mcp-server/
├── src/
│   └── p6xer_mcp_server/
│       ├── __init__.py
│       └── server.py       # All tools, resources, and prompts
├── manifest.json           # MCPB bundle manifest
├── mcp.json                # MCP registry metadata
├── smithery.yaml           # Smithery registry configuration
├── pyproject.toml
└── README.md

📋 需求

  • Python≥3.10
  • mcp[cli] >= 1.6.0, < 2.0.0
  • pyp6xer >= 1.16.0

📄 许可证

麻省理工学院


🚢 发布到PyPI(GitHub操作+可信发布)

此存储库包括一个发布工作流,位于 .github/workflows/publish-to-pypi.yml 基于PyPA指南和 pypa/gh-action-pypi-publish.

1) 配置受信任的发布者

为此确切的工作流文件创建受信任的发布者:

  • PyPI:https://pypi.org/manage/account/publishing/
  • TestPyPI:https://test.pypi.org/manage/account/publishing/

使用这些值:

  • 业主: osama-ata
  • 存储库: p6xer-mcp-server
  • 工作流文件: publish-to-pypi.yml
  • 环境: pypi (对于PyPI), testpypi (适用于TestPyPI)
  • 项目名称: p6xer-mcp-server

2) 创建GitHub环境

在存储库设置中,创建两个环境:

  • pypi
  • testpypi

建议的安全设置:

  • 需要手动批准 pypi
  • 无需批准 testpypi

3) 本地构建(可选健全性检查)

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*

4) 释放流量

  • 推至 main:发布到TestPyPI
  • 推送标签 v* (例如 v0.1.1):发布到PyPI
git tag v0.1.1
git push origin v0.1.1