feat(mcp): implement mcp server management with CRUD operations
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// export enum McpServerType {
|
||||
// Sse = 'sse',
|
||||
// StreamableHttp = 'streamable-http',
|
||||
// }
|
||||
const MCP_SERVER_TYPE = {
|
||||
Sse: 'sse',
|
||||
StreamableHttp: 'streamable-http',
|
||||
}
|
||||
export type McpServerType = (typeof MCP_SERVER_TYPE)[keyof typeof MCP_SERVER_TYPE];
|
||||
|
||||
export interface IMcpServerVariable {
|
||||
key: string;
|
||||
@@ -12,7 +13,7 @@ export interface IMcpServerInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
// server_type: McpServerType;
|
||||
server_type: McpServerType;
|
||||
description?: string;
|
||||
variables?: IMcpServerVariable[];
|
||||
headers: Map<string, string>;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
export interface IMcpServer {
|
||||
create_date: string;
|
||||
description: null;
|
||||
description?: string;
|
||||
id: string;
|
||||
name: string;
|
||||
server_type: string;
|
||||
update_date: string;
|
||||
url: string;
|
||||
variables: Record<string, any> & { tools?: IMCPToolObject };
|
||||
headers: Record<string, any>;
|
||||
}
|
||||
|
||||
export type IMCPToolObject = Record<string, Omit<IMCPTool, 'name'>>;
|
||||
export type IMCPToolObject = Record<string, Partial<IMCPTool>>;
|
||||
|
||||
export type IMCPToolRecord = Record<string, IMCPTool>;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// import { IExportedMcpServer } from '@/interfaces/database/mcp';
|
||||
import { type IExportedMcpServer } from '@/interfaces/database/mcp';
|
||||
|
||||
export interface ITestMcpRequestBody {
|
||||
server_type: string;
|
||||
@@ -6,11 +6,19 @@ export interface ITestMcpRequestBody {
|
||||
headers?: Record<string, any>;
|
||||
variables?: Record<string, any>;
|
||||
timeout?: number;
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface IImportMcpServersRequestBody {
|
||||
// mcpServers: Record<
|
||||
// string,
|
||||
// Pick<IExportedMcpServer, 'type' | 'url' | 'authorization_token'>
|
||||
// >;
|
||||
mcpServers: Record<
|
||||
string,
|
||||
Pick<IExportedMcpServer, 'type' | 'url' | 'authorization_token'>
|
||||
>;
|
||||
}
|
||||
|
||||
export interface ICreateMcpServerRequestBody {
|
||||
name?: string;
|
||||
server_type: string;
|
||||
url: string;
|
||||
headers?: Record<string, any>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user