feat: add native sprint & backlog support, advanced WP filters, and improved error handling#25
feat: add native sprint & backlog support, advanced WP filters, and improved error handling#25MacherelR wants to merge 2 commits into
Conversation
|
Thanks for this, @MacherelR — your PR (and #20) are what put the OpenProject 17.3+ sprint API on our radar. For transparency: LS Instruments maintains an actively developed downstream fork of this project (https://github.com/LS-Instruments/openproject-mcp-server) for day-to-day agentic project management on OpenProject, maintained independently for now given the current upstream review cadence. We've implemented native sprint & backlog tools there, but as a clean, from-scratch implementation rather than a port — no code was taken from this PR, so there's no licensing entanglement; your work is acknowledged as inspiration in our NOTICE. One finding worth sharing from our live testing on 17.5.1: story points do not round-trip through the API v3 (no Our implementation is on our Happy to compare notes if you're still working in this area. Thanks again. |
Adds 4 tools over the OpenProject 17.3+ sprint API (Backlogs module): - list_sprints — sprints, optionally by project and status (in_planning / active / completed); status is filtered client-side because the API models it via _links.status - get_sprint — a single sprint's details - list_sprint_work_packages — work packages in a sprint (WP filter sprint="=") - list_backlog_work_packages — the product backlog (WP filter sprint="!*") Plus client methods get_sprints / get_sprint. Work-package listings reuse the shared format_work_package_list formatter. Story points and a sprint-assignment write path are intentionally excluded: verified on OpenProject 17.5.1 that story points do not round-trip through the API v3 (no storyPoints attribute or filter), so surfacing them would mislead. Clean, from-scratch implementation informed by a live spike; no code is ported. Upstream PR AndyEverything#25 (@MacherelR) and issue AndyEverything#20 surfaced the sprint API and are acknowledged as inspiration only. Verified: network-free unit tests (status parsing, formatting, filter construction) and an end-to-end smoke on ephemeral OpenProject 17.5.1 (create a sprint, assign one WP, leave one in the backlog; all 4 tools return correct, correctly-discriminated results). Closes #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
This branch brings the MCP server up to date with OpenProject 17.3+ by adding
native sprint and backlog integration, and includes two quality-of-life
improvements that were already on this fork: advanced work package filtering
and richer API error messages.
What changed
New: Sprint & Backlog tools (
src/tools/sprints.py)list_sprints— list sprints for a project or globally, filterable bystatus (
in_planning/active/completed)get_sprint— fetch a single sprint by IDlist_sprint_work_packages— list all work packages in a sprint, withtotal story point count in the header
list_backlog_work_packages— list the product backlog (work packages notassigned to any sprint), filterable by type and priority
Updated: Sprint & story point fields on work packages (
src/tools/work_packages.py,src/client.py)create_work_package— newsprint_idandstory_pointsparamsupdate_work_package— newsprint_id,remove_from_sprint, andstory_pointsparams; settingremove_from_sprint=truereturns a WPto the product backlog
list_work_packages— newsprint_idsfilter (comma-separated) andbacklog_onlyboolean flagUpdated: Advanced work package filters (
src/tools/work_packages.py)priority_ids,type_ids,status_ids,version_idsdue_before,due_after,created_after,updated_afterunassigned_only,overdue_only,no_parent_onlypercentage_done_min/percentage_done_maxlist_overdue_work_packages,list_work_packages_due_soon,list_unassigned_work_packages,list_work_packages_created_recently,list_high_priority_work_packages,list_work_packages_nearly_completeUpdated: Improved API error messages (
src/client.py)messagefield and_embedded.details.attributevalidation errors from the JSON body insteadof surfacing the raw response string
API surface (OpenProject 17.3+)
/api/v3/projects/{id}/sprintslist_sprints/api/v3/sprintslist_sprints(global)/api/v3/sprints/{id}get_sprintstoryPoints_links.sprintBreaking changes
None. All new parameters are optional and default to their previous behaviour.
The
version_idparameter on create/update is unchanged;sprint_idisadditive.
Test plan
list_sprintsreturns sprints for a project with the Backlogs moduleenabled, and respects the
statusfilterlist_sprint_work_packagesreturns WPs for a sprint and shows the totalstory point sum in the header
list_backlog_work_packagesreturns only WPs without a sprint assignedcreate_work_packagewithsprint_idcreates the WP inside that sprintupdate_work_packagewithremove_from_sprint=truemoves the WP backto the backlog
update_work_packagewithstory_points=5sets the storyPoints fieldrather than the raw JSON blob
🤖 Generated with the help of Claude Code