p6xer-mcp-server 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,82 @@
1
+ name: Publish Python distribution
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "v*"
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: read
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@v6
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v6
25
+ with:
26
+ python-version: "3.x"
27
+
28
+ - name: Install build frontend
29
+ run: python -m pip install --upgrade build
30
+
31
+ - name: Build sdist and wheel
32
+ run: python -m build
33
+
34
+ - name: Store distribution packages
35
+ uses: actions/upload-artifact@v5
36
+ with:
37
+ name: python-package-distributions
38
+ path: dist/
39
+
40
+ publish-to-testpypi:
41
+ name: Publish to TestPyPI
42
+ if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
43
+ needs:
44
+ - build
45
+ runs-on: ubuntu-latest
46
+ environment:
47
+ name: testpypi
48
+ url: https://test.pypi.org/p/p6xer-mcp-server
49
+ permissions:
50
+ id-token: write
51
+ steps:
52
+ - name: Download distribution packages
53
+ uses: actions/download-artifact@v6
54
+ with:
55
+ name: python-package-distributions
56
+ path: dist/
57
+
58
+ - name: Publish distribution to TestPyPI
59
+ uses: pypa/gh-action-pypi-publish@release/v1
60
+ with:
61
+ repository-url: https://test.pypi.org/legacy/
62
+
63
+ publish-to-pypi:
64
+ name: Publish to PyPI
65
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
66
+ needs:
67
+ - build
68
+ runs-on: ubuntu-latest
69
+ environment:
70
+ name: pypi
71
+ url: https://pypi.org/p/p6xer-mcp-server
72
+ permissions:
73
+ id-token: write
74
+ steps:
75
+ - name: Download distribution packages
76
+ uses: actions/download-artifact@v6
77
+ with:
78
+ name: python-package-distributions
79
+ path: dist/
80
+
81
+ - name: Publish distribution to PyPI
82
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,175 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+ .claude/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Osama Ata
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,290 @@
1
+ Metadata-Version: 2.4
2
+ Name: p6xer-mcp-server
3
+ Version: 0.1.0
4
+ Summary: MCP server for Primavera P6 XER schedule files โ€” parse, analyze, and quality-check with AI
5
+ Project-URL: Homepage, https://github.com/osama-ata/p6xer-mcp-server
6
+ Project-URL: Repository, https://github.com/osama-ata/p6xer-mcp-server
7
+ Project-URL: Documentation, https://github.com/osama-ata/p6xer-mcp-server#readme
8
+ Project-URL: Issues, https://github.com/osama-ata/p6xer-mcp-server/issues
9
+ Author: Osama Ata
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: construction,mcp,p6,primavera,project-management,scheduling,xer
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: mcp[cli]<2.0.0,>=1.6.0
23
+ Requires-Dist: pyp6xer>=1.16.0
24
+ Description-Content-Type: text/markdown
25
+
26
+ # P6XER MCP Server
27
+
28
+ [![PyPI version](https://badge.fury.io/py/p6xer-mcp-server.svg)](https://badge.fury.io/py/p6xer-mcp-server)
29
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
30
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
31
+ [![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)
32
+
33
+ A full-featured [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for **Primavera P6 XER** files, built on [PyP6XER](https://github.com/HassanEmam/PyP6Xer).
34
+
35
+ Exposes **13 Tools**, **3 Resources**, and **2 Prompts** so any MCP-compatible AI client (Claude Desktop, Claude Code, Cursor, etc.) can interactively parse, query, and analyze `.xer` schedule files.
36
+
37
+ ---
38
+
39
+ ## ๐Ÿš€ Features
40
+
41
+ ### ๐Ÿ”ง Tools (13)
42
+
43
+ | Tool | Description |
44
+ |------|-------------|
45
+ | `parse_xer_file` | Parse an XER file โ€” project list, totals, status breakdowns |
46
+ | `get_project_activities` | Activities with filters: project_id, project_short_name, status, task_type |
47
+ | `get_critical_path` | Critical path activities (float โ‰ค 0), sorted by early start |
48
+ | `analyze_resource_utilization` | Planned/actual hours & costs per resource; over-allocation flags |
49
+ | `check_schedule_quality` | DCMA-style check: missing logic, long durations, high float, unresourced tasks |
50
+ | `get_resources` | List resources, optionally filtered by type |
51
+ | `get_resource_assignments` | Resourceโ€“activity assignments with enriched names and costs |
52
+ | `get_wbs` | Work Breakdown Structure hierarchy |
53
+ | `get_relationships` | Predecessor/successor relationships enriched with task codes |
54
+ | `get_calendars` | Calendar definitions with hours-per-period data |
55
+ | `get_schedule_summary` | At-a-glance stats: counts, date range, critical count |
56
+ | `get_earned_value` | EVM: PV, EV, AC, CV, SV, CPI, SPI, EAC per project |
57
+ | `get_activity_detail` | Full detail for one activity (preds + succs + resources) |
58
+
59
+ ### ๐Ÿ“‹ Resources (3)
60
+
61
+ | URI | Description |
62
+ |-----|-------------|
63
+ | `xer-project://{file_path}/{project_id}` | Detailed text summary of a specific project |
64
+ | `xer-activities://{file_path}` | Activities summary with status breakdown and duration stats |
65
+ | `xer-resources://{file_path}` | Resources summary with type breakdown and assignment stats |
66
+
67
+ ### ๐Ÿ’ฌ Prompts (2)
68
+
69
+ | Prompt | Types |
70
+ |--------|-------|
71
+ | `analyze_xer_project` | `general` ยท `schedule` ยท `resources` ยท `progress` ยท `quality` |
72
+ | `xer_reporting_prompt` | `executive` ยท `detailed` ยท `critical_path` ยท `resource` ยท `milestone` |
73
+
74
+ ---
75
+
76
+ ## ๏ฟฝ Install from Store
77
+
78
+ ### Via PyPI (uvx โ€” no install needed)
79
+ ```bash
80
+ uvx p6xer-mcp-server
81
+ ```
82
+
83
+ ### Via PyPI (pip)
84
+ ```bash
85
+ pip install p6xer-mcp-server
86
+ p6xer-mcp-server
87
+ ```
88
+
89
+ ### Via Smithery
90
+ Search for `p6xer-mcp-server` on [smithery.ai](https://smithery.ai) and click Install.
91
+ It will generate the correct Claude Desktop config automatically.
92
+
93
+ ### Via GitHub MCP Registry
94
+ The server is listed in the GitHub MCP Registry. In Claude Code:
95
+ ```bash
96
+ claude mcp add p6xer -- uvx p6xer-mcp-server
97
+ ```
98
+
99
+ ### Claude Desktop config (after PyPI install)
100
+ ```json
101
+ {
102
+ "mcpServers": {
103
+ "p6xer": {
104
+ "command": "uvx",
105
+ "args": ["p6xer-mcp-server"]
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ ---
112
+
113
+ ## ๏ฟฝ๐Ÿ“ฆ Installation
114
+
115
+ ```bash
116
+ # Clone the repo
117
+ git clone https://github.com/osama-ata/p6xer-mcp-server.git
118
+ cd p6xer-mcp-server
119
+
120
+ # Install with uv (recommended)
121
+ uv sync
122
+
123
+ # Or with pip
124
+ pip install "mcp[cli]>=1.6.0,<2.0.0" pyp6xer
125
+ ```
126
+
127
+ ---
128
+
129
+ ## ๐Ÿƒ Running
130
+
131
+ **Development / MCP Inspector:**
132
+ ```bash
133
+ uv run mcp dev src/p6xer_mcp_server/server.py
134
+ ```
135
+
136
+ **Stdio (Claude Desktop / Claude Code):**
137
+ ```bash
138
+ uv run p6xer-mcp-server
139
+ ```
140
+
141
+ ---
142
+
143
+ ## ๐Ÿ”Œ Claude Desktop
144
+
145
+ Add to `claude_desktop_config.json`:
146
+
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "p6xer": {
151
+ "command": "uvx",
152
+ "args": ["p6xer-mcp-server"]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ Config file locations:
159
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
160
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
161
+ - **Linux**: `~/.config/Claude/claude_desktop_config.json`
162
+
163
+ ## ๐Ÿ”Œ Claude Code (CLI)
164
+
165
+ ```bash
166
+ claude mcp add p6xer -- uvx p6xer-mcp-server
167
+ ```
168
+
169
+ ---
170
+
171
+ ## ๐Ÿ’ฌ Example Prompts
172
+
173
+ Once connected:
174
+
175
+ ```
176
+ Parse project.xer and give me an overview of all projects
177
+
178
+ What are all the critical path activities, sorted by start date?
179
+
180
+ Run a DCMA schedule quality check on project.xer
181
+
182
+ Calculate earned value metrics โ€” what are the CPI and SPI?
183
+
184
+ Show all resource assignments for "John Smith"
185
+
186
+ What are the predecessors and successors of activity A1000?
187
+
188
+ List all over-allocated labor resources
189
+
190
+ Generate an executive summary report for project.xer
191
+ ```
192
+
193
+ ---
194
+
195
+ ## ๐Ÿ“Š Tool Reference
196
+
197
+ ### Filter parameters (most tools accept)
198
+ - `project_id` โ€“ numeric P6 project ID (e.g. `"1234"`)
199
+ - `project_short_name` โ€“ project short name string (e.g. `"PROJ1"`)
200
+
201
+ ### Status codes
202
+ `TK_NotStart` ยท `TK_Active` ยท `TK_Complete`
203
+
204
+ ### Task types
205
+ `TT_Task` ยท `TT_Mile` ยท `TT_FinMile` ยท `TT_WBS`
206
+
207
+ ### Resource types
208
+ `RT_Labor` ยท `RT_Mat` ยท `RT_Equip`
209
+
210
+ ---
211
+
212
+ ## ๐Ÿ—‚๏ธ Project Structure
213
+
214
+ ```
215
+ p6xer-mcp-server/
216
+ โ”œโ”€โ”€ src/
217
+ โ”‚ โ””โ”€โ”€ p6xer_mcp_server/
218
+ โ”‚ โ”œโ”€โ”€ __init__.py
219
+ โ”‚ โ””โ”€โ”€ server.py # All tools, resources, and prompts
220
+ โ”œโ”€โ”€ manifest.json # MCPB bundle manifest
221
+ โ”œโ”€โ”€ mcp.json # MCP registry metadata
222
+ โ”œโ”€โ”€ smithery.yaml # Smithery registry configuration
223
+ โ”œโ”€โ”€ pyproject.toml
224
+ โ””โ”€โ”€ README.md
225
+ ```
226
+
227
+ ---
228
+
229
+ ## ๐Ÿ“‹ Requirements
230
+
231
+ - Python โ‰ฅ 3.10
232
+ - `mcp[cli] >= 1.6.0, < 2.0.0`
233
+ - `pyp6xer >= 1.16.0`
234
+
235
+ ---
236
+
237
+ ## ๐Ÿ“„ License
238
+
239
+ MIT
240
+
241
+ ---
242
+
243
+ ## ๐Ÿšข Publishing to PyPI (GitHub Actions + Trusted Publishing)
244
+
245
+ This repository includes a release workflow at `.github/workflows/publish-to-pypi.yml` based on the PyPA guide and `pypa/gh-action-pypi-publish`.
246
+
247
+ ### 1) Configure Trusted Publishers
248
+
249
+ Create trusted publishers for this exact workflow file:
250
+
251
+ - PyPI: https://pypi.org/manage/account/publishing/
252
+ - TestPyPI: https://test.pypi.org/manage/account/publishing/
253
+
254
+ Use these values:
255
+
256
+ - Owner: `osama-ata`
257
+ - Repository: `p6xer-mcp-server`
258
+ - Workflow file: `publish-to-pypi.yml`
259
+ - Environment: `pypi` (for PyPI), `testpypi` (for TestPyPI)
260
+ - Project name: `p6xer-mcp-server`
261
+
262
+ ### 2) Create GitHub Environments
263
+
264
+ In repository settings, create two environments:
265
+
266
+ - `pypi`
267
+ - `testpypi`
268
+
269
+ Recommended security setup:
270
+
271
+ - Require manual approval for `pypi`
272
+ - No approval required for `testpypi`
273
+
274
+ ### 3) Build locally (optional sanity check)
275
+
276
+ ```bash
277
+ python -m pip install --upgrade build twine
278
+ python -m build
279
+ python -m twine check dist/*
280
+ ```
281
+
282
+ ### 4) Release flow
283
+
284
+ - Push to `main`: publishes to TestPyPI
285
+ - Push tag `v*` (for example `v0.1.1`): publishes to PyPI
286
+
287
+ ```bash
288
+ git tag v0.1.1
289
+ git push origin v0.1.1
290
+ ```