feat(mcp): enhance MCP installation with status tracking and custom configs

- Add /mcp-servers/ to .gitignore for MCP server installations
- Extend mcp_installations table with status, logs, and validation fields
- Refactor MCP install route to support custom configs, enable logs, and async installation
- Improve MCPSyncService with promise-based syncing to prevent concurrent operations

This update improves MCP management by adding robust installation tracking, custom configuration support, and better error handling for a more reliable user experience.
This commit is contained in:
Evandro Fonseca Junior committed 2025-10-28 21:59:00 -03:00
1 parent 1042f2136b
commit f19bf10ef3
35 files changed
+4743 -429

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
/**
* Tipos e interfaces para o sistema de instalação MCP
*/
export type PackageRegistry = "npm" | "pypi" | "cargo" | "other" | null;
export enum MCPInstallationStatus {
PENDING = "pending",
CHECKING_DEPENDENCIES = "checking_dependencies",
DOWNLOADING = "downloading",
INSTALLING = "installing",
TESTING = "testing",
READY = "ready",
FAILED = "failed",
}
export interface InstallationProgress {
status: MCPInstallationStatus;
message: string;
percentage: number;
logs?: string[];
}
export interface MCPEnvironment {
type: "npm" | "python" | "rust";
path: string;
executable: string;
args?: string[];
env?: Record<string, string>;
}
export interface ValidationResult {
success: boolean;
protocol: "mcp" | "unknown";
tools: Array<{
name: string;
description?: string;
inputSchema?: any;
}>;
resources?: Array<{
uri: string;
name: string;
description?: string;
}>;
error?: string;
capabilities?: any;
}
export interface SystemDependencies {
node: boolean;
npm: boolean;
python: boolean;
pip: boolean;
cargo: boolean;
git: boolean;
}
export interface InstallationConfig {
mcpId: string;
packageName: string;
packageRegistry: PackageRegistry;
repositoryUrl?: string;
config: any;
enableLogs: boolean;
}
+16
View File
@@ -1,5 +1,8 @@
export interface MCPProvider {
id: string; // formato: "owner/repo"
originalId?: string; // ID original do cache antes de transformar para owner/repo
owner?: string; // Owner do repositório
repo?: string; // Nome do repositório
name: string; // mapeado de content_name
author: string; // mapeado de publisher_id
description: string;
@@ -97,6 +100,19 @@ export interface PulseMCPResponse {
total_count: number;
}
export interface MCPTestResult {
success: boolean;
message: string;
responseTime?: number; // em ms
serverVersion?: string;
availableTools?: number;
error?: string;
}
export interface MCPTestRequest {
mcpId: string;
}
export interface MCPServerMetadata {
name: string;
url: string;