mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-26 07:24:20 +00:00
feat: code by huntun
This commit is contained in:
@@ -33,6 +33,9 @@ import {
|
||||
ApiRespProviderEmbeddingModel,
|
||||
EmbeddingModel,
|
||||
ApiRespPluginSystemStatus,
|
||||
ApiRespMCPServers,
|
||||
ApiRespMCPServer,
|
||||
MCPServerConfig,
|
||||
} from '@/app/infra/entities/api';
|
||||
import { GetBotLogsRequest } from '@/app/infra/http/requestParam/bots/GetBotLogsRequest';
|
||||
import { GetBotLogsResponse } from '@/app/infra/http/requestParam/bots/GetBotLogsResponse';
|
||||
@@ -488,6 +491,67 @@ export class BackendClient extends BaseHttpClient {
|
||||
return this.post(`/api/v1/plugins/${author}/${name}/upgrade`);
|
||||
}
|
||||
|
||||
// ============ MCP API ============
|
||||
public getMCPServers(): Promise<ApiRespMCPServers> {
|
||||
return this.get('/api/v1/mcp/servers');
|
||||
}
|
||||
|
||||
public getMCPServer(serverName: string): Promise<ApiRespMCPServer> {
|
||||
return this.get(`/api/v1/mcp/servers/${serverName}`);
|
||||
}
|
||||
|
||||
public createMCPServer(
|
||||
server: MCPServerConfig,
|
||||
): Promise<AsyncTaskCreatedResp> {
|
||||
return this.post('/api/v1/mcp/servers', server);
|
||||
}
|
||||
|
||||
public updateMCPServer(
|
||||
serverName: string,
|
||||
server: Partial<MCPServerConfig>,
|
||||
): Promise<AsyncTaskCreatedResp> {
|
||||
return this.put(`/api/v1/mcp/servers/${serverName}`, server);
|
||||
}
|
||||
|
||||
public deleteMCPServer(serverName: string): Promise<AsyncTaskCreatedResp> {
|
||||
return this.delete(`/api/v1/mcp/servers/${serverName}`);
|
||||
}
|
||||
|
||||
public toggleMCPServer(
|
||||
serverName: string,
|
||||
target_enabled: boolean,
|
||||
): Promise<AsyncTaskCreatedResp> {
|
||||
return this.put(`/api/v1/mcp/servers/${serverName}/toggle`, {
|
||||
target_enabled,
|
||||
});
|
||||
}
|
||||
|
||||
public testMCPServer(serverName: string): Promise<AsyncTaskCreatedResp> {
|
||||
return this.post(`/api/v1/mcp/servers/${serverName}/test`);
|
||||
}
|
||||
|
||||
// public getMCPMarketServers(
|
||||
// page: number,
|
||||
// page_size: number,
|
||||
// query: string,
|
||||
// sort_by: string = 'stars',
|
||||
// sort_order: string = 'DESC',
|
||||
// ): Promise<MCPMarketResponse> {
|
||||
// return this.post(`/api/v1/market/mcp`, {
|
||||
// page,
|
||||
// page_size,
|
||||
// query,
|
||||
// sort_by,
|
||||
// sort_order,
|
||||
// });
|
||||
// }
|
||||
|
||||
public installMCPServerFromGithub(
|
||||
source: string,
|
||||
): Promise<AsyncTaskCreatedResp> {
|
||||
return this.post('/api/v1/mcp/install/github', { source });
|
||||
}
|
||||
|
||||
// ============ System API ============
|
||||
public getSystemInfo(): Promise<ApiRespSystemInfo> {
|
||||
return this.get('/api/v1/system/info');
|
||||
|
||||
Reference in New Issue
Block a user