CoolFace
Apppublic

LiquidAI/LFM2-MCP

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
39likes
mcp.ts59 linesDownload Raw Back to types
1import type { Tool as MCPTool } from "@modelcontextprotocol/sdk/types.js";2 3export interface MCPServerConfig {4  id: string;5  name: string;6  url: string;7  enabled: boolean;8  transport: "sse" | "streamable-http";9  auth?: {10    type: "bearer" | "basic" | "oauth";11    token?: string;12    username?: string;13    password?: string;14  };15}16 17export interface MCPServerConnection {18  config: MCPServerConfig;19  isConnected: boolean;20  tools: MCPTool[];21  lastError?: string;22  lastConnected?: Date;23}24 25// Extended Tool interface to support both local and MCP tools26export interface ExtendedTool {27  id: number | string;28  name: string;29  enabled: boolean;30  isCollapsed?: boolean;31 32  // Local tool properties33  code?: string;34  renderer?: string;35 36  // MCP tool properties37  mcpServerId?: string;38  mcpTool?: MCPTool;39  isRemote?: boolean;40}41 42// MCP Tool execution result43export interface MCPToolResult {44  content: Array<{45    type: string;46    text?: string;47    data?: unknown;48    mimeType?: string;49  }>;50  isError?: boolean;51}52 53// MCP Client state54export interface MCPClientState {55  servers: Record<string, MCPServerConnection>;56  isLoading: boolean;57  error?: string;58}59