Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changesets/1794833246-a4ee045c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
id: 1794833246-a4ee045c
features:
- mcpServer
targets:
- typescriptv2
type: fix
bump: patch
description: compile the MCP server when the OpenAPI document defines no servers
author: AshGodfrey
date: "2026-11-16"
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const startCommand = buildCommand({
{{- end}}
parse: (value) => new URL(value).toString(),
},
{{- if $globalSDK.Servers}}{{if $serverMap}}
{{- if $hasServers}}{{if $serverMap}}
{{- addImport "../../../lib/config.js" "ServerList" }}
server: {
kind: "enum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface StartCommandFlags {
{{- else }}
readonly "server-url": string;
{{- end}}
{{- if $globalSDK.Servers}}{{if $serverMap}}
{{- if $hasServers}}{{if $serverMap}}
{{- addImport "../../../lib/config.js" "SDKOptions" }}
readonly server?: SDKOptions["server"];
{{- else}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $globalSDK := .Global.AST.MainSDK -}}
{{- $globalSecurity := $globalSDK.Security }}
{{- $serverMap := (and $globalSDK.Servers $globalSDK.Servers.ServerMap) -}}
{{- $hasServers := (and $globalSDK.Servers $globalSDK.Servers.HasAbsoluteURL) -}}
{{ if .Local.Factory }}createMCPServerFactory{{ else }}createMCPServer{{ end }}({
logger,
allowedTools: flags.tool,
Expand All @@ -21,7 +22,7 @@
{{- end}}
{{- end}}{{/* if ne $globalSDK.Globals nil */}}
serverURL: flags["server-url"],
{{- if $globalSDK.Servers}}
{{- if $hasServers}}
{{- if $serverMap}}
server: flags.server,
{{- else}}
Expand Down
4 changes: 2 additions & 2 deletions templates/templates/typescriptv2/mcp-server/server.ts.stmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function createMCPServer(deps: {
{{ $fieldName }}?: SDKOptions["{{$fieldName}}"] | undefined;
{{- end}}
{{- end}}{{/* if (ne $globalSDK.Globals nil) */}}
{{- if $globalSDK.Servers}}{{if $serverMap}}
{{- if $hasServers}}{{if $serverMap}}
{{- addImport "../lib/config.js" "SDKOptions" }}
server?: SDKOptions["server"] | undefined;
{{- else}}
Expand Down Expand Up @@ -77,7 +77,7 @@ export function createMCPServer(deps: {
{{- end}}
{{- end}}{{/* if (ne $globalSDK.Globals nil) */}}
serverURL: deps.serverURL,
{{- if $globalSDK.Servers}}{{if $serverMap}}
{{- if $hasServers}}{{if $serverMap}}
server: deps.server,
{{- else}}
serverIdx: deps.serverIdx,
Expand Down
Loading