MS Project MCP Server
Control Microsoft Project via COM automation through the Model Context Protocol (MCP).
Prerequisites
- Windows with Microsoft Project installed (tested on MS Project 16.0)
- Python 3.10+
- mcp package:
pip install mcp - pywin32 for COM:
pip install pywin32 - python-dateutil (optional, for
add_recurring_task):pip install python-dateutil
Quick Start
-
Start MS Project and open a project file (or the server will create one).
-
Register in your
claude_desktop_config.json:
{
"mcpServers": {
"msproject": {
"command": "python",
"args": ["/path/to/msproject/server.py"]
}
}
}
- Run standalone (for testing):
python server.py
Tool Inventory (99 tools)
Project Management (7)
Task Queries (9)
Task Mutations (12)
Dependencies (4)
Resources (7)
Resource Assignments (3)
Resource Rate Tables (2)
Custom Fields (3)
Import / Export (6)
Calendars (7)
Calendar Working Hours (1)
Scheduling & Analysis (12)
Status Date & Progress Updates (2)
Timephased Data (1)
Baselines & Earned Value (4)
Variance & Reporting (1)
Cost & Work (2)
Progress Tracking (2)
Advanced Operations (8)
Multi-Project (3)
Filtering & Grouping (2)
Connectivity (1)
Enriched Task Data
Every task query (get_task, get_tasks, etc.) returns a rich dict with 35+ fields including:
Known Limitations
- COM proxy staleness: When multiple projects are open, switching projects invalidates existing COM references. Always call
switch_projectbefore operating on a different file. - Undo stack:
undo_lastsupports up to 10 consecutive undos. MS Project's COM undo is less reliable than the UI's. - File locking: Only one process can hold the COM connection. Don't open MS Project's GUI dialogs while the server is active.
- Timezone-aware dates: COM may return timezone-aware datetimes. The server normalizes these via
_to_naive()for safe comparisons. - Recurring tasks: MS Project's
RecurringTaskInsertis a dialog-only COM method. Theadd_recurring_tasktool simulates recurrence by creating individual occurrences under a summary task. Requirespython-dateutil. - Timephased data:
get_timephased_datacan be slow on large date ranges. Keep queries to reasonable periods (weeks/months, not years).
Tests
# Run all phases
python tests/test_new_tools.py # 11 tests (core CRUD)
python tests/test_phase2.py # 10 tests (resources, baselines, WBS)
python tests/test_phase3.py # 15 tests (custom fields, calendars, scheduling)
python tests/test_phase4.py # 23 tests (advanced ops, multi-project, filtering)
python tests/test_phase5.py # 11 tests (bug fixes, cost/work tracking)
python tests/test_phase6.py # 75 tests (timephased data, calendar mgmt, variance)
python tests/test_phase7.py # 57 tests (critical path intelligence, what-if)
202 tests total across 7 test suites. All tests require MS Project to be running (they create and close temporary projects).
Architecture
Single-file server (server.py, ~5,200 lines) using the FastMCP framework. All COM calls go through get_app() / get_proj() helpers. Dates are normalized with _to_naive() and formatted with _fmt_date().
Development Phases
Contributing
See CONTRIBUTING.md for development setup, conventions, and how to submit changes.
License
This project is licensed under the MIT License — see LICENSE for details.