@flowrelay/mcp-server 1.8.0 → 1.9.0
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 +5 -5
- package/dist/index.js +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +383 -223
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://m8ven.ai/mcp/flow-relay-flowrelay-mcp-server-15i3wg)
|
|
4
4
|
|
|
5
|
-
Flow Relay MCP Server adds project-aware, multi-tenant Flow Relay tools to MCP
|
|
5
|
+
Flow Relay MCP Server adds project-aware, multi-tenant Flow Relay tools to any MCP client that runs local stdio servers – editor agents (Cursor, Antigravity, Windsurf, VS Code), terminal agents (Claude Code, Gemini CLI, Codex) and desktop chat apps. Clients that support remote servers can skip the install and connect to `https://www.flowrelay.it/mcp` instead.
|
|
6
6
|
|
|
7
7
|
It connects to Flow Relay API v1 using an API key and supports:
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ It connects to Flow Relay API v1 using an API key and supports:
|
|
|
11
11
|
## Package
|
|
12
12
|
|
|
13
13
|
- Name: @flowrelay/mcp-server
|
|
14
|
-
- Version: 1.
|
|
14
|
+
- Version: 1.9.0
|
|
15
15
|
|
|
16
16
|
## Supported Sources (52 Integrations)
|
|
17
17
|
|
|
@@ -34,7 +34,7 @@ Flow Relay MCP Server supports 52 integration sources across the entire engineer
|
|
|
34
34
|
|
|
35
35
|
The server currently exposes 40 tools, 3 prompts and 1 resource template. Every tool carries the four MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`): the `list_*` and `get_*` tools are read-only and idempotent, the `generate_*` tools (including `generate_plan_review`), `ask_project`, `create_work_item`, `create_raid_entry`, `resolve_suggestion`, `decide_approval`, `request_change` and `discord_send_message` are non-idempotent (each call spends credits, creates an item or an entry, files a request, decides one or posts a message), `update_work_item` and `link_evidence` write but are idempotent (the same values twice leave the item unchanged) and `delete_work_item` is the one destructive tool (`destructiveHint: true`, so clients can ask before it runs; the deletion can be restored from the change history).
|
|
36
36
|
|
|
37
|
-
- `get_workspace_context`: Show
|
|
37
|
+
- `get_workspace_context`: Show the workspaces the API key reaches (how many personal projects, each organization by name with your role), how many projects it can open, the active project and your role in it.
|
|
38
38
|
- `list_projects`: List every accessible project (personal and organization) with id, scope, role and the prefix of its work item keys.
|
|
39
39
|
- `set_active_project`: Set or clear the active project for subsequent tool calls so `project_id` can be omitted.
|
|
40
40
|
- `list_filter_options`: List selectable resources (projects/repos/channels/boards), branches, event types and priorities per source for a project. Call this before generating so handoff and insight filters use real values instead of guesses. Also reports whether Figma visual context is selectable (requires Global processing region).
|
|
@@ -104,9 +104,9 @@ Optional:
|
|
|
104
104
|
- `FLOWRELAY_PROJECT_ID`: Initial active project context for project-aware tools.
|
|
105
105
|
- `FLOWRELAY_BASE_URL`: Base URL of the Flow Relay API (defaults to `https://www.flowrelay.it`).
|
|
106
106
|
|
|
107
|
-
## Quick Start
|
|
107
|
+
## Quick Start
|
|
108
108
|
|
|
109
|
-
Add this to your `
|
|
109
|
+
Add this to the MCP config file of your client (the `mcpServers` block most clients read; VS Code uses `servers` in `.vscode/mcp.json`):
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
{
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Copyright (c) 2026 Adriano Sorbello (atrisorb) <https://github.com/atrisorb>
|
|
6
6
|
* Licensed under GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)
|
|
7
7
|
*/
|
|
8
|
-
import { StdioServerTransport } from '@modelcontextprotocol/
|
|
8
|
+
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
|
|
9
9
|
import { FlowRelayAPI } from './api.js';
|
|
10
10
|
import { createFlowRelayServer, normalizeProjectId, PKG_VERSION } from './server.js';
|
|
11
11
|
const apiKey = process.env.FLOWRELAY_API_KEY;
|
package/dist/server.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright (c) 2026 Adriano Sorbello (atrisorb) <https://github.com/atrisorb>
|
|
5
5
|
* Licensed under GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)
|
|
6
6
|
*/
|
|
7
|
-
import { McpServer } from '@modelcontextprotocol/
|
|
7
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
8
8
|
import { FlowRelayAPI } from './api.js';
|
|
9
9
|
export declare const PKG_VERSION: string;
|
|
10
10
|
export declare function normalizeProjectId(value: unknown): string | null;
|
package/dist/server.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright (c) 2026 Adriano Sorbello (atrisorb) <https://github.com/atrisorb>
|
|
5
5
|
* Licensed under GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)
|
|
6
6
|
*/
|
|
7
|
-
import { McpServer, ResourceTemplate } from '@modelcontextprotocol/
|
|
7
|
+
import { McpServer, ResourceTemplate } from '@modelcontextprotocol/server';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { createRequire } from 'node:module';
|
|
10
10
|
export const PKG_VERSION = createRequire(import.meta.url)('../package.json').version;
|
|
@@ -246,7 +246,7 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
246
246
|
version: PKG_VERSION,
|
|
247
247
|
websiteUrl: 'https://www.flowrelay.it',
|
|
248
248
|
icons: [
|
|
249
|
-
{ src:
|
|
249
|
+
{ src: `https://www.flowrelay.it/icon.png?v=${PKG_VERSION}`, mimeType: 'image/png', sizes: ['1024x1024'] },
|
|
250
250
|
],
|
|
251
251
|
}, {
|
|
252
252
|
instructions: [
|
|
@@ -305,19 +305,23 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
305
305
|
return { projectId: resolvedProjectId, project };
|
|
306
306
|
}
|
|
307
307
|
// ── Tool: workspace context ─────────────────────────────────────────
|
|
308
|
-
server.
|
|
308
|
+
server.registerTool('get_workspace_context', {
|
|
309
|
+
description: 'Show the current Flow Relay context: the workspaces the API key reaches (personal projects and each organization by name), how many projects it can open, the active project and the caller\'s role in it. Good first call to orient yourself before other tools.',
|
|
310
|
+
inputSchema: z.object({}),
|
|
311
|
+
annotations: READ_ONLY,
|
|
312
|
+
}, async () => {
|
|
309
313
|
try {
|
|
310
314
|
const context = await getTenantContext();
|
|
311
315
|
const activeProject = activeProjectId
|
|
312
316
|
? context.projects.find((project) => project.id === activeProjectId) ?? null
|
|
313
317
|
: null;
|
|
314
|
-
const
|
|
318
|
+
const personalCount = context.projects.filter((project) => project.project_type === 'personal').length;
|
|
315
319
|
const roleLine = activeProject
|
|
316
320
|
? `Role: ${activeProject.access_role}`
|
|
317
321
|
: 'Role: n/a (no project selected)';
|
|
318
322
|
const lines = [
|
|
319
|
-
`
|
|
320
|
-
`Organizations: ${context.organizations.length}`,
|
|
323
|
+
`Personal projects: ${personalCount}`,
|
|
324
|
+
`Organizations: ${context.organizations.length ? context.organizations.map((org) => `${org.name} (${org.role})`).join(', ') : 'none'}`,
|
|
321
325
|
`Accessible projects: ${context.projects.length}`,
|
|
322
326
|
`Active scope: ${formatProjectScope(activeProject)}`,
|
|
323
327
|
roleLine,
|
|
@@ -329,7 +333,11 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
329
333
|
}
|
|
330
334
|
});
|
|
331
335
|
// ── Tool: list projects ─────────────────────────────────────────────
|
|
332
|
-
server.
|
|
336
|
+
server.registerTool('list_projects', {
|
|
337
|
+
description: 'List every project the API key can access (personal and organization), each with its id, scope, the prefix of its work item keys and the caller\'s role. The id returned here is what you pass as project_id to the generate_* and list tools – start here whenever you need one.',
|
|
338
|
+
inputSchema: z.object({}),
|
|
339
|
+
annotations: READ_ONLY,
|
|
340
|
+
}, async () => {
|
|
333
341
|
try {
|
|
334
342
|
const context = await getTenantContext();
|
|
335
343
|
if (context.projects.length === 0) {
|
|
@@ -361,10 +369,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
361
369
|
}
|
|
362
370
|
});
|
|
363
371
|
// ── Tool: set active project ────────────────────────────────────────
|
|
364
|
-
server.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
372
|
+
server.registerTool('set_active_project', {
|
|
373
|
+
description: 'Set the active project so later tools can omit project_id (a convenience for a multi-step session on one project). Set it once from a list_projects id, then call generate_handoff / list_events / etc. without repeating project_id. Not required if you always pass project_id explicitly.',
|
|
374
|
+
inputSchema: z.object({
|
|
375
|
+
project_id: z.string().optional().describe('Project id (from list_projects) to set as active. Omit, or set clear, to unset it.'),
|
|
376
|
+
clear: z.boolean().default(false).describe('Clear the active project. Generation then requires an explicit project_id again.'),
|
|
377
|
+
}),
|
|
378
|
+
annotations: SESSION_STATE,
|
|
379
|
+
}, async ({ project_id, clear }) => {
|
|
368
380
|
try {
|
|
369
381
|
if (clear || !normalizeProjectId(project_id)) {
|
|
370
382
|
activeProjectId = null;
|
|
@@ -393,11 +405,15 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
393
405
|
}
|
|
394
406
|
});
|
|
395
407
|
// ── Tool: list handoffs ──────────────────────────────────────────────
|
|
396
|
-
server.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
408
|
+
server.registerTool('list_handoffs', {
|
|
409
|
+
description: 'List existing handoffs (newest first) with their full content, across all accessible projects or one project. Use this to read what has already been generated before spending credits on a new generate_handoff. Each row\'s id can be sent to Discord via discord_send_message.',
|
|
410
|
+
inputSchema: z.object({
|
|
411
|
+
status: z.enum(['active', 'archived', 'all']).default('active').describe('active = current handoffs, archived = superseded ones, all = both.'),
|
|
412
|
+
limit: z.number().int().min(1).max(50).default(10).describe('Max handoffs to return (1-50, default 10).'),
|
|
413
|
+
project_id: z.string().optional().describe('Project id (from list_projects) to scope to. Omit to span every accessible project, or rely on the active project.'),
|
|
414
|
+
}),
|
|
415
|
+
annotations: READ_ONLY,
|
|
416
|
+
}, async ({ status, limit, project_id }) => {
|
|
401
417
|
try {
|
|
402
418
|
const explicitProjectId = normalizeProjectId(project_id);
|
|
403
419
|
const resolvedProjectId = explicitProjectId ?? activeProjectId;
|
|
@@ -436,13 +452,17 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
436
452
|
}
|
|
437
453
|
});
|
|
438
454
|
// ── Tool: generate handoff ───────────────────────────────────────────
|
|
439
|
-
server.
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
455
|
+
server.registerTool('generate_handoff', {
|
|
456
|
+
description: 'Generate a project handoff: an AI summary of recent activity, key changes, decisions, open questions and next steps for a project. Runs synchronously – waits for completion (tens of seconds) and returns the finished Markdown. Requires an active project (set_active_project) or an explicit project_id from list_projects. Consumes credits from the user\'s plan, charged once on success – prefer list_handoffs to read an existing one before generating a new one. To scope it, pass sources and/or filters (call list_filter_options first for valid values); omit both to use the project\'s saved scope preferences.',
|
|
457
|
+
inputSchema: z.object({
|
|
458
|
+
sources: z.array(SourceEnum)
|
|
459
|
+
.optional()
|
|
460
|
+
.describe('Restrict to these source ids (omit for all connected sources). Unknown source ids are rejected with 400.'),
|
|
461
|
+
filters: FiltersSchema,
|
|
462
|
+
project_id: z.string().optional().describe('Project id from list_projects. Overrides the active project for this call; required if no active project is set.'),
|
|
463
|
+
}),
|
|
464
|
+
annotations: MUTATING,
|
|
465
|
+
}, async ({ sources, filters, project_id }) => {
|
|
446
466
|
try {
|
|
447
467
|
const resolved = await requireProject(project_id);
|
|
448
468
|
const { jobId } = await api.generateHandoff(sources, filters, resolved.projectId);
|
|
@@ -461,9 +481,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
461
481
|
}
|
|
462
482
|
});
|
|
463
483
|
// ── Tool: list integrations ─────────────────────────────────────────
|
|
464
|
-
server.
|
|
465
|
-
|
|
466
|
-
|
|
484
|
+
server.registerTool('list_integrations', {
|
|
485
|
+
description: 'List connected integrations. With a project scope it returns the resources bound to that project plus their health (connection status, provider coverage); without one it returns the sources the API key owner has connected. Use it to check what data a generation can draw on.',
|
|
486
|
+
inputSchema: z.object({
|
|
487
|
+
project_id: z.string().optional().describe('Project id (from list_projects) for project-scoped resources. Omit (or rely on the active project) for the owner\'s connected sources.'),
|
|
488
|
+
}),
|
|
489
|
+
annotations: READ_ONLY,
|
|
490
|
+
}, async ({ project_id }) => {
|
|
467
491
|
try {
|
|
468
492
|
const resolved = await resolveProject(project_id);
|
|
469
493
|
const { integrations } = await api.listIntegrations(resolved.projectId);
|
|
@@ -489,7 +513,11 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
489
513
|
}
|
|
490
514
|
});
|
|
491
515
|
// ── Tool: list untracked resources ───────────────────────────────────
|
|
492
|
-
server.
|
|
516
|
+
server.registerTool('list_untracked_resources', {
|
|
517
|
+
description: 'List active resources (repos, channels, boards) that produced events recently but are not yet assigned to any project. Use it to spot data the user connected but has not organized into a project yet – mapping them (in the web dashboard) makes their events available to generations.',
|
|
518
|
+
inputSchema: z.object({}),
|
|
519
|
+
annotations: READ_ONLY,
|
|
520
|
+
}, async () => {
|
|
493
521
|
try {
|
|
494
522
|
const resources = await api.listUntrackedResources();
|
|
495
523
|
if (resources.length === 0) {
|
|
@@ -515,13 +543,17 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
515
543
|
}
|
|
516
544
|
});
|
|
517
545
|
// ── Tool: list recent events ─────────────────────────────────────────
|
|
518
|
-
server.
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
546
|
+
server.registerTool('list_events', {
|
|
547
|
+
description: 'List recent raw context events (individual pieces of tracked activity: a push, a message, an issue update) newest first. Use it to inspect the underlying signal a generation would draw on, or to check whether a source is producing data. With a project scope it is limited to that project\'s bound resources.',
|
|
548
|
+
inputSchema: z.object({
|
|
549
|
+
source: SourceEnum
|
|
550
|
+
.optional()
|
|
551
|
+
.describe('Restrict to one source id (e.g. "github"). Unknown ids are rejected with 400.'),
|
|
552
|
+
limit: z.number().int().min(1).max(100).default(20).describe('Max events to return (1-100, default 20).'),
|
|
553
|
+
project_id: z.string().optional().describe('Project id (from list_projects) to scope to. Omit (or rely on the active project) for the owner\'s personal-stream events.'),
|
|
554
|
+
}),
|
|
555
|
+
annotations: READ_ONLY,
|
|
556
|
+
}, async ({ source, limit, project_id }) => {
|
|
525
557
|
try {
|
|
526
558
|
const resolved = await resolveProject(project_id);
|
|
527
559
|
const { events } = await api.listEvents(source, limit, resolved.projectId);
|
|
@@ -541,7 +573,11 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
541
573
|
}
|
|
542
574
|
});
|
|
543
575
|
// ── Tool: discord list channels ──────────────────────────────────────
|
|
544
|
-
server.
|
|
576
|
+
server.registerTool('discord_list_channels', {
|
|
577
|
+
description: 'List the text channels in the Discord server connected to this account, each with its id. Call this to get a channel_id before discord_send_message.',
|
|
578
|
+
inputSchema: z.object({}),
|
|
579
|
+
annotations: READ_ONLY,
|
|
580
|
+
}, async () => {
|
|
545
581
|
try {
|
|
546
582
|
const { channels } = await api.discordListChannels();
|
|
547
583
|
if (channels.length === 0) {
|
|
@@ -558,17 +594,21 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
558
594
|
}
|
|
559
595
|
});
|
|
560
596
|
// ── Tool: discord send message ──────────────────────────────────────
|
|
561
|
-
server.
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
597
|
+
server.registerTool('discord_send_message', {
|
|
598
|
+
description: 'Send to a Discord channel in your connected server. Provide exactly one of: content (inline text); handoff_id or insight_id (sends that artifact, rendered to Markdown, as a .md file attachment); or artifact (last_handoff / last_correlation / last_onboarding / last_architecture / last_release_notes, with project_id) to send the latest active artifact of that kind.',
|
|
599
|
+
inputSchema: z.object({
|
|
600
|
+
channel_id: z.string().describe('Discord channel id from discord_list_channels.'),
|
|
601
|
+
content: z.string().optional().describe('Inline message text. Mutually exclusive with handoff_id / insight_id / artifact'),
|
|
602
|
+
handoff_id: z.string().optional().describe('Id of a handoff (from list_handoffs) to render and attach as a .md file'),
|
|
603
|
+
insight_id: z.string().optional().describe('Id of an insight (from list_insights) to render and attach as a .md file'),
|
|
604
|
+
artifact: z
|
|
605
|
+
.enum(['last_handoff', 'last_correlation', 'last_onboarding', 'last_architecture', 'last_release_notes'])
|
|
606
|
+
.optional()
|
|
607
|
+
.describe('Send the latest active artifact of this kind. Requires project_id'),
|
|
608
|
+
project_id: z.string().optional().describe('Project UUID. Required only when artifact is set'),
|
|
609
|
+
}),
|
|
610
|
+
annotations: MUTATING,
|
|
611
|
+
}, async ({ channel_id, content, handoff_id, insight_id, artifact, project_id, }) => {
|
|
572
612
|
if (!content && !handoff_id && !insight_id && !artifact) {
|
|
573
613
|
return { content: [{ type: 'text', text: 'Provide content, handoff_id, insight_id, or artifact.' }] };
|
|
574
614
|
}
|
|
@@ -581,13 +621,17 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
581
621
|
}
|
|
582
622
|
});
|
|
583
623
|
// ── Tool: generate correlation insight ──────────────────────────────
|
|
584
|
-
server.
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
624
|
+
server.registerTool('generate_correlation_insight', {
|
|
625
|
+
description: 'Generate a cross-source correlation insight: finds related events across different sources (e.g. a Slack thread, a Jira ticket and the PR that resolved it) and surfaces the links, patterns and open threads. Use when the user wants to understand how activity connects across tools. Runs synchronously and returns Markdown. Consumes credits, charged once on success. Call list_filter_options before using filters.',
|
|
626
|
+
inputSchema: z.object({
|
|
627
|
+
project_id: z.string().describe('Project id from list_projects to generate the insight for.'),
|
|
628
|
+
sources: z.array(SourceEnum).optional().describe('Restrict to these source ids (e.g. "github", "slack"). Unknown ids are rejected with 400.'),
|
|
629
|
+
filters: FiltersSchema,
|
|
630
|
+
lookback_hours: z.number().int().optional().describe('Hours of activity to analyze (1-2160, default 168 = 7 days).'),
|
|
631
|
+
max_events: z.number().int().optional().describe('Cap on events processed (1-1000, default 150).'),
|
|
632
|
+
}),
|
|
633
|
+
annotations: MUTATING,
|
|
634
|
+
}, async ({ project_id, sources, filters, lookback_hours, max_events }) => {
|
|
591
635
|
try {
|
|
592
636
|
const res = await api.generateInsight(project_id, 'correlation', {
|
|
593
637
|
sources,
|
|
@@ -608,15 +652,19 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
608
652
|
}
|
|
609
653
|
});
|
|
610
654
|
// ── Tool: generate onboarding brief ──────────────────────────────────
|
|
611
|
-
server.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
655
|
+
server.registerTool('generate_onboarding_brief', {
|
|
656
|
+
description: 'Generate an onboarding brief: a getting-started guide for someone new to the project – key people, key decisions, pitfalls and recommended reading drawn from recent activity. Use when a new team member needs to get up to speed. Runs synchronously and returns Markdown. Consumes credits, charged once on success. Call list_filter_options before using filters.',
|
|
657
|
+
inputSchema: z.object({
|
|
658
|
+
project_id: z.string().describe('Project id from list_projects to generate the brief for.'),
|
|
659
|
+
sources: z.array(SourceEnum).optional().describe('Restrict to these source ids. Unknown ids are rejected with 400.'),
|
|
660
|
+
filters: FiltersSchema,
|
|
661
|
+
new_member_role: z.string().optional().describe('Role/focus of the person being onboarded (e.g. "backend engineer"). Tailors the brief.'),
|
|
662
|
+
focus_area: z.string().optional().describe('Repository or feature area they will work on. Narrows the brief.'),
|
|
663
|
+
lookback_days: z.number().int().optional().describe('Days of history to review (1-365, default 30).'),
|
|
664
|
+
max_events: z.number().int().optional().describe('Cap on events processed (1-1000, default 400).'),
|
|
665
|
+
}),
|
|
666
|
+
annotations: MUTATING,
|
|
667
|
+
}, async ({ project_id, sources, filters, new_member_role, focus_area, lookback_days, max_events }) => {
|
|
620
668
|
try {
|
|
621
669
|
const res = await api.generateInsight(project_id, 'onboarding', {
|
|
622
670
|
sources,
|
|
@@ -639,14 +687,18 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
639
687
|
}
|
|
640
688
|
});
|
|
641
689
|
// ── Tool: generate architecture insight ─────────────────────────────
|
|
642
|
-
server.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
690
|
+
server.registerTool('generate_architecture_insight', {
|
|
691
|
+
description: 'Generate an architecture insight: trade-offs, risks, patterns and recommendations inferred from the project\'s code activity (requires a connected code source – github, gitlab, bitbucket or azure_devops). This is the deepest and most expensive insight (it runs extended reasoning). Use for technical review of architectural direction. Runs synchronously and returns Markdown. Consumes credits, charged once on success. Call list_filter_options before using filters.',
|
|
692
|
+
inputSchema: z.object({
|
|
693
|
+
project_id: z.string().describe('Project id from list_projects to generate the insight for.'),
|
|
694
|
+
sources: z.array(SourceEnum).optional().describe('Restrict to these source ids. Unknown ids are rejected with 400.'),
|
|
695
|
+
filters: FiltersSchema,
|
|
696
|
+
focus_question: z.string().optional().describe('A specific architectural question or component to investigate (e.g. "is the billing layer coupled to providers?").'),
|
|
697
|
+
lookback_days: z.number().int().optional().describe('Days of history to review (1-365, default 14).'),
|
|
698
|
+
max_events: z.number().int().optional().describe('Cap on events processed (1-1000, default 250).'),
|
|
699
|
+
}),
|
|
700
|
+
annotations: MUTATING,
|
|
701
|
+
}, async ({ project_id, sources, filters, focus_question, lookback_days, max_events }) => {
|
|
650
702
|
try {
|
|
651
703
|
const res = await api.generateInsight(project_id, 'architecture', {
|
|
652
704
|
sources,
|
|
@@ -668,13 +720,17 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
668
720
|
}
|
|
669
721
|
});
|
|
670
722
|
// ── Tool: list insights ─────────────────────────────────────────────
|
|
671
|
-
server.
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
723
|
+
server.registerTool('generate_release_notes', {
|
|
724
|
+
description: 'Generate release notes or a PR description from recent code activity (commits, PRs, builds). Runs synchronously and returns Markdown. Consumes 3 credits on success.',
|
|
725
|
+
inputSchema: z.object({
|
|
726
|
+
project_id: z.string().describe('Project id from list_projects.'),
|
|
727
|
+
source: SourceEnum.default('github').describe('Code source id (github, gitlab, bitbucket, azure_devops).'),
|
|
728
|
+
repo: z.string().optional().describe('Repository name to scope changes to.'),
|
|
729
|
+
style: z.enum(['release_notes', 'pr_description']).default('release_notes').describe('Output style.'),
|
|
730
|
+
filters: FiltersSchema,
|
|
731
|
+
}),
|
|
732
|
+
annotations: MUTATING,
|
|
733
|
+
}, async ({ project_id, source, repo, style, filters }) => {
|
|
678
734
|
try {
|
|
679
735
|
const res = await api.generateInsight(project_id, 'release_notes', { source, repo, style, filters });
|
|
680
736
|
const { job, result } = await api.waitForJob(res.jobId);
|
|
@@ -689,10 +745,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
689
745
|
return { content: [{ type: 'text', text: `Failed: ${err.message}` }] };
|
|
690
746
|
}
|
|
691
747
|
});
|
|
692
|
-
server.
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
748
|
+
server.registerTool('list_digests', {
|
|
749
|
+
description: 'List past scheduled activity digests for a project.',
|
|
750
|
+
inputSchema: z.object({
|
|
751
|
+
project_id: z.string().describe('Project id from list_projects.'),
|
|
752
|
+
limit: z.number().int().min(1).max(50).default(10).describe('Max digests to return (1-50, default 10).'),
|
|
753
|
+
}),
|
|
754
|
+
annotations: READ_ONLY,
|
|
755
|
+
}, async ({ project_id, limit }) => {
|
|
696
756
|
try {
|
|
697
757
|
const { digests } = await api.listDigests(project_id, limit);
|
|
698
758
|
if (digests.length === 0) {
|
|
@@ -705,12 +765,16 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
705
765
|
return { content: [{ type: 'text', text: `Failed to list digests: ${err.message}` }] };
|
|
706
766
|
}
|
|
707
767
|
});
|
|
708
|
-
server.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
768
|
+
server.registerTool('list_insights', {
|
|
769
|
+
description: 'List existing insights for a project (newest first) with their content. Use this to read what has already been generated before spending credits on a new generate_*_insight. Each row\'s id can be sent to Discord via discord_send_message.',
|
|
770
|
+
inputSchema: z.object({
|
|
771
|
+
project_id: z.string().describe('Project id from list_projects to list insights for.'),
|
|
772
|
+
kind: z.enum(['onboarding_brief', 'cross_source_correlation', 'architecture_insight', 'release_notes', 'plan_review']).optional().describe('Restrict to one kind. Omit for all kinds.'),
|
|
773
|
+
status: z.enum(['active', 'archived', 'all']).default('active').describe('active = current, archived = superseded, all = both.'),
|
|
774
|
+
limit: z.number().int().min(1).max(50).default(20).describe('Max insights to return (1-50, default 20).'),
|
|
775
|
+
}),
|
|
776
|
+
annotations: READ_ONLY,
|
|
777
|
+
}, async ({ project_id, kind, status, limit }) => {
|
|
714
778
|
try {
|
|
715
779
|
const { insights } = await api.listInsights(project_id, kind, status, limit);
|
|
716
780
|
if (insights.length === 0) {
|
|
@@ -726,10 +790,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
726
790
|
}
|
|
727
791
|
});
|
|
728
792
|
// ── Tool: ask project ───────────────────────────────────────────────
|
|
729
|
-
server.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
793
|
+
server.registerTool('ask_project', {
|
|
794
|
+
description: 'Ask one question about a project and get an answer grounded in its indexed codebase, connected baselines and last 14 days of activity. Answers synchronously – there is no job to poll. Costs 2 credits per question, so prefer list_handoffs / list_insights when an existing artifact already answers it.',
|
|
795
|
+
inputSchema: z.object({
|
|
796
|
+
question: z.string().min(1).max(2000).describe('The question, 1-2000 characters.'),
|
|
797
|
+
project_id: z.string().optional().describe('Project scope. Omit to use the active project.'),
|
|
798
|
+
}),
|
|
799
|
+
annotations: MUTATING,
|
|
800
|
+
}, async ({ question, project_id }) => {
|
|
733
801
|
try {
|
|
734
802
|
const resolved = await requireProject(project_id);
|
|
735
803
|
const { answer, citations } = await api.askProject(resolved.projectId, question);
|
|
@@ -741,9 +809,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
741
809
|
}
|
|
742
810
|
});
|
|
743
811
|
// ── Tool: list filter options ───────────────────────────────────────
|
|
744
|
-
server.
|
|
745
|
-
|
|
746
|
-
|
|
812
|
+
server.registerTool('list_filter_options', {
|
|
813
|
+
description: 'List the real per-source filter values (resources, branches, event types, priorities) available for a project. Call this BEFORE generate_handoff or any generate_*_insight so the "filters" argument uses real values instead of guesses. Pass a resource id into filters[source].projects, a branch name into .branches, an event type into .eventTypes, a priority into .priorities.',
|
|
814
|
+
inputSchema: z.object({
|
|
815
|
+
project_id: z.string().optional().describe('Project scope. Omit to use the active project.'),
|
|
816
|
+
}),
|
|
817
|
+
annotations: READ_ONLY,
|
|
818
|
+
}, async ({ project_id }) => {
|
|
747
819
|
try {
|
|
748
820
|
const resolved = await requireProject(project_id);
|
|
749
821
|
const { filters, figma } = await api.getHandoffFilters(resolved.projectId);
|
|
@@ -779,13 +851,17 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
779
851
|
return { content: [{ type: 'text', text: `Could not load filter options: ${err.message}` }] };
|
|
780
852
|
}
|
|
781
853
|
});
|
|
782
|
-
server.
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
854
|
+
server.registerTool('list_work_items', {
|
|
855
|
+
description: 'List the work items (tasks and milestones) of a project plan with key, status, progress, dates and assignees, ordered by item number. Filter by status or to your own assignments. Dates are wall-clock times in the plan time zone. When the reply ends with a cursor, pass it back as cursor to read the next page. Free: no credits.',
|
|
856
|
+
inputSchema: z.object({
|
|
857
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
858
|
+
status: z.array(z.enum(['backlog', 'todo', 'in_progress', 'in_review', 'done', 'cancelled'])).optional().describe('Only items in these statuses. Omit for every status.'),
|
|
859
|
+
mine: z.boolean().default(false).describe('Only items assigned to you.'),
|
|
860
|
+
limit: z.number().int().min(1).max(200).default(50).describe('Max items to return (1-200, default 50).'),
|
|
861
|
+
cursor: z.number().int().min(0).optional().describe('The cursor printed at the end of a previous page.'),
|
|
862
|
+
}),
|
|
863
|
+
annotations: READ_ONLY,
|
|
864
|
+
}, async ({ project_id, status, mine, limit, cursor }) => {
|
|
789
865
|
try {
|
|
790
866
|
const resolved = await requireProject(project_id);
|
|
791
867
|
const page = await api.listWorkItems(resolved.projectId, { status, assignee: mine ? 'me' : undefined, limit, cursor });
|
|
@@ -800,10 +876,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
800
876
|
return { content: [{ type: 'text', text: `Could not list work items: ${err.message}` }] };
|
|
801
877
|
}
|
|
802
878
|
});
|
|
803
|
-
server.
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
879
|
+
server.registerTool('get_work_item', {
|
|
880
|
+
description: 'Read one work item by key (such as FR-12) or id: description, progress, dates, assignees, dependencies, linked evidence (commits, pull requests, deploys, messages) and the comment count. Free: no credits.',
|
|
881
|
+
inputSchema: z.object({
|
|
882
|
+
ref: z.string().min(1).max(100).describe('Item key such as FR-12, or the item id.'),
|
|
883
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
884
|
+
}),
|
|
885
|
+
annotations: READ_ONLY,
|
|
886
|
+
}, async ({ ref, project_id }) => {
|
|
807
887
|
try {
|
|
808
888
|
const resolved = await requireProject(project_id);
|
|
809
889
|
const { timezone, item } = await api.getWorkItem(resolved.projectId, ref);
|
|
@@ -813,7 +893,11 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
813
893
|
return { content: [{ type: 'text', text: `Could not read work item: ${err.message}` }] };
|
|
814
894
|
}
|
|
815
895
|
});
|
|
816
|
-
server.
|
|
896
|
+
server.registerTool('list_my_work', {
|
|
897
|
+
description: 'List the work items assigned to you across every accessible project: open items plus the ones finished in the last 7 days, with status, progress and dates. A good first call for "what should I work on next". Free: no credits.',
|
|
898
|
+
inputSchema: z.object({}),
|
|
899
|
+
annotations: READ_ONLY,
|
|
900
|
+
}, async () => {
|
|
817
901
|
try {
|
|
818
902
|
const { items } = await api.listMyWork();
|
|
819
903
|
if (items.length === 0) {
|
|
@@ -826,18 +910,22 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
826
910
|
return { content: [{ type: 'text', text: `Could not list your work: ${err.message}` }] };
|
|
827
911
|
}
|
|
828
912
|
});
|
|
829
|
-
server.
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
913
|
+
server.registerTool('create_work_item', {
|
|
914
|
+
description: 'Create a work item (task or milestone) in a project plan and return it with its key. Dates are wall-clock times in the plan time zone. Contributors can create items when the project allows it and can assign only themselves. Free: no credits. Not idempotent: calling it twice creates two items.',
|
|
915
|
+
inputSchema: z.object({
|
|
916
|
+
title: z.string().min(1).max(500).describe('Item title, 1-500 characters.'),
|
|
917
|
+
description: z.string().max(50000).optional().describe('Description in plain text or Markdown.'),
|
|
918
|
+
parent: z.string().optional().describe('Key or id of the parent item (such as FR-3) to nest the new item under. Omit for a top-level item.'),
|
|
919
|
+
kind: z.enum(['task', 'milestone']).optional().describe('task (default) or milestone.'),
|
|
920
|
+
status: z.enum(['backlog', 'todo', 'in_progress', 'in_review', 'done', 'cancelled']).optional().describe('Initial status (default todo).'),
|
|
921
|
+
priority: z.number().int().min(0).max(4).optional().describe('0 lowest, 1 low, 2 medium (default), 3 high, 4 urgent.'),
|
|
922
|
+
duration: z.string().optional().describe('Duration such as "4h", "3d", "2w", "3ed" (elapsed days) or "2d?" (an estimate).'),
|
|
923
|
+
deadline: z.string().optional().describe('Deadline as YYYY-MM-DD or YYYY-MM-DDTHH:mm in the plan time zone.'),
|
|
924
|
+
assign_to_me: z.boolean().default(false).describe('Assign the new item to yourself.'),
|
|
925
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
926
|
+
}),
|
|
927
|
+
annotations: MUTATING,
|
|
928
|
+
}, async ({ title, description, parent, kind, status, priority, duration, deadline, assign_to_me, project_id }) => {
|
|
841
929
|
try {
|
|
842
930
|
const resolved = await requireProject(project_id);
|
|
843
931
|
const { item } = await api.createWorkItem(resolved.projectId, {
|
|
@@ -857,18 +945,22 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
857
945
|
return { content: [{ type: 'text', text: `Could not create work item: ${err.message}` }] };
|
|
858
946
|
}
|
|
859
947
|
});
|
|
860
|
-
server.
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
948
|
+
server.registerTool('update_work_item', {
|
|
949
|
+
description: 'Update a work item by key or id: status, progress, title, description, priority, the blocked flag, duration or deadline. Sending the same values again leaves the item unchanged. Contributors can update items assigned to them or created by them; changing dates or durations may need a project manager. Free: no credits.',
|
|
950
|
+
inputSchema: z.object({
|
|
951
|
+
ref: z.string().min(1).max(100).describe('Item key such as FR-12, or the item id.'),
|
|
952
|
+
status: z.enum(['backlog', 'todo', 'in_progress', 'in_review', 'done', 'cancelled']).optional().describe('New status.'),
|
|
953
|
+
percent_complete: z.number().int().min(0).max(100).optional().describe('Progress 0-100. 100 marks the item done.'),
|
|
954
|
+
title: z.string().min(1).max(500).optional().describe('New title, 1-500 characters.'),
|
|
955
|
+
description: z.string().max(50000).optional().describe('New description in plain text or Markdown.'),
|
|
956
|
+
priority: z.number().int().min(0).max(4).optional().describe('0 lowest, 1 low, 2 medium, 3 high, 4 urgent.'),
|
|
957
|
+
blocked: z.boolean().optional().describe('Flag or unflag the item as blocked. A flag, not a status.'),
|
|
958
|
+
duration: z.string().optional().describe('Duration such as "4h", "3d", "2w", "3ed" (elapsed days) or "2d?" (an estimate).'),
|
|
959
|
+
deadline: z.string().nullable().optional().describe('Deadline as YYYY-MM-DD or YYYY-MM-DDTHH:mm in the plan time zone, or null to clear it.'),
|
|
960
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
961
|
+
}),
|
|
962
|
+
annotations: WRITE_IDEMPOTENT,
|
|
963
|
+
}, async ({ ref, status, percent_complete, title, description, priority, blocked, duration, deadline, project_id }) => {
|
|
872
964
|
try {
|
|
873
965
|
const resolved = await requireProject(project_id);
|
|
874
966
|
const { item } = await api.updateWorkItem(resolved.projectId, ref, {
|
|
@@ -887,9 +979,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
887
979
|
return { content: [{ type: 'text', text: `Could not update work item: ${err.message}` }] };
|
|
888
980
|
}
|
|
889
981
|
});
|
|
890
|
-
server.
|
|
891
|
-
|
|
892
|
-
|
|
982
|
+
server.registerTool('list_suggestions', {
|
|
983
|
+
description: 'List the pending suggestions in a project plan that you can act on: status changes proposed from linked activity (an opened or merged pull request, a deploy), new items from meeting action items, dependencies from tracker links and activity suggested as evidence for an item. Nothing changes until someone accepts a suggestion in Flow Relay. Free: no credits.',
|
|
984
|
+
inputSchema: z.object({
|
|
985
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
986
|
+
}),
|
|
987
|
+
annotations: READ_ONLY,
|
|
988
|
+
}, async ({ project_id }) => {
|
|
893
989
|
try {
|
|
894
990
|
const resolved = await requireProject(project_id);
|
|
895
991
|
const { suggestions } = await api.listSuggestions(resolved.projectId);
|
|
@@ -902,14 +998,18 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
902
998
|
return { content: [{ type: 'text', text: `Could not list suggestions: ${err.message}` }] };
|
|
903
999
|
}
|
|
904
1000
|
});
|
|
905
|
-
server.
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1001
|
+
server.registerTool('link_evidence', {
|
|
1002
|
+
description: 'Link work to a work item as evidence: a pull request, commit, build, deploy, incident, document or any other https link. The link joins the activity trail of the item and counts toward its evidence coverage. Sending the same link again leaves the item unchanged. Viewers cannot link. Free: no credits.',
|
|
1003
|
+
inputSchema: z.object({
|
|
1004
|
+
ref: z.string().min(1).max(100).describe('Item key such as FR-12, or the item id.'),
|
|
1005
|
+
url: z.string().min(1).max(500).describe('The https link to attach.'),
|
|
1006
|
+
title: z.string().min(1).max(300).optional().describe('Short title for the link. Defaults to the link itself.'),
|
|
1007
|
+
kind: z.enum(['commit', 'branch', 'pull_request', 'review', 'build', 'deploy', 'incident', 'ticket', 'message', 'meeting', 'document', 'other']).optional().describe('What the link points to (default other).'),
|
|
1008
|
+
occurred_at: z.string().optional().describe('When the work happened, as an ISO 8601 date and time. Defaults to now.'),
|
|
1009
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1010
|
+
}),
|
|
1011
|
+
annotations: WRITE_IDEMPOTENT,
|
|
1012
|
+
}, async ({ ref, url, title, kind, occurred_at, project_id }) => {
|
|
913
1013
|
try {
|
|
914
1014
|
const resolved = await requireProject(project_id);
|
|
915
1015
|
const linked = await api.linkEvidence(resolved.projectId, ref, { url, title, kind, occurredAt: occurred_at });
|
|
@@ -919,10 +1019,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
919
1019
|
return { content: [{ type: 'text', text: `Could not link evidence: ${err.message}` }] };
|
|
920
1020
|
}
|
|
921
1021
|
});
|
|
922
|
-
server.
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1022
|
+
server.registerTool('generate_plan_review', {
|
|
1023
|
+
description: 'Write a status report for a project plan: progress, concerns, the outlook of each upcoming milestone, suggested register entries and next steps. Every date, variance and index comes from the plan itself; the model only writes the narrative from the plan facts and the last 14 days of linked activity. Runs synchronously and returns Markdown. Consumes 5 credits on success. Viewers cannot generate.',
|
|
1024
|
+
inputSchema: z.object({
|
|
1025
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1026
|
+
filters: FiltersSchema,
|
|
1027
|
+
}),
|
|
1028
|
+
annotations: MUTATING,
|
|
1029
|
+
}, async ({ project_id, filters }) => {
|
|
926
1030
|
try {
|
|
927
1031
|
const resolved = await requireProject(project_id);
|
|
928
1032
|
const res = await api.generateInsight(resolved.projectId, 'plan_review', { filters });
|
|
@@ -938,10 +1042,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
938
1042
|
return { content: [{ type: 'text', text: `Failed: ${err.message}` }] };
|
|
939
1043
|
}
|
|
940
1044
|
});
|
|
941
|
-
server.
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1045
|
+
server.registerTool('get_earned_value', {
|
|
1046
|
+
description: 'Read the cost picture of a project plan at its status date: planned and actual cost, and the earned value figures (planned value, earned value, variances, SPI, CPI, TCPI and the estimates at completion) measured against a baseline. Amounts are in the currency of the organization. Project managers only, on plans that include costs. Free: no credits.',
|
|
1047
|
+
inputSchema: z.object({
|
|
1048
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1049
|
+
baseline: z.number().int().min(0).max(10).optional().describe('Baseline slot to measure against, 0 to 10 (default 0).'),
|
|
1050
|
+
}),
|
|
1051
|
+
annotations: READ_ONLY,
|
|
1052
|
+
}, async ({ project_id, baseline }) => {
|
|
945
1053
|
try {
|
|
946
1054
|
const resolved = await requireProject(project_id);
|
|
947
1055
|
const evm = await api.getEarnedValue(resolved.projectId, baseline);
|
|
@@ -951,12 +1059,16 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
951
1059
|
return { content: [{ type: 'text', text: `Could not read earned value: ${err.message}` }] };
|
|
952
1060
|
}
|
|
953
1061
|
});
|
|
954
|
-
server.
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1062
|
+
server.registerTool('list_raid', {
|
|
1063
|
+
description: 'List the RAID register of a project plan: risks, assumptions, issues, decisions and dependencies, highest number first, with their score (probability times impact) and response. Entries that are not closed by default. Free: no credits.',
|
|
1064
|
+
inputSchema: z.object({
|
|
1065
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1066
|
+
kind: z.enum(['risk', 'assumption', 'issue', 'decision', 'dependency']).optional().describe('Restrict to one type. Omit for all types.'),
|
|
1067
|
+
status: z.enum(['open', 'monitoring', 'closed', 'all']).optional().describe('Restrict to one status, or all. Omit for every entry that is not closed.'),
|
|
1068
|
+
limit: z.number().int().min(1).max(200).default(50).describe('Max entries to return (1-200, default 50).'),
|
|
1069
|
+
}),
|
|
1070
|
+
annotations: READ_ONLY,
|
|
1071
|
+
}, async ({ project_id, kind, status, limit }) => {
|
|
960
1072
|
try {
|
|
961
1073
|
const resolved = await requireProject(project_id);
|
|
962
1074
|
const { entries } = await api.listRaid(resolved.projectId, { kind, status, limit });
|
|
@@ -969,9 +1081,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
969
1081
|
return { content: [{ type: 'text', text: `Could not list the register: ${err.message}` }] };
|
|
970
1082
|
}
|
|
971
1083
|
});
|
|
972
|
-
server.
|
|
973
|
-
|
|
974
|
-
|
|
1084
|
+
server.registerTool('get_portfolio', {
|
|
1085
|
+
description: 'Read the portfolio of an organization: every project you can open with its progress, forecast finish, next milestone, open risks and health (on track, at risk or off track: computed every night from the plan and the build, deploy and incident signals, or set by hand by a project manager). Use it to see which projects need attention. Business plan and above. Free: no credits.',
|
|
1086
|
+
inputSchema: z.object({
|
|
1087
|
+
organization_id: z.string().describe('Organization id: shown as organization_id on the projects of list_projects.'),
|
|
1088
|
+
}),
|
|
1089
|
+
annotations: READ_ONLY,
|
|
1090
|
+
}, async ({ organization_id }) => {
|
|
975
1091
|
try {
|
|
976
1092
|
const portfolio = await api.getPortfolio(organization_id);
|
|
977
1093
|
return { content: [{ type: 'text', text: portfolioText(portfolio) }] };
|
|
@@ -980,11 +1096,15 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
980
1096
|
return { content: [{ type: 'text', text: `Could not read the portfolio: ${err.message}` }] };
|
|
981
1097
|
}
|
|
982
1098
|
});
|
|
983
|
-
server.
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1099
|
+
server.registerTool('get_forecast', {
|
|
1100
|
+
description: 'Forecast when a project plan will finish by simulating it thousands of times: the finish of the project and of each milestone as the date by which half, four out of five and nineteen out of twenty of the runs are done, the chance of meeting the target finish or a milestone deadline and the items most often on the critical path. Mode schedule (default) varies the durations of the plan (uncertainty low, medium or high); mode throughput uses how many items the team finished each week over the last twelve weeks. Business plan and above. Free: no credits.',
|
|
1101
|
+
inputSchema: z.object({
|
|
1102
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1103
|
+
mode: z.enum(['schedule', 'throughput']).optional().describe('schedule varies the durations of the plan (default); throughput uses the weekly pace of the team.'),
|
|
1104
|
+
uncertainty: z.enum(['low', 'medium', 'high']).optional().describe('How much the durations may vary in schedule mode (default medium).'),
|
|
1105
|
+
}),
|
|
1106
|
+
annotations: READ_ONLY,
|
|
1107
|
+
}, async ({ project_id, mode, uncertainty }) => {
|
|
988
1108
|
try {
|
|
989
1109
|
const resolved = await requireProject(project_id);
|
|
990
1110
|
const forecast = await api.getForecast(resolved.projectId, { mode, uncertainty });
|
|
@@ -994,10 +1114,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
994
1114
|
return { content: [{ type: 'text', text: `Could not forecast: ${err.message}` }] };
|
|
995
1115
|
}
|
|
996
1116
|
});
|
|
997
|
-
server.
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1117
|
+
server.registerTool('plan_whatif', {
|
|
1118
|
+
description: 'Ask a what-if question about a project plan, for example: what if the payment integration takes three weeks longer? The model turns the question into changes to the work (a duration, a delay, a cancellation, a link) and the scheduler computes the new finish of the project and of each milestone and how many items move. Nothing is saved and the plan is not changed. Costs 5 credits.',
|
|
1119
|
+
inputSchema: z.object({
|
|
1120
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1121
|
+
question: z.string().min(5).max(500).describe('The what-if question, in words, about the work of the plan.'),
|
|
1122
|
+
}),
|
|
1123
|
+
annotations: MUTATING,
|
|
1124
|
+
}, async ({ project_id, question }) => {
|
|
1001
1125
|
try {
|
|
1002
1126
|
const resolved = await requireProject(project_id);
|
|
1003
1127
|
const result = await api.planWhatIf(resolved.projectId, question);
|
|
@@ -1007,9 +1131,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1007
1131
|
return { content: [{ type: 'text', text: `Could not answer the what-if: ${err.message}` }] };
|
|
1008
1132
|
}
|
|
1009
1133
|
});
|
|
1010
|
-
server.
|
|
1011
|
-
|
|
1012
|
-
|
|
1134
|
+
server.registerTool('list_automations', {
|
|
1135
|
+
description: 'List the automation rules of a project plan: what starts each one, what it checks and what it does, how many times it ran and how the last run went. Read only, the rules are changed in the app. Free: no credits.',
|
|
1136
|
+
inputSchema: z.object({
|
|
1137
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1138
|
+
}),
|
|
1139
|
+
annotations: READ_ONLY,
|
|
1140
|
+
}, async ({ project_id }) => {
|
|
1013
1141
|
try {
|
|
1014
1142
|
const resolved = await requireProject(project_id);
|
|
1015
1143
|
const { automations } = await api.listAutomations(resolved.projectId);
|
|
@@ -1021,9 +1149,13 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1021
1149
|
return { content: [{ type: 'text', text: `Could not list the automations: ${err.message}` }] };
|
|
1022
1150
|
}
|
|
1023
1151
|
});
|
|
1024
|
-
server.
|
|
1025
|
-
|
|
1026
|
-
|
|
1152
|
+
server.registerTool('list_templates', {
|
|
1153
|
+
description: 'List the templates saved for a project plan, either a whole plan or one item with its subtasks, with the id to give to apply_template. A template keeps names, notes, durations and links, never people or dates. Free: no credits.',
|
|
1154
|
+
inputSchema: z.object({
|
|
1155
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1156
|
+
}),
|
|
1157
|
+
annotations: READ_ONLY,
|
|
1158
|
+
}, async ({ project_id }) => {
|
|
1027
1159
|
try {
|
|
1028
1160
|
const resolved = await requireProject(project_id);
|
|
1029
1161
|
const { templates } = await api.listTemplates(resolved.projectId);
|
|
@@ -1035,11 +1167,15 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1035
1167
|
return { content: [{ type: 'text', text: `Could not list the templates: ${err.message}` }] };
|
|
1036
1168
|
}
|
|
1037
1169
|
});
|
|
1038
|
-
server.
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1170
|
+
server.registerTool('apply_template', {
|
|
1171
|
+
description: 'Add the items of a saved template to a project plan, at the top level or under an existing item. Only project managers can do it. Costs no credits but creates items in the plan, which the change history can undo.',
|
|
1172
|
+
inputSchema: z.object({
|
|
1173
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1174
|
+
template_id: z.string().describe('Template id from list_templates.'),
|
|
1175
|
+
parent: z.string().optional().describe('Item key such as FR-12 or item id to add the template under. Omit for the top level.'),
|
|
1176
|
+
}),
|
|
1177
|
+
annotations: MUTATING,
|
|
1178
|
+
}, async ({ project_id, template_id, parent }) => {
|
|
1043
1179
|
try {
|
|
1044
1180
|
const resolved = await requireProject(project_id);
|
|
1045
1181
|
const result = await api.applyTemplate(resolved.projectId, template_id, parent);
|
|
@@ -1049,10 +1185,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1049
1185
|
return { content: [{ type: 'text', text: `Could not apply the template: ${err.message}` }] };
|
|
1050
1186
|
}
|
|
1051
1187
|
});
|
|
1052
|
-
server.
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1188
|
+
server.registerTool('list_approvals', {
|
|
1189
|
+
description: 'List the change requests of a project plan: what was asked in plain language, who asked, who decided and what they said. Change requests need the Business plan and an organization project. Free: no credits.',
|
|
1190
|
+
inputSchema: z.object({
|
|
1191
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1192
|
+
pending_only: z.boolean().optional().describe('Only the requests waiting for a decision.'),
|
|
1193
|
+
}),
|
|
1194
|
+
annotations: READ_ONLY,
|
|
1195
|
+
}, async ({ project_id, pending_only }) => {
|
|
1056
1196
|
try {
|
|
1057
1197
|
const resolved = await requireProject(project_id);
|
|
1058
1198
|
const { approvals } = await api.listApprovals(resolved.projectId, pending_only === true);
|
|
@@ -1064,18 +1204,22 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1064
1204
|
return { content: [{ type: 'text', text: `Could not list the change requests: ${err.message}` }] };
|
|
1065
1205
|
}
|
|
1066
1206
|
});
|
|
1067
|
-
server.
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1207
|
+
server.registerTool('request_change', {
|
|
1208
|
+
description: 'Ask for a change to a work item that a second person must approve, when you may not make it directly or want it reviewed: status, progress, priority, the blocked flag, duration or deadline. The approvers are notified and approving applies the change. This only creates a request: nothing changes in the plan yet. Organization projects on the Business plan or above only. Free: no credits.',
|
|
1209
|
+
inputSchema: z.object({
|
|
1210
|
+
ref: z.string().min(1).max(100).describe('Item key such as FR-12, or the item id.'),
|
|
1211
|
+
title: z.string().min(1).max(200).describe('What you want changed, in a few words.'),
|
|
1212
|
+
note: z.string().max(2000).optional().describe('Why the change is needed.'),
|
|
1213
|
+
status: z.enum(['backlog', 'todo', 'in_progress', 'in_review', 'done', 'cancelled']).optional().describe('New status.'),
|
|
1214
|
+
percent_complete: z.number().int().min(0).max(100).optional().describe('Progress 0-100.'),
|
|
1215
|
+
priority: z.number().int().min(0).max(4).optional().describe('0 lowest, 1 low, 2 medium, 3 high, 4 urgent.'),
|
|
1216
|
+
blocked: z.boolean().optional().describe('Flag or unflag the item as blocked.'),
|
|
1217
|
+
duration: z.string().optional().describe('Duration such as "4h", "3d", "2w", "3ed" (elapsed days) or "2d?" (an estimate).'),
|
|
1218
|
+
deadline: z.string().nullable().optional().describe('Deadline as YYYY-MM-DD or YYYY-MM-DDTHH:mm in the plan time zone, or null to clear it.'),
|
|
1219
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1220
|
+
}),
|
|
1221
|
+
annotations: MUTATING,
|
|
1222
|
+
}, async ({ ref, title, note, status, percent_complete, priority, blocked, duration, deadline, project_id }) => {
|
|
1079
1223
|
try {
|
|
1080
1224
|
const resolved = await requireProject(project_id);
|
|
1081
1225
|
const changes = Object.fromEntries(Object.entries({ status, percentComplete: percent_complete, priority, blocked, duration, deadline }).filter(([, v]) => v !== undefined));
|
|
@@ -1088,11 +1232,15 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1088
1232
|
return { content: [{ type: 'text', text: `Could not send the change request: ${err.message}` }] };
|
|
1089
1233
|
}
|
|
1090
1234
|
});
|
|
1091
|
-
server.
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1235
|
+
server.registerTool('resolve_suggestion', {
|
|
1236
|
+
description: 'Accept or dismiss one pending suggestion from list_suggestions. Accepting applies it to the plan as the key owner: a status change, a new item, a dependency or an evidence link. Dismissing hides it. Accepting changes the plan, so confirm with the user first. Free: no credits.',
|
|
1237
|
+
inputSchema: z.object({
|
|
1238
|
+
suggestion_id: z.string().min(1).describe('Suggestion id from list_suggestions.'),
|
|
1239
|
+
action: z.enum(['accept', 'dismiss']).describe('accept applies the suggestion to the plan, dismiss hides it.'),
|
|
1240
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1241
|
+
}),
|
|
1242
|
+
annotations: MUTATING,
|
|
1243
|
+
}, async ({ suggestion_id, action, project_id }) => {
|
|
1096
1244
|
try {
|
|
1097
1245
|
const resolved = await requireProject(project_id);
|
|
1098
1246
|
const { status } = await api.resolveSuggestion(resolved.projectId, suggestion_id, action);
|
|
@@ -1102,17 +1250,21 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1102
1250
|
return { content: [{ type: 'text', text: `Could not resolve the suggestion: ${err.message}` }] };
|
|
1103
1251
|
}
|
|
1104
1252
|
});
|
|
1105
|
-
server.
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1253
|
+
server.registerTool('create_raid_entry', {
|
|
1254
|
+
description: 'Add an entry to the RAID register of a project plan: a risk, assumption, issue, decision or dependency. Probability and impact are scores from 1 to 5 and their product is the score list_raid shows. Viewers cannot add. Free: no credits.',
|
|
1255
|
+
inputSchema: z.object({
|
|
1256
|
+
kind: z.enum(['risk', 'assumption', 'issue', 'decision', 'dependency']).describe('What the entry is.'),
|
|
1257
|
+
title: z.string().min(1).max(300).describe('Short title of the entry.'),
|
|
1258
|
+
description: z.string().max(10000).optional().describe('Details of the entry.'),
|
|
1259
|
+
status: z.enum(['open', 'monitoring', 'closed']).optional().describe('Status (default open).'),
|
|
1260
|
+
probability: z.number().int().min(1).max(5).optional().describe('How likely it is, 1 rare to 5 almost certain.'),
|
|
1261
|
+
impact: z.number().int().min(1).max(5).optional().describe('How much it matters, 1 minor to 5 severe.'),
|
|
1262
|
+
response: z.string().max(5000).optional().describe('The planned response or mitigation.'),
|
|
1263
|
+
due_on: z.string().optional().describe('Due date as YYYY-MM-DD.'),
|
|
1264
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1265
|
+
}),
|
|
1266
|
+
annotations: MUTATING,
|
|
1267
|
+
}, async ({ kind, title, description, status, probability, impact, response, due_on, project_id }) => {
|
|
1116
1268
|
try {
|
|
1117
1269
|
const resolved = await requireProject(project_id);
|
|
1118
1270
|
const created = await api.createRaidEntry(resolved.projectId, { kind, title, description, status, probability, impact, response, dueOn: due_on });
|
|
@@ -1122,10 +1274,14 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1122
1274
|
return { content: [{ type: 'text', text: `Could not add the register entry: ${err.message}` }] };
|
|
1123
1275
|
}
|
|
1124
1276
|
});
|
|
1125
|
-
server.
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1277
|
+
server.registerTool('delete_work_item', {
|
|
1278
|
+
description: 'Delete a work item and everything under it from a project plan: its sub-items, dependencies and assignments leave the plan and the plan is rescheduled. The deletion is recorded as one batch in the change history, so a project manager can restore it in Flow Relay. Contributors can delete only items they created. Confirm with the user before calling it. Free: no credits.',
|
|
1279
|
+
inputSchema: z.object({
|
|
1280
|
+
ref: z.string().min(1).max(100).describe('Item key such as FR-12, or the item id.'),
|
|
1281
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1282
|
+
}),
|
|
1283
|
+
annotations: DESTRUCTIVE,
|
|
1284
|
+
}, async ({ ref, project_id }) => {
|
|
1129
1285
|
try {
|
|
1130
1286
|
const resolved = await requireProject(project_id);
|
|
1131
1287
|
await api.deleteWorkItem(resolved.projectId, ref);
|
|
@@ -1135,12 +1291,16 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1135
1291
|
return { content: [{ type: 'text', text: `Could not delete the work item: ${err.message}` }] };
|
|
1136
1292
|
}
|
|
1137
1293
|
});
|
|
1138
|
-
server.
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1294
|
+
server.registerTool('decide_approval', {
|
|
1295
|
+
description: 'Approve, reject or withdraw a change request listed by list_approvals. Approving applies the requested change to the plan as the approver. A request needs a second person: you cannot approve or reject a request you made, and only its author can withdraw it. Confirm with the user before approving. Free: no credits.',
|
|
1296
|
+
inputSchema: z.object({
|
|
1297
|
+
approval_id: z.string().min(1).describe('Change request id from list_approvals.'),
|
|
1298
|
+
decision: z.enum(['approve', 'reject', 'withdraw']).describe('approve applies the change, reject refuses it, withdraw cancels your own request.'),
|
|
1299
|
+
note: z.string().max(1000).optional().describe('Why, shown to the other person.'),
|
|
1300
|
+
project_id: z.string().optional().describe('Project id from list_projects. Omit to use the active project.'),
|
|
1301
|
+
}),
|
|
1302
|
+
annotations: MUTATING,
|
|
1303
|
+
}, async ({ approval_id, decision, note, project_id }) => {
|
|
1144
1304
|
try {
|
|
1145
1305
|
const resolved = await requireProject(project_id);
|
|
1146
1306
|
const { status } = await api.decideApproval(resolved.projectId, approval_id, decision, note);
|
|
@@ -1153,7 +1313,7 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1153
1313
|
server.registerPrompt('handoff_for_branch', {
|
|
1154
1314
|
title: 'Handoff for a branch',
|
|
1155
1315
|
description: 'Generate a handoff limited to one git branch and present it.',
|
|
1156
|
-
argsSchema: { branch: z.string().describe('Branch name such as main or feature/login.') },
|
|
1316
|
+
argsSchema: z.object({ branch: z.string().describe('Branch name such as main or feature/login.') }),
|
|
1157
1317
|
}, ({ branch }) => ({
|
|
1158
1318
|
messages: [
|
|
1159
1319
|
{
|
|
@@ -1168,10 +1328,10 @@ export function createFlowRelayServer(api, initialProjectId) {
|
|
|
1168
1328
|
server.registerPrompt('onboard_me', {
|
|
1169
1329
|
title: 'Onboard me to a project',
|
|
1170
1330
|
description: 'Generate an onboarding brief tailored to a role and a focus area.',
|
|
1171
|
-
argsSchema: {
|
|
1331
|
+
argsSchema: z.object({
|
|
1172
1332
|
role: z.string().describe('The role of the person being onboarded, for example backend engineer.'),
|
|
1173
1333
|
focus: z.string().optional().describe('The repository or feature area they will work on.'),
|
|
1174
|
-
},
|
|
1334
|
+
}),
|
|
1175
1335
|
}, ({ role, focus }) => ({
|
|
1176
1336
|
messages: [
|
|
1177
1337
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowrelay/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Flow Relay MCP Server for Claude Desktop and Claude Code – handoffs, integrations and context events via natural conversation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"flowrelay-mcp": "dist/index.js"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=26"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"dist"
|
|
@@ -37,12 +37,16 @@
|
|
|
37
37
|
"test": "node --import tsx --test \"tests/**/*.test.ts\""
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@modelcontextprotocol/
|
|
41
|
-
"zod": "^4.
|
|
40
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
41
|
+
"zod": "^4.6.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"
|
|
44
|
+
"@modelcontextprotocol/client": "^2.4.0",
|
|
45
|
+
"@types/node": "^26.6.6",
|
|
46
|
+
"tsx": "^4.23.15",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
|
+
},
|
|
49
|
+
"allowScripts": {
|
|
50
|
+
"esbuild@0.28.2": true
|
|
47
51
|
}
|
|
48
52
|
}
|