greenline-works-mcp-server 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # GreenLine MCP Server
2
2
 
3
- [Model Context Protocol](https://modelcontextprotocol.io/) server that lets AI assistants (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and any stdio-capable MCP client) drive your [GreenLine](https://greenline.legal) workspace via the public API.
3
+ [Model Context Protocol](https://modelcontextprotocol.io/) server that lets AI assistants (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and any MCP client) drive your [GreenLine](https://greenline.legal) workspace via the public API.
4
4
 
5
5
  27 tools across boards, cards, comments, checklists, tasks, and labels. No delete operations.
6
6
 
7
+ **Two ways to connect.** The **hosted server** at `https://mcp.greenline.works/mcp` is the recommended option for every client, Claude Desktop included — paste the URL, sign in with your GreenLine account, done. Nothing to install, no API key to manage, and you always get the current tool set. The **local install** (this npm package) runs the same server on your own machine over stdio — for stdio-only clients, unattended setups like CI where a browser sign-in isn't possible, restricted networks, or developing against a fork.
8
+
7
9
  ## What you can do
8
10
 
9
11
  - Read your boards, columns, labels, members, and custom fields.
@@ -14,9 +16,23 @@
14
16
  - Create, update, and list checklists — including bulk task creation in a single call.
15
17
  - Create, update, and move tasks.
16
18
 
17
- ## Quick start (Claude Desktop)
19
+ ## Quick start (hosted — recommended)
20
+
21
+ **Claude Desktop:** open **Settings → Connectors → Add custom connector**, paste `https://mcp.greenline.works/mcp`, and click **Connect**. A browser window opens to sign in to GreenLine and approve access — the tools then appear in the tool picker. No config file, no API key.
22
+
23
+ **Claude Code:**
24
+
25
+ ```bash
26
+ claude mcp add --transport http greenline https://mcp.greenline.works/mcp
27
+ ```
18
28
 
19
- 1. **Get an API key.** In GreenLine: **Org Settings → Integrations → API Key**. Copy the whole thing — it looks like `accessId:apiKey`.
29
+ Sign in when prompted. Where a browser sign-in isn't possible, the hosted server also accepts an API key as a header: `Authorization: Bearer accessId:apiKey`.
30
+
31
+ ## Local install (Claude Desktop)
32
+
33
+ Prefer the hosted quick start above. Use a local install when your client is stdio-only, your setup is unattended (an API key in an env var beats a browser sign-in there), your network blocks `mcp.greenline.works`, or you're developing against a fork.
34
+
35
+ 1. **Get an API key.** In GreenLine: **Settings → Integrations → API Keys**. Copy the whole thing — it looks like `accessId:apiKey`.
20
36
 
21
37
  2. **Edit your config.**
22
38
 
@@ -41,7 +57,7 @@
41
57
 
42
58
  4. **Try it.** Ask Claude: *"Is my GreenLine connection working?"* — Claude calls `greenline_get_me` and replies with your org name.
43
59
 
44
- ## Quick start (Claude Code)
60
+ ## Local install (Claude Code)
45
61
 
46
62
  ```bash
47
63
  claude mcp add greenline \
@@ -51,9 +67,11 @@ claude mcp add greenline \
51
67
 
52
68
  ## Configuration
53
69
 
70
+ Environment variables for the local server:
71
+
54
72
  | Variable | Required | Default | Description |
55
73
  | --- | --- | --- | --- |
56
- | `GREENLINE_API_KEY` | yes | — | Composite credential `accessId:apiKey`. Generate in **Org Settings → Integrations → API Key**. |
74
+ | `GREENLINE_API_KEY` | yes | — | Composite credential `accessId:apiKey`. Generate in **Settings → Integrations → API Keys**. |
57
75
  | `GREENLINE_BASE_URL` | no | `https://integrations.greenline.works/v1` | Override only when pointing at a non-production environment. |
58
76
 
59
77
  The server validates the key on startup. A missing or malformed value (no `:` separator) exits immediately with a message pointing at the org settings page.
@@ -97,7 +115,7 @@ Plain JavaScript — no compile step.
97
115
 
98
116
  ## Troubleshooting
99
117
 
100
- **`401` on every tool call.** API key is wrong or expired. Regenerate it.
118
+ **`401` on every tool call.** If you connected with an API key, it's wrong or expired — regenerate it. If you signed in to the hosted server, disconnect it in your client and connect again for a fresh token.
101
119
 
102
120
  **Tools don't appear in the client.** Confirm the path is correct and the client was restarted after editing config. For `npx` installs, run `npx -y greenline-works-mcp-server` once manually to make sure it downloads cleanly.
103
121
 
@@ -107,11 +125,9 @@ Plain JavaScript — no compile step.
107
125
 
108
126
  ## Security
109
127
 
110
- This server runs locally on your machine. It does not transmit data to any third-party AI service — every API call goes directly to `https://integrations.greenline.works`. Your API key never leaves your machine except as an `Authorization: Basic` header on those direct calls.
111
-
112
- ## What's next
128
+ The local server runs on your machine. It does not transmit data to any third-party AI service — every API call goes directly to `https://integrations.greenline.works`. Your API key never leaves your machine except as an `Authorization: Basic` header on those direct calls.
113
129
 
114
- The server is local-stdio only today. A hosted version (paste a URL into your client, no install) is on the roadmap.
130
+ The hosted server is operated by GreenLine and talks to that same public API. Signing in uses OAuth and makes a **user-level** connection: your client holds an access token tied to your account, the tools reach what your account can reach, and changes are attributed to your name. An API key is an **org-level** credential — it acts as the organization's integration identity and by default reaches every board in the org (keys can be scoped to chosen boards when generated).
115
131
 
116
132
  ## License
117
133
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greenline-works-mcp-server",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Model Context Protocol server for the GreenLine public API",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.greenline.works/mcp",
package/src/client.js CHANGED
@@ -71,6 +71,10 @@ const makeApiRequest = async (endpoint, { method = 'GET', body, query } = {}) =>
71
71
  headers: {
72
72
  'Content-Type': 'application/json',
73
73
  Accept: 'application/json',
74
+ // Declares this traffic as MCP-originated so org admins' MCP access controls apply to
75
+ // API-key connections too (the backend gates and audits on it). Presence-only signal —
76
+ // the value is never trusted upstream.
77
+ 'X-MCP-Client': 'mcp-server',
74
78
  },
75
79
  };
76
80
  // A multi-tenant host may bind an OAuth bearer token instead of an accessId/secret pair
package/src/constants.js CHANGED
@@ -8,7 +8,7 @@ const DEFAULT_PAGE_SIZE = 20;
8
8
  const MAX_PAGE_SIZE = 100;
9
9
 
10
10
  const SERVER_NAME = 'greenline-works-mcp-server';
11
- const SERVER_VERSION = '0.3.3';
11
+ const SERVER_VERSION = '0.3.4';
12
12
 
13
13
  const REQUEST_TIMEOUT_MS = 30000;
14
14
 
@@ -8,7 +8,7 @@ const READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true,
8
8
  const WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
9
9
  const IDEMPOTENT_WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true };
