UNPKG

@follow-app/client-sdk

Version:

TypeScript client SDK for Follow RSS Server API

104 lines (89 loc) 2.11 kB
import type { StructuredSuccessResponse } from "../../types" // Transport types export type McpTransportType = "streamable-http" | "sse" // Basic schemas from server export interface McpConnectionInfo { id: string name: string transportType: McpTransportType url?: string isConnected: boolean enabled: boolean lastError?: string toolCount: number resourceCount: number promptCount: number createdAt: string lastUsed: string | null } export interface McpTool { name: string title?: string description?: string inputSchema: { type: "object" properties?: Record<string, any> required?: string[] } outputSchema?: { type: "object" properties?: Record<string, any> required?: string[] } annotations?: { title?: string readOnlyHint?: boolean openWorldHint?: boolean } } export interface RefreshResult { success: boolean error?: string } // Request types export interface CreateConnectionRequest { name: string transportType: McpTransportType url: string headers?: Record<string, string> } export interface UpdateConnectionRequest { name?: string transportType?: McpTransportType url?: string headers?: Record<string, string> enabled?: boolean connectionId: string } export type UpdateConnectionResponse = { /** * If code is 1, the authorizationUrl is required */ code: 0 | 1 authorizationUrl?: string connectionId: string } export interface ConnectionParams { connectionId: string } export interface RefreshToolsRequest { connectionIds?: string[] } // Response types export type CreateConnectionResponse = { /** * 0: success, 1: need oauth */ code: 0 | 1 authorizationUrl?: string connectionId: string } export type GetConnectionsResponse = StructuredSuccessResponse<McpConnectionInfo[]> export type DeleteConnectionResponse = StructuredSuccessResponse export type GetToolsResponse = StructuredSuccessResponse<McpTool[]> export type RefreshToolsResponse = StructuredSuccessResponse<{ total: number successful: number failed: number results: RefreshResult[] }>