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 (updatedServer.schemas && typeof updatedServer.schemas === 'string' && updatedServer.schemas.trim() !== '') {
124
- const originalSchemaPath = updatedServer.schemas;
125
- const serverName = updatedServer.name;
126
- const newSchemaFileName = `${serverName}.json`;
127
- // Schemas are now directly under categorySchemasPath
128
- const newSchemaPathInRepo = path.join(categorySchemasPath, newSchemaFileName);
129
- try {
130
- // Read content from the original schema path
131
- const schemaContent = await fs.readFile(originalSchemaPath, 'utf-8');
132
- // Write content to the new schema file in the repo
133
- await fs.writeFile(newSchemaPathInRepo, schemaContent);
134
- Logger.debug(`[${onboardingId}] Copied schema for server '${serverName}' from '${originalSchemaPath}' to '${newSchemaPathInRepo}'`);
135
- // Update the schemas property to the new filename, as per instruction "rename schemas in McpServer as serverName].json"
136
- updatedServer.schemas = newSchemaFileName;
137
- }
138
- catch (schemaError) {
139
- const errorMsg = `Error processing schema for server '${serverName}' (source: ${originalSchemaPath}): ${schemaError instanceof Error ? schemaError.message : String(schemaError)}`;
140
- Logger.error(`[${onboardingId}] ${errorMsg}`);
141
- // Propagate the error to fail the onboarding step
142
- throw new Error(errorMsg);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imcp",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Node.js SDK for Model Context Protocol (MCP)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 (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);
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