@flowrelay/mcp-server 1.0.2 → 1.0.4
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 +4 -2
- package/dist/api.d.ts +11 -1
- package/dist/api.js +2 -2
- package/dist/index.js +11 -3
- package/package.json +1 -1
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: 1.0.
|
|
12
|
+
- Version: 1.0.4
|
|
13
13
|
|
|
14
14
|
## What Is Included
|
|
15
15
|
|
|
@@ -18,12 +18,14 @@ 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
|
+
- 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; also reports whether Figma is selectable, since Figma requires the project's processing region to be Global)
|
|
22
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)
|
|
23
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.)
|
|
24
24
|
- generate_correlation_insight (accepts per-source filters)
|
|
25
25
|
- generate_onboarding_brief (accepts per-source filters)
|
|
26
26
|
- generate_architecture_insight (accepts per-source filters)
|
|
27
|
+
|
|
28
|
+
Selecting Figma in `sources` or `filters` attaches visual context to the generation (rendered frame previews plus the indexed design scene: layout, texts, prototype flows). It works on projects whose processing region is Global and adds a flat 1-credit surcharge per generation.
|
|
27
29
|
- list_insights
|
|
28
30
|
- list_integrations
|
|
29
31
|
- list_events
|
package/dist/api.d.ts
CHANGED
|
@@ -126,6 +126,13 @@ export interface AvailableSourceFilter {
|
|
|
126
126
|
}[];
|
|
127
127
|
}
|
|
128
128
|
export type AvailableFilters = Record<string, AvailableSourceFilter>;
|
|
129
|
+
export interface FigmaGateInfo {
|
|
130
|
+
selectable: boolean;
|
|
131
|
+
region: string;
|
|
132
|
+
scope: string;
|
|
133
|
+
canManageResidency: boolean;
|
|
134
|
+
residencyHref: string | null;
|
|
135
|
+
}
|
|
129
136
|
export declare class FlowRelayAPI {
|
|
130
137
|
private baseUrl;
|
|
131
138
|
private apiKey;
|
|
@@ -133,7 +140,10 @@ export declare class FlowRelayAPI {
|
|
|
133
140
|
private requestRaw;
|
|
134
141
|
private request;
|
|
135
142
|
listProjects(): Promise<TenantContext>;
|
|
136
|
-
getHandoffFilters(projectId: string): Promise<
|
|
143
|
+
getHandoffFilters(projectId: string): Promise<{
|
|
144
|
+
filters: AvailableFilters;
|
|
145
|
+
figma: FigmaGateInfo | null;
|
|
146
|
+
}>;
|
|
137
147
|
listHandoffs(status?: string, limit?: number, projectId?: string | null): Promise<{
|
|
138
148
|
handoffs: HandoffResult[];
|
|
139
149
|
}>;
|
package/dist/api.js
CHANGED
|
@@ -35,8 +35,8 @@ export class FlowRelayAPI {
|
|
|
35
35
|
return this.request('/projects');
|
|
36
36
|
}
|
|
37
37
|
async getHandoffFilters(projectId) {
|
|
38
|
-
const { filters } = await this.request(`/handoffs/filters?project_id=${encodeURIComponent(projectId)}`);
|
|
39
|
-
return filters ?? {};
|
|
38
|
+
const { filters, figma } = await this.request(`/handoffs/filters?project_id=${encodeURIComponent(projectId)}`);
|
|
39
|
+
return { filters: filters ?? {}, figma: figma ?? null };
|
|
40
40
|
}
|
|
41
41
|
async listHandoffs(status = 'active', limit = 10, projectId) {
|
|
42
42
|
const params = new URLSearchParams();
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { FlowRelayAPI } from './api.js';
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
const { version: PKG_VERSION } = createRequire(import.meta.url)('../package.json');
|
|
6
8
|
const SOURCES = [
|
|
7
9
|
'github',
|
|
8
10
|
'slack',
|
|
@@ -59,7 +61,7 @@ const api = new FlowRelayAPI(apiKey, process.env.FLOWRELAY_BASE_URL);
|
|
|
59
61
|
let activeProjectId = normalizeProjectId(process.env.FLOWRELAY_PROJECT_ID);
|
|
60
62
|
const server = new McpServer({
|
|
61
63
|
name: 'flowrelay',
|
|
62
|
-
version:
|
|
64
|
+
version: PKG_VERSION,
|
|
63
65
|
});
|
|
64
66
|
async function getTenantContext() {
|
|
65
67
|
const context = await api.listProjects();
|
|
@@ -206,7 +208,7 @@ server.tool('list_handoffs', 'List Flow Relay handoffs in the current tenant sco
|
|
|
206
208
|
return { content: [{ type: 'text', text }] };
|
|
207
209
|
});
|
|
208
210
|
// ── Tool: generate handoff ───────────────────────────────────────────
|
|
209
|
-
server.tool('generate_handoff', 'Generate a new context handoff for
|
|
211
|
+
server.tool('generate_handoff', 'Generate a new context handoff for the active project. Requires an active project or explicit project_id. Supports per-source filters.', {
|
|
210
212
|
sources: z.array(SourceEnum)
|
|
211
213
|
.optional()
|
|
212
214
|
.describe('Specific sources to include (omit for all connected sources)'),
|
|
@@ -454,7 +456,7 @@ server.tool('list_filter_options', 'List the real per-source filter values (reso
|
|
|
454
456
|
}, async ({ project_id }) => {
|
|
455
457
|
try {
|
|
456
458
|
const resolved = await requireProject(project_id);
|
|
457
|
-
const filters = await api.getHandoffFilters(resolved.projectId);
|
|
459
|
+
const { filters, figma } = await api.getHandoffFilters(resolved.projectId);
|
|
458
460
|
const sources = Object.keys(filters);
|
|
459
461
|
if (sources.length === 0) {
|
|
460
462
|
return { content: [{ type: 'text', text: `No connected sources with filter options for ${resolved.project.name}.` }] };
|
|
@@ -475,6 +477,12 @@ server.tool('list_filter_options', 'List the real per-source filter values (reso
|
|
|
475
477
|
lines.push(`- Priorities: ${f.priorities.map((p) => p.value).join(', ')}`);
|
|
476
478
|
return lines.join('\n');
|
|
477
479
|
});
|
|
480
|
+
if (figma && !figma.selectable) {
|
|
481
|
+
blocks.push('### figma\n- NOT selectable on this project: Figma visual context requires the Global processing region. ' +
|
|
482
|
+
(figma.canManageResidency
|
|
483
|
+
? 'Switch the project to Global in its Data Residency settings first.'
|
|
484
|
+
: 'Ask an organization admin to switch the project to Global first.'));
|
|
485
|
+
}
|
|
478
486
|
return { content: [{ type: 'text', text: `Filter options for ${resolved.project.name}:\n\n${blocks.join('\n\n')}` }] };
|
|
479
487
|
}
|
|
480
488
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowrelay/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|