Skip to content

Commit a74ee68

Browse files
authored
feat(linear): add more Linear tools (#2467)
* feat(linear): align tool coverage with MCP list/get endpoints * chore(linear): bump plugin version to 0.0.2 * chore(linear): bump dify plugin sdk range * fix(linear): remove sensitive data from log messages * fix(linear): prevent GraphQL injection by using query variables Replace f-string interpolation of user input in GraphQL queries with proper query variables to prevent injection attacks. This affects 9 tool files that were building filter strings via string interpolation. Changes: - Replace f-string filter building with GraphQL variable objects - Pass variables dict to query_graphql() method - Maintain same functionality while preventing injection Fixes security vulnerability in: - linear_list_projects.py - linear_list_cycles.py - linear_get_teams.py - linear_list_issue_statuses.py - linear_list_documents.py - linear_get_users.py (complex nested OR/AND filters) - linear_list_project_labels.py - linear_list_issue_labels.py - linear_get_user_issues.py * fix(linear): add comprehensive security hardening - Add resource whitelist validation to prevent GraphQL injection attacks - Sanitize error messages to prevent information disclosure - Add input length validation (title: 255 chars, description/body: 50,000 chars) - Fix exception handling to prevent unbound variable errors Security improvements address: - HIGH: GraphQL injection via string interpolation in query_basic_resource - MEDIUM: Information disclosure through raw API responses in errors - LOW: DoS potential through unlimited input lengths * fix(linear): use typed filter variables for optional GraphQL filters Convert 7 tools from inline filter variables to typed $filter parameter. Fixes bug where null filter values caused incorrect query results when optional filters were omitted. - Pattern: $filter: XxxFilter (optional), conditionally include in variables - Affected: teams, cycles, documents, issueLabels, workflowStates, projectLabels, projects * chore(linear): remove unused legacy LinearClient Delete tools/linear/tools/linear_client.py (163 lines). Zero imports or references found in codebase - all tools use client/Linear.py instead. * refactor(linear): simplify duplicated fallback logic in get_user_issues Consolidate two identical fallback message branches into single path. Behavior unchanged: summary attempted first, fallback on error or missing session model.
1 parent 68189a7 commit a74ee68

34 files changed

+2440
-633
lines changed

tools/linear/README.md

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ This plugin integrates Linear's project management capabilities with Dify, allow
1212
- **Get Users**: Search for users by name or email to find their details (including ID/UUID).
1313
- **Get Teams**: Search for teams by name to find their details (including ID).
1414
- **Get My Profile**: Retrieve the profile information of the currently authenticated user.
15+
- **List Projects**: List Linear projects with optional name filtering.
16+
- **List Cycles**: List Linear cycles with optional team filtering.
17+
- **List Documents**: List Linear documents with optional title filtering.
18+
- **List Issue Labels**: List issue labels and their colors.
19+
- **List Issue Statuses**: List workflow states, optionally filtered by team.
20+
- **List Project Labels**: List project labels and their colors.
21+
- **Get Issue**: Retrieve issue details by ID.
22+
- **Get Project**: Retrieve project details by ID.
23+
- **Get Team**: Retrieve team details by ID.
24+
- **Get User**: Retrieve user details by ID.
25+
- **Get Document**: Retrieve document details by ID.
1526

1627
## Installation
1728

@@ -127,9 +138,91 @@ Retrieves the profile information (ID, name, email) of the currently authenticat
127138

128139
No parameters required.
129140

141+
### List Linear Projects
142+
143+
Lists projects in Linear.
144+
145+
Optional parameters:
146+
- `name`: Partial project name to filter by (case-insensitive).
147+
- `limit`: Maximum number of projects to return (default: 10, max: 50).
148+
149+
### List Linear Cycles
150+
151+
Lists cycles in Linear.
152+
153+
Optional parameters:
154+
- `teamId`: Team ID to filter cycles by.
155+
- `limit`: Maximum number of cycles to return (default: 10, max: 50).
156+
157+
### List Linear Documents
158+
159+
Lists documents in Linear.
160+
161+
Optional parameters:
162+
- `query`: Text to search in document titles.
163+
- `limit`: Maximum number of documents to return (default: 10, max: 50).
164+
165+
### List Linear Issue Labels
166+
167+
Lists issue labels in Linear.
168+
169+
Optional parameters:
170+
- `name`: Partial label name to filter by (case-insensitive).
171+
- `limit`: Maximum number of labels to return (default: 10, max: 50).
172+
173+
### List Linear Issue Statuses
174+
175+
Lists issue statuses (workflow states) in Linear.
176+
177+
Optional parameters:
178+
- `teamId`: Team ID to filter issue statuses by.
179+
- `limit`: Maximum number of statuses to return (default: 10, max: 50).
180+
181+
### List Linear Project Labels
182+
183+
Lists project labels in Linear.
184+
185+
Optional parameters:
186+
- `name`: Partial label name to filter by (case-insensitive).
187+
- `limit`: Maximum number of labels to return (default: 10, max: 50).
188+
189+
### Get Linear Issue
190+
191+
Retrieves a specific issue by ID.
192+
193+
Required parameters:
194+
- `id`: ID of the issue to retrieve.
195+
196+
### Get Linear Project
197+
198+
Retrieves a specific project by ID.
199+
200+
Required parameters:
201+
- `id`: ID of the project to retrieve.
202+
203+
### Get Linear Team
204+
205+
Retrieves a specific team by ID.
206+
207+
Required parameters:
208+
- `id`: ID of the team to retrieve.
209+
210+
### Get Linear User
211+
212+
Retrieves a specific user by ID.
213+
214+
Required parameters:
215+
- `id`: ID of the user to retrieve.
216+
217+
### Get Linear Document
218+
219+
Retrieves a specific document by ID.
220+
221+
Required parameters:
222+
- `id`: ID of the document to retrieve.
223+
130224
## License
131225

132226
This plugin is licensed under the [MIT License](LICENSE).
133227

134228

135-

0 commit comments

Comments
 (0)