MCPcopy
hub / github.com/codeaashu/claude-code / applyPluginMcpDiff

Function applyPluginMcpDiff

src/cli/print.ts:1792–1821  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1790 // Nested: needs closure access to sdkMcpConfigs, applyMcpServerChanges,
1791 // updateSdkMcp.
1792 async function applyPluginMcpDiff(): Promise<void> {
1793 const { servers: newConfigs } = await getAllMcpConfigs()
1794 const supportedConfigs: Record<string, McpServerConfigForProcessTransport> =
1795 {}
1796 for (const [name, config] of Object.entries(newConfigs)) {
1797 const type = config.type
1798 if (
1799 type === undefined ||
1800 type === 'stdio' ||
1801 type === 'sse' ||
1802 type === 'http' ||
1803 type === 'sdk'
1804 ) {
1805 supportedConfigs[name] = config
1806 }
1807 }
1808 for (const [name, config] of Object.entries(sdkMcpConfigs)) {
1809 if (config.type === 'sdk' && !(name in supportedConfigs)) {
1810 supportedConfigs[name] = config
1811 }
1812 }
1813 const { response, sdkServersChanged } =
1814 await applyMcpServerChanges(supportedConfigs)
1815 if (sdkServersChanged) {
1816 void updateSdkMcp()
1817 }
1818 logForDebugging(
1819 `Headless MCP refresh: added=${response.added.length}, removed=${response.removed.length}`,
1820 )
1821 }
1822
1823 // Subscribe to skill changes for hot reloading
1824 const unsubscribeSkillChanges = skillChangeDetector.subscribe(() => {

Callers 2

runHeadlessStreamingFunction · 0.85

Calls 5

getAllMcpConfigsFunction · 0.85
applyMcpServerChangesFunction · 0.85
updateSdkMcpFunction · 0.85
logForDebuggingFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected