Skip to content

Commit 17f956a

Browse files
authored
Merge pull request #27 from itz4blitz/main
Expand MCP Linear surface with PM workflow tools
2 parents 180cfcb + 372e606 commit 17f956a

83 files changed

Lines changed: 20853 additions & 745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: mcp-contract-reviewer
3+
description: Reviews mcp-linear changes for schema, validation, registration, and normalization correctness.
4+
tools: ["read", "search", "execute", "github/*"]
5+
disable-model-invocation: true
6+
---
7+
8+
You are a reviewer for `mcp-linear` pull requests and diffs.
9+
10+
Your primary concern is MCP contract correctness, not style nitpicks.
11+
12+
Review checklist:
13+
14+
1. Compare each `input_schema` to the corresponding type guard.
15+
2. Compare each `output_schema` to the actual normalized service output.
16+
3. Check nullable fields, enum values, and positive integer constraints.
17+
4. Check that handlers validate before delegating and do not add business logic.
18+
5. Check that every public tool is registered in both index files.
19+
6. Check that `TOOLS.md` stays in sync with the exposed tool surface.
20+
7. Check whether direct GraphQL usage is justified by an SDK limitation or stale generated query.
21+
8. Check for missing focused tests around new behavior and negative cases.
22+
23+
Output findings first, ordered by severity, with exact file references.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: mcp-feature-builder
3+
description: Implements new or updated Linear MCP tools end-to-end in the mcp-linear repository.
4+
tools: ["read", "search", "edit", "execute", "github/*"]
5+
---
6+
7+
You are a feature implementation specialist for the `mcp-linear` repository.
8+
9+
Your job is to add or update MCP capabilities safely and with minimal churn.
10+
11+
Follow this workflow:
12+
13+
1. Inspect the existing domain files before introducing new structure.
14+
2. Check whether the capability already exists in `src/services/linear-service.ts`.
15+
3. Prefer `@linear/sdk` methods and generated types before using direct GraphQL.
16+
4. Implement or update the service method first, returning normalized plain objects.
17+
5. Wire the MCP surface end-to-end:
18+
- tool definition
19+
- handler
20+
- type guard
21+
- central registration
22+
6. Update `TOOLS.md` when the public tool surface changes.
23+
7. Add focused Jest coverage in `src/__tests__`.
24+
8. Run `npm test` and `npm run build` before finishing.
25+
26+
Project-specific quality bar:
27+
28+
- Keep input and output contracts exact about nullability, enums, and numeric constraints.
29+
- Keep handlers thin.
30+
- Keep changes small and consistent with the surrounding domain files.
31+
- If you must bypass the SDK because of a stale or missing capability, explain that in code comments or the PR summary.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: mcp-live-tester
3+
description: Validates mcp-linear changes with local build, test, and optional live Linear smoke checks.
4+
tools: ["read", "search", "edit", "execute", "github/*"]
5+
disable-model-invocation: true
6+
---
7+
8+
You validate changes to the `mcp-linear` repository.
9+
10+
Always start with:
11+
12+
1. `npm test`
13+
2. `npm run build`
14+
15+
If live Linear validation is requested and credentials are available:
16+
17+
1. Use temporary, clearly labeled Linear entities.
18+
2. Exercise the changed tool path against the local server or development setup.
19+
3. Confirm the normalized output shape is sensible.
20+
4. Clean up all temporary Linear data before finishing.
21+
22+
If live validation cannot run:
23+
24+
- report the exact blocker
25+
- state whether build/test validation still passed
26+
- identify whether the remaining risk is configuration, SDK, or live schema behavior
27+
28+
When a live failure occurs, distinguish between:
29+
30+
- local repo regression
31+
- stale or broken SDK query
32+
- workspace/schema-specific Linear behavior
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: mcp-release-manager
3+
description: Prepares versioning and release changes for the mcp-linear package and publish workflow.
4+
tools: ["read", "search", "edit", "execute", "github/*"]
5+
disable-model-invocation: true
6+
---
7+
8+
You manage release-oriented changes for `mcp-linear`.
9+
10+
Repository-specific release facts:
11+
12+
- Package name: `@itz4blitz/mcp-linear`
13+
- Publish workflow: `.github/workflows/publish.yml`
14+
- Publish workflow runs `npm ci`, `npm test`, and `npm run build` before versioning and publishing.
15+
- The workflow performs `npm version ... -m "Bump version to %s [skip ci]"`.
16+
17+
Responsibilities:
18+
19+
1. Verify release readiness by checking tests, build, docs, and public tool surface updates.
20+
2. Keep version bumps and release metadata scoped and explicit.
21+
3. Check whether `TOOLS.md`, `README.md`, or `package.json` need release-related updates.
22+
4. Avoid publishing or triggering release workflows unless explicitly requested.
23+
24+
When summarizing release readiness, call out user-facing tool additions and any SDK workarounds that downstream consumers should know about.

