diff --git a/README.md b/README.md index b8ccb59..561a815 100644 --- a/README.md +++ b/README.md @@ -1,280 +1,343 @@ # Plane MCP Server -The Plane MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Plane APIs, enabling projects, work items, and automations capabilities for develops and AI interfaces. +The Plane MCP Server brings the power of Model Context Protocol (MCP) to Plane, allowing AI agents and developer tools to interact programmatically with your Plane workspace. -## Use Cases +Whether you're building intelligent assistants, automation scripts, or workflow-driven tools, this server provides a seamless bridge to Plane’s API—so you can create projects, manage issues, assign tasks, and keep your work in sync with AI-powered tools. -- Create, update Projects and Work items -- Assign People, Properties, and Write Comments to progress on the Work -- Move and observe with various Work items in States -- Add Labels to the Work items -- Extracting and analyzing data from Projects and Members inside Plane -- Building AI powered tools and applications that interact with Plane's ecosystem +## What can you do with it? +This server unlocks all sorts of useful capabilities for anyone working with Plane: -## Configuration Parameters +- Spin up projects and work items directly from your AI or app interface. + +- Update progress, assign team members, set properties, or add comments—all programmatically. + +- Move issues through workflows and update their states on the fly. + +- Organize work with labels, modules, and cycles. + +- Analyze data about your team’s work across projects. + +- Build smart apps that interact naturally with Plane—whether it’s an AI agent logging work, or a bot keeping projects tidy. -1. `PLANE_API_KEY` - The user's API token. This can be obtained from the `/settings/api-tokens/` page in the UI. -2. `PLANE_WORKSPACE_SLUG` - The workspace slug for your Plane instance. -3. `PLANE_API_HOST_URL` (optional) - The host URL of the Plane API Server. Defaults to https://api.plane.so/ ## Tools ### Users -- `get_user` - Get the current user's information +- `get_user` + - Get the current user's information - No parameters required ### Projects -- `get_projects` - Get all projects for the current user - +- `get_projects` + - Get all projects for the current user - No parameters required -- `create_project` - Create a new project - - `name`: Project name (string, required) +- `create_project` + - Create a new project + - Parameters: + - `name` (string, required): Project name ### Issue Types -- `list_issue_types` - Get all issue types for a specific project - - - `project_id`: UUID of the project (string, required) - -- `get_issue_type` - Get details of a specific issue type - - - `project_id`: UUID of the project (string, required) - - `type_id`: UUID of the issue type (string, required) - -- `create_issue_type` - Create a new issue type in a project - - - `project_id`: UUID of the project (string, required) - - `issue_type_data`: Object containing: - - `name`: Name of the issue type (string, required) - - `description`: Description of the issue type (string, required) - -- `update_issue_type` - Update an existing issue type - - - `project_id`: UUID of the project (string, required) - - `type_id`: UUID of the issue type (string, required) - - `issue_type_data`: Fields to update on the issue type (object) - -- `delete_issue_type` - Delete an issue type - - `project_id`: UUID of the project (string, required) - - `type_id`: UUID of the issue type (string, required) +- `list_issue_types` + - Get all issue types for a specific project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `get_issue_type` + - Get details of a specific issue type + - Parameters: + - `project_id` (string, required): UUID of the project + - `type_id` (string, required): UUID of the issue type + +- `create_issue_type` + - Create a new issue type in a project + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_type_data`: Object containing: + - `name` (string, required): Name of the issue type + - `description` (string, required): Description of the issue type + +- `update_issue_type` + - Update an existing issue type + - Parameters: + - `project_id` (string, required): UUID of the project + - `type_id` (string, required): UUID of the issue type + - `issue_type_data` (object): Fields to update on the issue type + +- `delete_issue_type` + - Delete an issue type + - Parameters: + - `project_id` (string, required): UUID of the project + - `type_id` (string, required): UUID of the issue type ### States -- `list_states` - Get all states for a specific project - - - `project_id`: UUID of the project (string, required) - -- `get_state` - Get details of a specific state - - - `project_id`: UUID of the project (string, required) - - `state_id`: UUID of the state (string, required) - -- `create_state` - Create a new state in a project - - - `project_id`: UUID of the project (string, required) - - `state_data`: Object containing: - - `name`: Name of the state (string, required) - - `color`: Color code for the state (string, required) - -- `update_state` - Update an existing state - - - `project_id`: UUID of the project (string, required) - - `state_id`: UUID of the state (string, required) - - `state_data`: Fields to update on the state (object) - -- `delete_state` - Delete a state - - `project_id`: UUID of the project (string, required) - - `state_id`: UUID of the state (string, required) +- `list_states` + - Get all states for a specific project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `get_state` + - Get details of a specific state + - Parameters: + - `project_id` (string, required): UUID of the project + - `state_id` (string, required): UUID of the state + +- `create_state` + - Create a new state in a project + - Parameters: + - `project_id` (string, required): UUID of the project + - `state_data`: Object containing: + - `name` (string, required): Name of the state + - `color` (string, required): Color code for the state + +- `update_state` + - Update an existing state + - Parameters: + - `project_id` (string, required): UUID of the project + - `state_id` (string, required): UUID of the state + - `state_data` (object): Fields to update on the state + +- `delete_state` + - Delete a state + - Parameters: + - `project_id` (string, required): UUID of the project + - `state_id` (string, required): UUID of the state ### Labels -- `list_labels` - Get all labels for a specific project - - - `project_id`: UUID of the project (string, required) - -- `get_label` - Get details of a specific label - - - `project_id`: UUID of the project (string, required) - - `label_id`: UUID of the label (string, required) - -- `create_label` - Create a new label in a project - - - `project_id`: UUID of the project (string, required) - - `label_data`: Object containing: - - `name`: Name of the label (string, required) - - `color`: Color code for the label (string, required) - -- `update_label` - Update an existing label - - - `project_id`: UUID of the project (string, required) - - `label_id`: UUID of the label (string, required) - - `label_data`: Fields to update on the label (object) - -- `delete_label` - Delete a label - - `project_id`: UUID of the project (string, required) - - `label_id`: UUID of the label (string, required) +- `list_labels` + - Get all labels for a specific project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `get_label` + - Get details of a specific label + - Parameters: + - `project_id` (string, required): UUID of the project + - `label_id` (string, required): UUID of the label + +- `create_label` + - Create a new label in a project + - Parameters: + - `project_id` (string, required): UUID of the project + - `label_data`: Object containing: + - `name` (string, required): Name of the label + - `color` (string, required): Color code for the label + +- `update_label` + - Update an existing label + - Parameters: + - `project_id` (string, required): UUID of the project + - `label_id` (string, required): UUID of the label + - `label_data` (object): Fields to update on the label + +- `delete_label` + - Delete a label + - Parameters: + - `project_id` (string, required): UUID of the project + - `label_id` (string, required): UUID of the label ### Issues -- `get_issue_using_readable_identifier` - Get issue details using readable identifier (e.g., PROJ-123) - - - `project_identifier`: Project identifier (e.g., "PROJ") (string, required) - - `issue_identifier`: Issue number (e.g., "123") (string, required) - -- `get_issue_comments` - Get all comments for a specific issue - - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - -- `add_issue_comment` - Add a comment to an issue - - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - - `comment_html`: HTML content of the comment (string, required) - -- `create_issue` - Create a new issue - - - `project_id`: UUID of the project (string, required) - - `issue_data`: Object containing: - - `name`: Title of the issue (string, required) - - `description_html`: HTML description of the issue (string, required) - -- `update_issue` - Update an existing issue - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - - `issue_data`: Fields to update on the issue (object) +- `get_issue_using_readable_identifier` + - Get issue details using readable identifier (e.g., PROJ-123) + - Parameters: + - `project_identifier` (string, required) + - `issue_identifier` (string, required): Issue numbe: Project identifier (e.g., "PROJ") r (e.g., "123") + +- `get_issue_comments` + - Get all comments for a specific issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + +- `add_issue_comment` + - Add a comment to an issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + - `comment_html` (string, required): HTML content of the comment + +- `create_issue` + - Create a new issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_data`: Object containing: + - `name` (string, required): Title of the issue + - `description_html` (string, required): HTML description of the issue + +- `update_issue` + - Update an existing issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + - `issue_data` (object): Fields to update on the issue ### Modules -- `list_modules` - Get all modules for a specific project - - - `project_id`: UUID of the project (string, required) - -- `get_module` - Get details of a specific module - - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) - -- `create_module` - Create a new module in a project - - - `project_id`: UUID of the project (string, required) - - `module_data`: Object containing: - - `name`: Name of the module (string, required) - -- `update_module` - Update an existing module - - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) - - `module_data`: Fields to update on the module (object) - -- `delete_module` - Delete a module - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) +- `list_modules` + - Get all modules for a specific project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `get_module` + - Get details of a specific module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module + +- `create_module` + - Create a new module in a project + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_data`: Object containing: + - `name` (string, required): Name of the module + +- `update_module` + - Update an existing module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module + - `module_data` (object): Fields to update on the module + +- `delete_module` + - Delete a module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module ### Module Issues -- `list_module_issues` - Get all issues for a specific module - - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) - -- `add_module_issues` - Add issues to a module - - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) - - `issues`: Array of issue UUIDs to add (string[], required) - -- `delete_module_issue` - Remove an issue from a module - - `project_id`: UUID of the project (string, required) - - `module_id`: UUID of the module (string, required) - - `issue_id`: UUID of the issue to remove (string, required) +- `list_module_issues` + - Get all issues for a specific module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module + +- `add_module_issues` + - Add issues to a module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module + - `issues` (string[], required): Array of issue UUIDs to add + +- `delete_module_issue` + - Remove an issue from a module + - Parameters: + - `project_id` (string, required): UUID of the project + - `module_id` (string, required): UUID of the module + - `issue_id` (string, required): UUID of the issue to remove ### Cycles -- `list_cycles` - Get all cycles for a specific project - - - `project_id`: UUID of the project (string, required) - -- `get_cycle` - Get details of a specific cycle - - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) - -- `create_cycle` - Create a new cycle in a project - - - `project_id`: UUID of the project (string, required) - - `cycle_data`: Object containing: - - `name`: Name of the cycle (string, required) - - `start_date`: Start date (YYYY-MM-DD) (string, required) - - `end_date`: End date (YYYY-MM-DD) (string, required) - -- `update_cycle` - Update an existing cycle - - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) - - `cycle_data`: Fields to update on the cycle (object) - -- `delete_cycle` - Delete a cycle - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) +- `list_cycles` + - Get all cycles for a specific project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `get_cycle` + - Get details of a specific cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle + +- `create_cycle` + - Create a new cycle in a project + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_data`: Object containing: + - `name` (string, required): Name of the cycle + - `start_date` (string, required): Start date (YYYY-MM-DD) + - `end_date` (string, required) +: End date (YYYY-MM-DD) +- `update_cycle` + - Update an existing cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle + - `cycle_data` (object): Fields to update on the cycle + +- `delete_cycle` + - Delete a cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle ### Cycle Issues -- `list_cycle_issues` - Get all issues for a specific cycle - - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) - -- `add_cycle_issues` - Add issues to a cycle - - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) - - `issues`: Array of issue UUIDs to add (string[], required) - -- `delete_cycle_issue` - Remove an issue from a cycle - - `project_id`: UUID of the project (string, required) - - `cycle_id`: UUID of the cycle (string, required) - - `issue_id`: UUID of the issue to remove (string, required) +- `list_cycle_issues` + - Get all issues for a specific cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle + +- `add_cycle_issues` + - Add issues to a cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle + - `issues` (string[], required): Array of issue UUIDs to add + +- `delete_cycle_issue` + - Remove an issue from a cycle + - Parameters: + - `project_id` (string, required): UUID of the project + - `cycle_id` (string, required): UUID of the cycle + - `issue_id` (string, required): UUID of the issue to remove ### Work Logs -- `get_issue_worklogs` - Get all worklogs for a specific issue - - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - -- `get_total_worklogs` - Get total logged time for a project +- `get_issue_worklogs` + - Get all worklogs for a specific issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + +- `get_total_worklogs` + - Get total logged time for a project + - Parameters: + - `project_id` (string, required): UUID of the project + +- `create_worklog` + - Create a new worklog for an issue + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + - `worklog_data`: Object containing: + - `description` (string, required): Description of the work done + - `duration` (integer, required): Duration in minutes + +- `update_worklog` + - Update an existing worklog + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + - `worklog_id` (string, required): UUID of the worklog + - `worklog_data` (object): Fields to update on the worklog + +- `delete_worklog` + - Delete a worklog + - Parameters: + - `project_id` (string, required): UUID of the project + - `issue_id` (string, required): UUID of the issue + - `worklog_id` (string, required): UUID of the worklog - - `project_id`: UUID of the project (string, required) -- `create_worklog` - Create a new worklog for an issue - - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - - `worklog_data`: Object containing: - - `description`: Description of the work done (string, required) - - `duration`: Duration in minutes (integer, required) - -- `update_worklog` - Update an existing worklog - - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - - `worklog_id`: UUID of the worklog (string, required) - - `worklog_data`: Fields to update on the worklog (object) +## Configuration Parameters -- `delete_worklog` - Delete a worklog - - `project_id`: UUID of the project (string, required) - - `issue_id`: UUID of the issue (string, required) - - `worklog_id`: UUID of the worklog (string, required) +- `PLANE_API_KEY` - Your Plane API token. You can generate one from the Workspace Settings > API Tokens page (`/settings/api-tokens/`) in the Plane app. +- `PLANE_WORKSPACE_SLUG` - The workspace slug for your Plane instance. The workspace-slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. +- `PLANE_API_HOST_URL` (optional) - The host URL of the Plane API Server. Defaults to https://api.plane.so/ ## Usage ### Claude Desktop -Add Plane to [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) by editing your `claude_desktop_config.json`. +You can add Plane to [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) by updating your `claude_desktop_config.json`: ```json { @@ -287,7 +350,7 @@ Add Plane to [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) b ], "env": { "PLANE_API_KEY": "", - "PLANE_API_HOST_URL": "", "PLANE_WORKSPACE_SLUG": "" } } @@ -297,7 +360,7 @@ Add Plane to [Claude Desktop](https://modelcontextprotocol.io/quickstart/user) b ### VSCode -Add Plane to [VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server) by editing your `.vscode.json/mcp.json`. +You can also connect Plane to [VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server) by editing your `.vscode.json` or `mcp.json` file: ```json { @@ -310,7 +373,7 @@ Add Plane to [VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-server ], "env": { "PLANE_API_KEY": "", - "PLANE_API_HOST_URL": "", "PLANE_WORKSPACE_SLUG": "" } } @@ -319,6 +382,15 @@ Add Plane to [VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-server ``` + + +## Running evals + +The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found [here](https://www.mcpevals.io/docs). + +```bash +OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/tools/work-log.ts +``` ## License -This project is licensed under the terms of the MIT open source license. +This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. \ No newline at end of file diff --git a/package.json b/package.json index 9d71bd9..106dd69 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "@modelcontextprotocol/sdk": "^1.9.0", "@scarf/scarf": "^1.4.0", "axios": "^1.8.4", - "zod-to-json-schema": "^3.24.5" + "zod-to-json-schema": "^3.24.5", + "mcp-evals": "^1.0.18" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", @@ -52,4 +53,4 @@ "typescript": "^5.8.3", "zod": "^3.24.2" } -} +} \ No newline at end of file diff --git a/src/evals/evals.ts b/src/evals/evals.ts new file mode 100644 index 0000000..f705c2d --- /dev/null +++ b/src/evals/evals.ts @@ -0,0 +1,59 @@ +//evals.ts + +import { EvalConfig } from 'mcp-evals'; +import { openai } from "@ai-sdk/openai"; +import { grade, EvalFunction } from "mcp-evals"; + +const get_issue_worklogsEval: EvalFunction = { + name: "get_issue_worklogs Tool Evaluation", + description: "Evaluates the get_issue_worklogs tool functionality", + run: async () => { + const result = await grade(openai("gpt-4"), "Please retrieve all worklogs for the project with ID 'test_project_id' and the issue with ID 'test_issue_id' using the get_issue_worklogs tool."); + return JSON.parse(result); + } +}; + +const get_total_worklogsEval: EvalFunction = { + name: "get_total_worklogs Tool Evaluation", + description: "Evaluates the get_total_worklogs tool functionality to retrieve total worklogs for a project", + run: async () => { + const result = await grade(openai("gpt-4"), "Could you retrieve the total logged time for the project with ID '123e4567-e89b-12d3-a456-426614174000'?"); + return JSON.parse(result); + } +}; + +const create_worklogEval: EvalFunction = { + name: 'create_worklog Tool Evaluation', + description: 'Evaluates the creation of a new worklog for an issue', + run: async () => { + const result = await grade(openai("gpt-4"), "Please create a new worklog for the project with ID 12345 and issue with ID 67890 with a duration of 2 hours and description 'Working on front-end bug'."); + return JSON.parse(result); + } +}; + +const update_worklogEval: EvalFunction = { + name: "update_worklog Evaluation", + description: "Evaluates the update_worklog tool's functionality", + run: async () => { + const result = await grade(openai("gpt-4"), "Please update the worklog with ID '789' in the project '123' and issue '456' by changing the time spent to '90 minutes' and adding a new comment 'Updated worklog due to additional work'."); + return JSON.parse(result); + } +}; + +const delete_worklogEval: EvalFunction = { + name: 'delete_worklogEval', + description: 'Evaluates the functionality of the delete_worklog tool', + run: async () => { + const result = await grade(openai("gpt-4"), "Please delete the worklog with ID 'worklog_123' from the issue 'issue_456' in the project 'project_789'. Verify that the worklog is actually removed."); + return JSON.parse(result); + } +}; + +const config: EvalConfig = { + model: openai("gpt-4"), + evals: [get_issue_worklogsEval, get_total_worklogsEval, create_worklogEval, update_worklogEval, delete_worklogEval] +}; + +export default config; + +export const evals = [get_issue_worklogsEval, get_total_worklogsEval, create_worklogEval, update_worklogEval, delete_worklogEval]; \ No newline at end of file