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:
1 parent
1042f2136b
commit
f19bf10ef3
35 files changed
+4743
-429
No files matched your search
@@ -36,6 +36,67 @@ export function runMigrations(db: Database.Database): void {
|
||||
console.log("✅ Migração 001_initial_schema aplicada");
|
||||
}
|
||||
|
||||
// Migration 002: Campos de instalação real MCP
|
||||
if (!appliedNames.has("002_mcp_installation_fields")) {
|
||||
console.log("📋 Aplicando migração: 002_mcp_installation_fields");
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN status TEXT DEFAULT 'pending';
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN status_message TEXT;
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN environment_path TEXT;
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN executable_command TEXT;
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN validation_result TEXT;
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
try {
|
||||
db.exec(`
|
||||
ALTER TABLE mcp_installations ADD COLUMN install_logs TEXT;
|
||||
`);
|
||||
} catch (e) {
|
||||
// Coluna já existe, ignorar
|
||||
}
|
||||
|
||||
// Registrar migração
|
||||
db.prepare("INSERT INTO _migrations (name, applied_at) VALUES (?, ?)").run(
|
||||
"002_mcp_installation_fields",
|
||||
Date.now()
|
||||
);
|
||||
|
||||
console.log("✅ Migração 002_mcp_installation_fields aplicada");
|
||||
}
|
||||
|
||||
// Inicializar extensão vetorial se disponível
|
||||
try {
|
||||
const extPath = path.join(
|
||||
|
||||
Reference in new issue
Block a user