diff --git a/src/cli/generate/definition.ts b/src/cli/generate/definition.ts index 7aba22a..7c4d485 100644 --- a/src/cli/generate/definition.ts +++ b/src/cli/generate/definition.ts @@ -4,7 +4,7 @@ import type { CliArtifactMetadata } from '../../cli-metadata.js'; import { type HttpCommand, loadServerDefinitions, type ServerDefinition, type StdioCommand } from '../../config.js'; import type { ServerToolInfo } from '../../runtime.js'; import { createRuntime } from '../../runtime.js'; -import { extractHttpServerTarget, normalizeHttpUrl, normalizeHttpUrlCandidate } from '../http-utils.js'; +import { extractHttpServerTarget, normalizeHttpUrl } from '../http-utils.js'; export interface ResolvedServer { definition: ServerDefinition; @@ -259,15 +259,6 @@ function toCommandSpec( }; return httpCommand; } - const normalizedHttp = normalizeHttpUrlCandidate(command); - if (normalizedHttp) { - const httpCommand: HttpCommand = { - kind: 'http', - url: new URL(normalizedHttp), - ...(extra?.headers ? { headers: extra.headers } : {}), - }; - return httpCommand; - } const stdio: StdioCommand = { kind: 'stdio', command, diff --git a/tests/generate-definition.test.ts b/tests/generate-definition.test.ts index c33cfb4..44041eb 100644 --- a/tests/generate-definition.test.ts +++ b/tests/generate-definition.test.ts @@ -15,12 +15,11 @@ describe('resolveServerDefinition HTTP selectors', () => { expect(name).toBe('shadcn'); }); - it('normalizes raw HTTPS paths without scheme when building inline definitions', async () => { + it('treats raw HTTPS paths without scheme as stdio commands in inline definitions', async () => { const inline = JSON.stringify({ name: 'context7-inline', command: 'mcp.context7.com/mcp' }); const { definition, name } = await resolveServerDefinition(inline); expect(name).toBe('context7-inline'); - expect(definition.command.kind).toBe('http'); - expect((definition.command as { url: URL }).url.protocol).toBe('https:'); - expect((definition.command as { url: URL }).url.hostname).toBe('mcp.context7.com'); + expect(definition.command.kind).toBe('stdio'); + expect((definition.command as { command: string }).command).toBe('mcp.context7.com/mcp'); }); });