@flowrelay/mcp-server 0.9.0 → 1.0.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 CHANGED
@@ -9,7 +9,7 @@ It connects to Flow Relay API v1 using an API key and supports:
9
9
  ## Package
10
10
 
11
11
  - Name: @flowrelay/mcp-server
12
- - Version: 0.9.0
12
+ - Version: 1.0.0
13
13
 
14
14
  ## What Is Included
15
15
 
@@ -18,6 +18,7 @@ The server currently exposes these tools:
18
18
  - get_workspace_context
19
19
  - list_projects
20
20
  - set_active_project
21
+ - list_filter_options (lists the selectable resources, branches, event types and priorities per source for a project – call this before generating so handoff/insight filters use real values instead of guesses)
21
22
  - list_handoffs (returns project-specific handoffs, or an aggregated view of all accessible project handoffs if no project is active; filter by status: active, archived, or all)
22
23
  - generate_handoff (processed asynchronously, and the server automatically polls until the job finishes. Requires active project or project_id. Accepts per-source filters: projects, eventTypes, branches, priorities.)
23
24
  - generate_correlation_insight (accepts per-source filters)
package/dist/api.d.ts CHANGED
@@ -98,6 +98,30 @@ export type GenerateInsightResponse = {
98
98
  jobId: string;
99
99
  status: AiJobStatus;
100
100
  };
101
+ export interface AvailableSourceFilter {
102
+ projects: {
103
+ id: string;
104
+ label: string;
105
+ }[];
106
+ eventTypes: {
107
+ value: string;
108
+ label: string;
109
+ }[];
110
+ branches?: {
111
+ value: string;
112
+ label: string;
113
+ }[];
114
+ branchesByProject?: Record<string, {
115
+ value: string;
116
+ label: string;
117
+ }[]>;
118
+ defaultBranchByProject?: Record<string, string>;
119
+ priorities: {
120
+ value: string;
121
+ label: string;
122
+ }[];
123
+ }
124
+ export type AvailableFilters = Record<string, AvailableSourceFilter>;
101
125
  export declare class FlowRelayAPI {
102
126
  private baseUrl;
103
127
  private apiKey;
@@ -105,6 +129,7 @@ export declare class FlowRelayAPI {
105
129
  private requestRaw;
106
130
  private request;
107
131
  listProjects(): Promise<TenantContext>;
132
+ getHandoffFilters(projectId: string): Promise<AvailableFilters>;
108
133
  listHandoffs(status?: string, limit?: number, projectId?: string | null): Promise<{
109
134
  handoffs: HandoffResult[];
110
135
  }>;
package/dist/api.js CHANGED
@@ -34,6 +34,10 @@ export class FlowRelayAPI {
34
34
  async listProjects() {
35
35
  return this.request('/projects');
36
36
  }
37
+ async getHandoffFilters(projectId) {
38
+ const { filters } = await this.request(`/handoffs/filters?project_id=${encodeURIComponent(projectId)}`);
39
+ return filters ?? {};
40
+ }
37
41
  async listHandoffs(status = 'active', limit = 10, projectId) {
38
42
  const params = new URLSearchParams();
39
43
  params.set('status', status);
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ const api = new FlowRelayAPI(apiKey, process.env.FLOWRELAY_BASE_URL);
59
59
  let activeProjectId = normalizeProjectId(process.env.FLOWRELAY_PROJECT_ID);
60
60
  const server = new McpServer({
61
61
  name: 'flowrelay',
62
- version: '0.9.0',
62
+ version: '1.0.0',
63
63
  });
64
64
  async function getTenantContext() {
65
65
  const context = await api.listProjects();
@@ -446,6 +446,39 @@ server.tool('list_insights', 'List project AI insights for a selected project sc
446
446
  return { content: [{ type: 'text', text: `Failed to list insights: ${err.message}` }] };
447
447
  }
448
448
  });
449
+ // ── Tool: list filter options ───────────────────────────────────────
450
+ server.tool('list_filter_options', '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.', {
451
+ project_id: z.string().optional().describe('Project scope. Omit to use the active project.'),
452
+ }, async ({ project_id }) => {
453
+ try {
454
+ const resolved = await requireProject(project_id);
455
+ const filters = await api.getHandoffFilters(resolved.projectId);
456
+ const sources = Object.keys(filters);
457
+ if (sources.length === 0) {
458
+ return { content: [{ type: 'text', text: `No connected sources with filter options for ${resolved.project.name}.` }] };
459
+ }
460
+ const blocks = sources.map((src) => {
461
+ const f = filters[src];
462
+ const lines = [`### ${src}`];
463
+ if (f.projects?.length) {
464
+ const items = f.projects.slice(0, 50).map((p) => (p.label && p.label !== p.id ? `${p.label} (id: ${p.id})` : p.id));
465
+ const more = f.projects.length > 50 ? ` (+${f.projects.length - 50} more)` : '';
466
+ lines.push(`- Resources: ${items.join(', ')}${more}`);
467
+ }
468
+ if (f.branches?.length)
469
+ lines.push(`- Branches: ${f.branches.map((b) => b.value).join(', ')}`);
470
+ if (f.eventTypes?.length)
471
+ lines.push(`- Event types: ${f.eventTypes.map((e) => e.value).join(', ')}`);
472
+ if (f.priorities?.length)
473
+ lines.push(`- Priorities: ${f.priorities.map((p) => p.value).join(', ')}`);
474
+ return lines.join('\n');
475
+ });
476
+ return { content: [{ type: 'text', text: `Filter options for ${resolved.project.name}:\n\n${blocks.join('\n\n')}` }] };
477
+ }
478
+ catch (err) {
479
+ return { content: [{ type: 'text', text: `Could not load filter options: ${err.message}` }] };
480
+ }
481
+ });
449
482
  // ── Start ────────────────────────────────────────────────────────────
450
483
  const transport = new StdioServerTransport();
451
484
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowrelay/mcp-server",
3
- "version": "0.9.0",
3
+ "version": "1.0.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": "MIT",