UNPKG

@grebyn/toolflow-mcp-server

Version:

MCP server for managing other MCP servers - discover, install, organize into bundles, and automate with workflows. Uses StreamableHTTP transport with dual OAuth/API key authentication.

58 lines 1.75 kB
/** * Shared types for MCP tools */ /** * User context provided to all MCP tools * Contains authenticated user information for user-aware operations */ export interface UserContext { /** Unique user ID from Supabase auth */ userId: string; /** User's organization ID */ organizationId?: string; /** User's email address (optional, from JWT payload) */ email?: string; /** Session ID for tracking and logging */ sessionId?: string; /** JWT token ID for session validation */ tokenJti?: string; /** Original access token (for making authenticated API calls if needed) */ token?: string; /** API key for MCP server authentication (alternative to OAuth token) */ apiKey?: string; } /** * Base interface for all MCP tools * All tools must implement this interface with user context support */ export interface MCPTool<TArgs = any, TResult = any> { /** Tool name (must be unique) */ name: string; /** Human-readable description of what the tool does */ description: string; /** JSON Schema for input validation */ inputSchema: { type: 'object'; properties: Record<string, any>; required?: string[]; }; /** * Execute the tool with user context * @param args - Tool arguments (validated against inputSchema) * @param context - Authenticated user context * @returns Tool execution result */ execute(args: TArgs, context: UserContext): Promise<TResult>; } /** * Standard MCP tool result format */ export interface ToolResult { content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; }>; } //# sourceMappingURL=types.d.ts.map