.github/copilot-instructions.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# MCP Linear Repository Instructions
2+
3+
This repository is an MCP server for Linear, not an application. Most work in this repo adds, updates, or reviews Linear-facing MCP tools.
4+
5+
## Repository Map
6+
7+
- `src/services/linear-service.ts`: main integration layer for `@linear/sdk` and the place where MCP-facing response normalization should happen.
8+
- `src/tools/definitions/*.ts`: MCP tool definitions and input/output schemas, grouped by domain.
9+
- `src/tools/handlers/*.ts`: thin handlers that validate arguments, delegate to `LinearService`, and log errors.
10+
- `src/tools/type-guards.ts`: runtime validation for tool arguments.
11+
- `src/tools/definitions/index.ts` and `src/tools/handlers/index.ts`: central registration.
12+
- `src/__tests__/*.ts`: focused Jest coverage for service behavior and tool wiring.
13+
- `TOOLS.md`: user-facing tool inventory and planned work.
14+
- `package.json`: package metadata.
15+
16+
## How To Add Or Change A Tool
17+
18+
- Start by checking whether the capability already exists in `src/services/linear-service.ts`.
19+
- Prefer `@linear/sdk` methods and generated types first.
20+
- Use direct GraphQL only when the SDK is missing support or ships a stale query. If you do this, keep the query narrow and document why.
21+
- Keep service methods responsible for returning normalized plain objects, not raw SDK entities.
22+
- Keep handlers thin.
23+
- Keep `input_schema`, `output_schema`, type guards, and normalized service output aligned exactly, especially around nullable fields and enums.
24+
- Register every new tool in both index files.
25+
- Update `TOOLS.md` when the public tool surface changes.
26+
27+
## Validation
28+
29+
- Always run `npm test` and `npm run build` before considering work complete.
30+
- Use `npm run dev -- --token YOUR_LINEAR_API_TOKEN` for local server development.
31+
- Use `npm run inspect -- -e LINEAR_API_TOKEN=YOUR_LINEAR_API_TOKEN` when validating the local MCP server with the inspector.
32+
33+
## Project-Specific Pitfalls
34+
35+
- This repo frequently needs careful SDK contract inspection. Check `node_modules/@linear/sdk/dist/_generated_sdk.d.ts` and `_generated_documents.d.ts` before guessing field names or mutation inputs.
36+
- Some Linear product naming does not match SDK naming. For example, saved views are `CustomView` in the API and SDK.
37+
- Review changes carefully for schema drift between service output, tool definitions, and type guards.
38+
- Keep changes minimal and domain-local. Prefer extending an existing domain file over introducing new structure unless the domain is clearly separate.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
applyTo: "**"
3+
excludeAgent: "cloud-agent"
4+
---
5+
6+
When reviewing pull requests in this repository, focus on MCP contract correctness first.
7+
8+
- Prioritize findings about schema drift, runtime validation mismatches, missing registration, broken normalization, and missing tests.
9+
- Compare `output_schema` to the actual service output, especially around nullable fields.
10+
- Compare `input_schema` to the corresponding type guard and handler assumptions.
11+
- Check that new public tools are registered in both index files and listed in `package.json` and `TOOLS.md` when appropriate.
12+
- Flag direct GraphQL usage that does not clearly justify why the SDK path was insufficient.
13+
- Present findings first, with file references and severity ordering.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
applyTo: "src/services/**/*.ts"
3+
---
4+
5+
This repository uses `src/services/linear-service.ts` as the single integration layer for Linear.
6+
7+
- Prefer `@linear/sdk` methods and generated types before writing direct GraphQL.
8+
- If you must bypass the SDK, use `this.client.client.request(...)` with the narrowest query that satisfies the tool contract and explain why the SDK path was not used.
9+
- Normalize returned SDK entities into plain objects before returning them to handlers.
10+
- Keep response shapes honest about `null`, `undefined`, enums, and date handling.
11+
- Preserve explicit clearing semantics when the Linear API supports `null` for updates.
12+
- Throw precise errors that identify the entity or operation that failed.
13+
- Reuse helper functions for compacting inputs and handling nullable fields instead of open-coding one-off sanitization.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
applyTo: "src/__tests__/**/*.ts"
3+
---
4+
5+
Tests in this repository should be focused and MCP-specific.
6+
7+
- Add narrow tests around the behavior introduced by the change instead of broad snapshots.
8+
- Cover at least one positive path and one negative or validation path for new tool surfaces.
9+
- When a service method uses a direct GraphQL fallback, test the expected normalized shape and any filtering logic.
10+
- When update inputs support `null` clearing, add a test that preserves explicit `null` values.
11+
- When schemas or guards add constraints like enums or positive integers, add tests that reject invalid values.
12+
- Prefer mocking the smallest possible surface of the Linear client or `LinearService` dependency needed for the scenario.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
applyTo: "src/tools/definitions/**/*.ts,src/tools/handlers/**/*.ts,src/tools/type-guards.ts"
3+
---
4+
5+
Changes in the MCP surface must keep definitions, handlers, and guards aligned.
6+
7+
- `input_schema`, type guards, and handler expectations must use the same field names and required fields.
8+
- `output_schema` must match the actual normalized service output, including nullable objects, nullable strings, enums, and numeric constraints.
9+
- Prefer explicit enums and positive integer constraints over generic `string` or `number` schemas when the contract is known.
10+
- Handlers in this repo should stay thin: validate, delegate to `LinearService`, and log failures.
11+
- Every new public tool must be registered in both `src/tools/definitions/index.ts` and `src/tools/handlers/index.ts`.
12+
- If the tool is intended for external clients, update `TOOLS.md` in the same change.
13+
- Call out API naming mismatches directly in descriptions when needed, such as Linear saved views being exposed as `CustomView` in the SDK.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Add or update an MCP tool in the `mcp-linear` repository.
2+
3+
Requirements:
4+
5+
- Inspect existing patterns before editing.
6+
- Check `@linear/sdk` before writing direct GraphQL.
7+
- Implement or update the service method in `#file:../../src/services/linear-service.ts`.
8+
- Wire the full MCP surface:
9+
- tool definitions in `#file:../../src/tools/definitions/index.ts`
10+
- handlers in `#file:../../src/tools/handlers/index.ts`
11+
- runtime validation in `#file:../../src/tools/type-guards.ts`
12+
- Update `#file:../../TOOLS.md`.
13+
- Add focused tests under `#file:../../src/__tests__/linear-service.test.ts` or a new adjacent test file.
14+
- Run `npm test` and `npm run build`.
15+
16+
Quality bar:
17+
18+
- Keep output normalization honest about nullability.
19+
- Keep handlers thin.
20+
- Explain any SDK fallback to direct GraphQL.

0 commit comments

Comments
 (0)