fix: flag incomplete mcp server transports (#4275)

This commit is contained in:
Neil
2026-05-31 10:39:17 -07:00
committed by GitHub
parent fdddb39115
commit 643263944d
2 changed files with 47 additions and 0 deletions
+27
View File
@@ -92,6 +92,33 @@ describe('mcp-config', () => {
])
})
it('marks declared transports without their target as invalid', () => {
const result = inspectMcpConfigContent(
workspaceCandidate,
JSON.stringify({
mcpServers: {
remoteMissingUrl: { type: 'http' },
localMissingCommand: { type: 'local' }
}
})
)
expect(result.servers).toEqual([
{
name: 'remoteMissingUrl',
transport: 'http',
status: 'invalid',
issue: 'Missing URL.'
},
{
name: 'localMissingCommand',
transport: 'stdio',
status: 'invalid',
issue: 'Missing command.'
}
])
})
it('masks env values that look sensitive by key or value', () => {
expect(
maskMcpEnv({
+20
View File
@@ -210,6 +210,26 @@ function summarizeMcpServer(name: string, entry: unknown): McpServerSummary {
}
}
if (transport === 'http' && !url) {
return {
name,
transport,
status: 'invalid',
env,
issue: 'Missing URL.'
}
}
if (transport === 'stdio' && !command) {
return {
name,
transport,
status: 'invalid',
env,
issue: 'Missing command.'
}
}
return {
name,
transport,