Skip to content

Commit 80d6a89

Browse files
authored
Merge pull request anomalyco#971 from Lidang-Jiang/fix/codex-mcp-startup-timeout
fix(codex): add startup_timeout_sec to MCP servers to prevent first-run timeouts
2 parents f077975 + 78c98dd commit 80d6a89

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎.codex/config.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,30 @@ notify = [
3838
[mcp_servers.github]
3939
command = "npx"
4040
args = ["-y", "@modelcontextprotocol/server-github"]
41+
startup_timeout_sec = 30
4142

4243
[mcp_servers.context7]
4344
command = "npx"
4445
args = ["-y", "@upstash/context7-mcp@latest"]
46+
startup_timeout_sec = 30
4547

4648
[mcp_servers.exa]
4749
url = "https://mcp.exa.ai/mcp"
4850

4951
[mcp_servers.memory]
5052
command = "npx"
5153
args = ["-y", "@modelcontextprotocol/server-memory"]
54+
startup_timeout_sec = 30
5255

5356
[mcp_servers.playwright]
5457
command = "npx"
5558
args = ["-y", "@playwright/mcp@latest", "--extension"]
59+
startup_timeout_sec = 30
5660

5761
[mcp_servers.sequential-thinking]
5862
command = "npx"
5963
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
64+
startup_timeout_sec = 30
6065

6166
# Additional MCP servers (uncomment as needed):
6267
# [mcp_servers.supabase]

‎scripts/codex/merge-mcp-config.js‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,23 @@ function dlxServer(name, pkg, extraFields, extraToml) {
8383
}
8484

8585
/** Each entry: key = section name under mcp_servers, value = { toml, fields } */
86+
const DEFAULT_MCP_STARTUP_TIMEOUT_SEC = 30;
87+
const DEFAULT_MCP_STARTUP_TIMEOUT_TOML = `startup_timeout_sec = ${DEFAULT_MCP_STARTUP_TIMEOUT_SEC}`;
88+
8689
const ECC_SERVERS = {
8790
supabase: dlxServer('supabase', '@supabase/mcp-server-supabase@latest', { startup_timeout_sec: 20.0, tool_timeout_sec: 120.0 }, 'startup_timeout_sec = 20.0\ntool_timeout_sec = 120.0'),
88-
playwright: dlxServer('playwright', '@playwright/mcp@latest'),
89-
'context7-mcp': dlxServer('context7-mcp', '@upstash/context7-mcp'),
91+
playwright: dlxServer('playwright', '@playwright/mcp@latest', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML),
92+
'context7-mcp': dlxServer('context7-mcp', '@upstash/context7-mcp@latest', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML),
9093
exa: {
9194
fields: { url: 'https://mcp.exa.ai/mcp' },
9295
toml: `[mcp_servers.exa]\nurl = "https://mcp.exa.ai/mcp"`
9396
},
9497
github: {
95-
fields: { command: 'bash', args: ['-lc', GH_BOOTSTRAP] },
96-
toml: `[mcp_servers.github]\ncommand = "bash"\nargs = ["-lc", ${JSON.stringify(GH_BOOTSTRAP)}]`
98+
fields: { command: 'bash', args: ['-lc', GH_BOOTSTRAP], startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC },
99+
toml: `[mcp_servers.github]\ncommand = "bash"\nargs = ["-lc", ${JSON.stringify(GH_BOOTSTRAP)}]\n${DEFAULT_MCP_STARTUP_TIMEOUT_TOML}`
97100
},
98-
memory: dlxServer('memory', '@modelcontextprotocol/server-memory'),
99-
'sequential-thinking': dlxServer('sequential-thinking', '@modelcontextprotocol/server-sequential-thinking')
101+
memory: dlxServer('memory', '@modelcontextprotocol/server-memory', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML),
102+
'sequential-thinking': dlxServer('sequential-thinking', '@modelcontextprotocol/server-sequential-thinking', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML)
100103
};
101104

102105
// Append --features arg for supabase after dlxServer builds the base

0 commit comments

Comments
 (0)