10
10
 
11
- // list_cards nests card fields under CardItem; search_cards returns them flat. Handle both.
11
+ // Card fields arrive nested under CardItem. Older search responses were flat — handle both.
12
12
  const renderCardLine = card => {
13
13
  const c = (card && card.CardItem) || card || {};
14
14
  const id = (card && card._id) || c._id;
@@ -234,11 +234,15 @@ const registerCardsTools = server => {
234
234
  ' - owner (string, optional): account email or ObjectId.',
235
235
  ' - label (string, optional): label name (e.g. "Enhancement") or ObjectId.',
236
236
  ' - dueAt (string, optional): ISO date or datetime.',
237
+ ' - blocked (boolean, optional): true blocks the card, false unblocks it. Unblocking also clears the block reason.',
238
+ ' - blockedReason (string, optional): why the card is blocked. Pair it with blocked: true.',
237
239
  ' - customFields (array, optional): list of { label, value } pairs. `label` matches the custom-field name configured on the board.',
238
240
  '',
239
241
  'Examples:',
240
242
  ' - "Reassign card 670... to bob@example.com"',
241
243
  ' - "Set the due date on card 670... to 2025-06-01"',
244
+ ' - "Block card 670... because we are waiting on the vendor"',
245
+ ' - "Unblock card 670..."',
242
246
  ' - "Set the Project Code custom field on card 670... to ABC-123"',
243
247
  ].join('\n'),
244
248
  inputSchema: {
@@ -249,6 +253,8 @@ const registerCardsTools = server => {
249
253
  owner: z.string().optional(),
250
254
  label: z.string().optional(),
251
255
  dueAt: isoDateField.optional(),
256
+ blocked: z.boolean().optional(),
257
+ blockedReason: z.string().max(2000).optional(),
252
258
  customFields: z
253
259
  .array(
254
260
  z.object({
@@ -401,8 +407,8 @@ const registerCardsTools = server => {
401
407
  'Results are sorted by relevance (best match first).',
402
408
  '',
403
409
  'Mirror cards: results are returned per (card, board) pair — a card mirrored to two',
404
- 'boards that matches the query appears twice, each with that board\'s bucket, label,',
405
- 'owner, and watchers. Use the returned `board` field to know which board to act on.',
410
+ 'boards that matches the query appears twice, each with that board\'s column, label,',
411
+ 'owner, and watchers. Use the returned CardItem.boardPublicId to know which board to act on.',
406
412
  '',
407
413
  'Args:',
408
414
  ' - q (string, required): search text, minimum 2 characters.',
@@ -1,6 +1,7 @@
1
1
  const { z } = require('zod');
2
2
  const { makeApiRequest, safeRun } = require('../client');
3
- const { responseFormatField, ResponseFormat, toJsonString, truncateIfNeeded } = require('../format');
3
+ const { responseFormatField, ResponseFormat, toJsonString, truncateIfNeeded, RICH_TEXT_HELP } = require('../format');
4
+ const { markdownToHtml } = require('../markdown');
4
5
  const { objectIdField } = require('../schemas');
5
6
 
6
7
  const READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
@@ -19,7 +20,7 @@ const registerChecklistsTools = server => {
19
20
  ' - card (string, required): card ObjectId.',
20
21
  ' - title (string, optional): checklist title.',
21
22
  ' - checklistTemplate (string, optional): checklist template ObjectId.',
22
- ' - tasks (array, optional): list of { description: string }. Task position is taken from array index — any `position` field on a task is ignored.',
23
+ ` - tasks (array, optional): list of { description: string }. ${RICH_TEXT_HELP} Task position is taken from array index — any \`position\` field on a task is ignored.`,
23
24
  '',
24
25
  'Examples:',
25
26
  ' - "Add a checklist to card 670... with tasks: write tests, update docs"',
@@ -32,7 +33,11 @@ const registerChecklistsTools = server => {
32
33
  tasks: z
33
34
  .array(
34
35
  z.object({
35
- description: z.string().min(1).max(2000),
36
+ description: z
37
+ .string()
38
+ .min(1)
39
+ .max(2000)
40
+ .describe(RICH_TEXT_HELP),
36
41
  })
37
42
  )
38
43
  .optional(),
@@ -44,7 +49,11 @@ const registerChecklistsTools = server => {
44
49
  const body = { card };
45
50
  if (title !== undefined) body.title = title;
46
51
  if (checklistTemplate !== undefined) body.checklistTemplate = checklistTemplate;
47
- if (tasks !== undefined) body.tasks = tasks;
52
+ // tasks[].description is a plain string field on the API, so convert markdown
53
+ // here the same way every other rich-text field is converted.
54
+ if (tasks !== undefined) {
55
+ body.tasks = tasks.map(task => ({ ...task, description: markdownToHtml(task.description) }));
56
+ }
48
57
 
49
58
  const data = await makeApiRequest('/checklists', { method: 'POST', body });
50
59
  const taskCount = Array.isArray(data.tasks) ? data.tasks.length : 0;