imcp 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -117,29 +117,29 @@ export class OnboardProcessor {
|
|
|
117
117
|
// Create a mutable copy of mcpServers to update schema paths
|
|
118
118
|
const updatedMcpServers = [];
|
|
119
119
|
for (const server of config.mcpServers) {
|
|
120
|
-
if (!serverList.includes(server.name))
|
|
121
|
-
continue;
|
|
122
120
|
let updatedServer = { ...server }; // Shallow copy server config
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
if (serverList.includes(server.name)) {
|
|
122
|
+
if (updatedServer.schemas && typeof updatedServer.schemas === 'string' && updatedServer.schemas.trim() !== '') {
|
|
123
|
+
const originalSchemaPath = updatedServer.schemas;
|
|
124
|
+
const serverName = updatedServer.name;
|
|
125
|
+
const newSchemaFileName = `${serverName}.json`;
|
|
126
|
+
// Schemas are now directly under categorySchemasPath
|
|
127
|
+
const newSchemaPathInRepo = path.join(categorySchemasPath, newSchemaFileName);
|
|
128
|
+
try {
|
|
129
|
+
// Read content from the original schema path
|
|
130
|
+
const schemaContent = await fs.readFile(originalSchemaPath, 'utf-8');
|
|
131
|
+
// Write content to the new schema file in the repo
|
|
132
|
+
await fs.writeFile(newSchemaPathInRepo, schemaContent);
|
|
133
|
+
Logger.debug(`[${onboardingId}] Copied schema for server '${serverName}' from '${originalSchemaPath}' to '${newSchemaPathInRepo}'`);
|
|
134
|
+
// Update the schemas property to the new filename, as per instruction "rename schemas in McpServer as serverName].json"
|
|
135
|
+
updatedServer.schemas = newSchemaFileName;
|
|
136
|
+
}
|
|
137
|
+
catch (schemaError) {
|
|
138
|
+
const errorMsg = `Error processing schema for server '${serverName}' (source: ${originalSchemaPath}): ${schemaError instanceof Error ? schemaError.message : String(schemaError)}`;
|
|
139
|
+
Logger.error(`[${onboardingId}] ${errorMsg}`);
|
|
140
|
+
// Propagate the error to fail the onboarding step
|
|
141
|
+
throw new Error(errorMsg);
|
|
142
|
+
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
updatedMcpServers.push(updatedServer);
|
package/package.json
CHANGED
|
@@ -127,32 +127,34 @@ export class OnboardProcessor {
|
|
|
127
127
|
// Create a mutable copy of mcpServers to update schema paths
|
|
128
128
|
const updatedMcpServers = [];
|
|
129
129
|
for (const server of config.mcpServers) {
|
|
130
|
-
if (!serverList.includes(server.name)) continue;
|
|
131
130
|
let updatedServer = { ...server }; // Shallow copy server config
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
if (serverList.includes(server.name)) {
|
|
132
|
+
if (updatedServer.schemas && typeof updatedServer.schemas === 'string' && updatedServer.schemas.trim() !== '') {
|
|
133
|
+
const originalSchemaPath = updatedServer.schemas;
|
|
134
|
+
const serverName = updatedServer.name;
|
|
135
|
+
const newSchemaFileName = `${serverName}.json`;
|
|
136
|
+
|
|
137
|
+
// Schemas are now directly under categorySchemasPath
|
|
138
|
+
const newSchemaPathInRepo = path.join(categorySchemasPath, newSchemaFileName);
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
// Read content from the original schema path
|
|
142
|
+
const schemaContent = await fs.readFile(originalSchemaPath, 'utf-8');
|
|
143
|
+
// Write content to the new schema file in the repo
|
|
144
|
+
await fs.writeFile(newSchemaPathInRepo, schemaContent);
|
|
145
|
+
Logger.debug(`[${onboardingId}] Copied schema for server '${serverName}' from '${originalSchemaPath}' to '${newSchemaPathInRepo}'`);
|
|
146
|
+
|
|
147
|
+
// Update the schemas property to the new filename, as per instruction "rename schemas in McpServer as serverName].json"
|
|
148
|
+
updatedServer.schemas = newSchemaFileName;
|
|
149
|
+
} catch (schemaError) {
|
|
150
|
+
const errorMsg = `Error processing schema for server '${serverName}' (source: ${originalSchemaPath}): ${schemaError instanceof Error ? schemaError.message : String(schemaError)}`;
|
|
151
|
+
Logger.error(`[${onboardingId}] ${errorMsg}`);
|
|
152
|
+
// Propagate the error to fail the onboarding step
|
|
153
|
+
throw new Error(errorMsg);
|
|
154
|
+
}
|
|
154
155
|
}
|
|
155
156
|
}
|
|
157
|
+
|
|
156
158
|
updatedMcpServers.push(updatedServer);
|
|
157
159
|
}
|
|
158
160
|
|