MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / readMcpServersFromObject

Function readMcpServersFromObject

src/commands/migrate.ts:232–244  ·  view source on GitHub ↗

Same as `readMcpServers` but takes a pre-parsed object.

(
  obj: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

230
231/** Same as `readMcpServers` but takes a pre-parsed object. */
232function readMcpServersFromObject(
233 obj: Record<string, unknown>,
234): Record<string, McpServerConfig> {
235 const block = obj.mcpServers;
236 if (!isPlainObject(block)) return {};
237 const out: Record<string, McpServerConfig> = {};
238 for (const [name, raw] of Object.entries(block)) {
239 if (!/^[A-Za-z0-9_-]+$/.test(name)) continue;
240 const config = normalizeExternalServer(raw);
241 if (config) out[name] = config;
242 }
243 return out;
244}
245
246/** Discover every available migration source on the current machine. */
247export function discoverSources(): MigrationSource[] {

Callers 2

Calls 2

normalizeExternalServerFunction · 0.85
isPlainObjectFunction · 0.70

Tested by

no test coverage detected