Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plane_mcp/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
from plane_mcp.tools.projects import register_project_tools
from plane_mcp.tools.states import register_state_tools
from plane_mcp.tools.users import register_user_tools
from plane_mcp.tools.work_item_activities import register_work_item_activity_tools
from plane_mcp.tools.work_item_comments import register_work_item_comment_tools
from plane_mcp.tools.work_item_links import register_work_item_link_tools
from plane_mcp.tools.work_item_properties import register_work_item_property_tools
from plane_mcp.tools.work_item_relations import register_work_item_relation_tools
from plane_mcp.tools.work_item_types import register_work_item_type_tools
from plane_mcp.tools.unified import register_unified_tools
from plane_mcp.tools.work_items import register_work_item_tools
from plane_mcp.tools.work_logs import register_work_log_tools
from plane_mcp.tools.workspaces import register_workspace_tools


def register_tools(mcp: FastMCP) -> None:
"""Register all tools with the MCP server."""
register_unified_tools(mcp)
register_project_tools(mcp)
register_work_item_tools(mcp)
register_work_item_activity_tools(mcp)
register_work_item_comment_tools(mcp)
register_work_item_link_tools(mcp)
register_work_item_relation_tools(mcp)
Expand Down
93 changes: 0 additions & 93 deletions plane_mcp/tools/cycles.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,19 @@
"""Cycle-related tools for Plane MCP Server."""

from typing import Any

from fastmcp import FastMCP
from plane.models.cycles import (
CreateCycle,
Cycle,
PaginatedArchivedCycleResponse,
PaginatedCycleResponse,
PaginatedCycleWorkItemResponse,
TransferCycleWorkItemsRequest,
UpdateCycle,
)
from plane.models.work_items import WorkItem

from plane_mcp.client import get_plane_client_context


def register_cycle_tools(mcp: FastMCP) -> None:
"""Register all cycle-related tools with the MCP server."""

@mcp.tool()
def list_cycles(
project_id: str,
params: dict[str, Any] | None = None,
) -> list[Cycle]:
"""
List all cycles in a project.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
params: Optional query parameters as a dictionary

Returns:
List of Cycle objects
"""
client, workspace_slug = get_plane_client_context()
response: PaginatedCycleResponse = client.cycles.list(
workspace_slug=workspace_slug, project_id=project_id, params=params
)
return response.results

@mcp.tool()
def create_cycle(
project_id: str,
Expand Down Expand Up @@ -88,22 +60,6 @@ def create_cycle(

return client.cycles.create(workspace_slug=workspace_slug, project_id=project_id, data=data)

@mcp.tool()
def retrieve_cycle(project_id: str, cycle_id: str) -> Cycle:
"""
Retrieve a cycle by ID.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle

Returns:
Cycle object
"""
client, workspace_slug = get_plane_client_context()
return client.cycles.retrieve(workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id)

@mcp.tool()
def update_cycle(
project_id: str,
Expand Down Expand Up @@ -164,28 +120,6 @@ def delete_cycle(project_id: str, cycle_id: str) -> None:
client, workspace_slug = get_plane_client_context()
client.cycles.delete(workspace_slug=workspace_slug, project_id=project_id, cycle_id=cycle_id)

@mcp.tool()
def list_archived_cycles(
project_id: str,
params: dict[str, Any] | None = None,
) -> list[Cycle]:
"""
List archived cycles in a project.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
params: Optional query parameters as a dictionary

Returns:
List of archived Cycle objects
"""
client, workspace_slug = get_plane_client_context()
response: PaginatedArchivedCycleResponse = client.cycles.list_archived(
workspace_slug=workspace_slug, project_id=project_id, params=params
)
return response.results

@mcp.tool()
def add_work_items_to_cycle(
project_id: str,
Expand Down Expand Up @@ -232,33 +166,6 @@ def remove_work_item_from_cycle(
work_item_id=work_item_id,
)

@mcp.tool()
def list_cycle_work_items(
project_id: str,
cycle_id: str,
params: dict[str, Any] | None = None,
) -> list[WorkItem]:
"""
List work items in a cycle.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
cycle_id: UUID of the cycle
params: Optional query parameters as a dictionary

Returns:
List of WorkItem objects in the cycle
"""
client, workspace_slug = get_plane_client_context()
response: PaginatedCycleWorkItemResponse = client.cycles.list_work_items(
workspace_slug=workspace_slug,
project_id=project_id,
cycle_id=cycle_id,
params=params,
)
return response.results

@mcp.tool()
def transfer_cycle_work_items(
project_id: str,
Expand Down
61 changes: 1 addition & 60 deletions plane_mcp/tools/epics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from fastmcp import FastMCP
from plane import PlaneClient
from plane.models.enums import PriorityEnum
from plane.models.epics import Epic, PaginatedEpicResponse
from plane.models.query_params import PaginatedQueryParams, RetrieveQueryParams
from plane.models.epics import Epic
from plane.models.work_item_types import WorkItemType
from plane.models.work_items import (
CreateWorkItem,
Expand All @@ -32,38 +31,6 @@ def _get_epic_work_item_type(client: PlaneClient, workspace_slug: str, project_i

return None

@mcp.tool()
def list_epics(
project_id: str,
cursor: str | None = None,
per_page: int | None = None,
) -> list[Epic]:
"""
List all epics in a project.

Args:
project_id: UUID of the project
cursor: Pagination cursor for getting next set of results
per_page: Number of results per page (1-100)

Returns:
List of Epic objects
"""
client, workspace_slug = get_plane_client_context()

params = PaginatedQueryParams(
cursor=cursor,
per_page=per_page,
)

response: PaginatedEpicResponse = client.epics.list(
workspace_slug=workspace_slug,
project_id=project_id,
params=params,
)

return response.results

@mcp.tool()
def create_epic(
project_id: str,
Expand Down Expand Up @@ -235,32 +202,6 @@ def update_epic(
epic_id=work_item.id,
)

@mcp.tool()
def retrieve_epic(
project_id: str,
epic_id: str,
) -> Epic:
"""
Retrieve an epic by ID.

Args:
project_id: UUID of the project
epic_id: UUID of the epic

Returns:
Epic object
"""
client, workspace_slug = get_plane_client_context()

params = RetrieveQueryParams()

return client.epics.retrieve(
workspace_slug=workspace_slug,
project_id=project_id,
epic_id=epic_id,
params=params,
)

@mcp.tool()
def delete_epic(
project_id: str,
Expand Down
36 changes: 0 additions & 36 deletions plane_mcp/tools/initiatives.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Initiative-related tools for Plane MCP Server."""

from typing import Any

from fastmcp import FastMCP
from plane.models.enums import InitiativeState
from plane.models.initiatives import (
CreateInitiative,
Initiative,
PaginatedInitiativeResponse,
UpdateInitiative,
)

Expand All @@ -17,24 +14,6 @@
def register_initiative_tools(mcp: FastMCP) -> None:
"""Register all initiative-related tools with the MCP server."""

@mcp.tool()
def list_initiatives(
params: dict[str, Any] | None = None,
) -> list[Initiative]:
"""
List all initiatives in a workspace.

Args:
workspace_slug: The workspace slug identifier
params: Optional query parameters as a dictionary (e.g., per_page, cursor)

Returns:
List of Initiative objects
"""
client, workspace_slug = get_plane_client_context()
response: PaginatedInitiativeResponse = client.initiatives.list(workspace_slug=workspace_slug, params=params)
return response.results

@mcp.tool()
def create_initiative(
name: str,
Expand Down Expand Up @@ -75,21 +54,6 @@ def create_initiative(

return client.initiatives.create(workspace_slug=workspace_slug, data=data)

@mcp.tool()
def retrieve_initiative(initiative_id: str) -> Initiative:
"""
Retrieve an initiative by ID.

Args:
workspace_slug: The workspace slug identifier
initiative_id: UUID of the initiative

Returns:
Initiative object
"""
client, workspace_slug = get_plane_client_context()
return client.initiatives.retrieve(workspace_slug=workspace_slug, initiative_id=initiative_id)

@mcp.tool()
def update_initiative(
initiative_id: str,
Expand Down
61 changes: 0 additions & 61 deletions plane_mcp/tools/intake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,15 @@
from plane.models.intake import (
CreateIntakeWorkItem,
IntakeWorkItem,
PaginatedIntakeWorkItemResponse,
UpdateIntakeWorkItem,
)
from plane.models.query_params import PaginatedQueryParams, RetrieveQueryParams

from plane_mcp.client import get_plane_client_context


def register_intake_tools(mcp: FastMCP) -> None:
"""Register all intake work item-related tools with the MCP server."""

@mcp.tool()
def list_intake_work_items(
project_id: str,
params: dict[str, Any] | None = None,
) -> list[IntakeWorkItem]:
"""
List all intake work items in a project.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
params: Optional query parameters as a dictionary (e.g., per_page, cursor)

Returns:
List of IntakeWorkItem objects
"""
client, workspace_slug = get_plane_client_context()

query_params = None
if params:
query_params = PaginatedQueryParams(**params)

response: PaginatedIntakeWorkItemResponse = client.intake.list(
workspace_slug=workspace_slug, project_id=project_id, params=query_params
)
return response.results

@mcp.tool()
def create_intake_work_item(
project_id: str,
Expand All @@ -66,38 +37,6 @@ def create_intake_work_item(

return client.intake.create(workspace_slug=workspace_slug, project_id=project_id, data=intake_data)

@mcp.tool()
def retrieve_intake_work_item(
project_id: str,
work_item_id: str,
params: dict[str, Any] | None = None,
) -> IntakeWorkItem:
"""
Retrieve an intake work item by work item ID.

Args:
workspace_slug: The workspace slug identifier
project_id: UUID of the project
work_item_id: UUID of the work item (use the issue field from
IntakeWorkItem response, not the intake work item ID)
params: Optional query parameters as a dictionary (e.g., expand, fields)

Returns:
IntakeWorkItem object
"""
client, workspace_slug = get_plane_client_context()

query_params = None
if params:
query_params = RetrieveQueryParams(**params)

return client.intake.retrieve(
workspace_slug=workspace_slug,
project_id=project_id,
work_item_id=work_item_id,
params=query_params,
)

@mcp.tool()
def update_intake_work_item(
project_id: str,
Expand Down
Loading