Skip to content

Conversation

@kv-chiu
Copy link
Contributor

@kv-chiu kv-chiu commented Oct 15, 2025

Summary

This PR supplements the fix for installing context7 in the Windows Codex.

Root Cause

Codex MCP clients clear the environment and only pass a small whitelist on Windows, which often excludes APPDATA and SystemRoot. This breaks npx/npm resolution and causes timeouts.

Refer to openai/codex#4180

/// codex 0.46.0
/// codex-rs/mcp-client/src/mcp_client.rs:435
#[cfg(windows)]
const DEFAULT_ENV_VARS: &[&str] = &[
    // TODO: More research is necessary to curate this list.
    "PATH",
    "PATHEXT",
    "USERNAME",
    "USERDOMAIN",
    "USERPROFILE",
    "TEMP",
    "TMP",
];

/// Missing APPDATA, resulting “request timed out” in npm/npx based servers

Fixes #575 #658

@enesgules
Copy link
Collaborator

Wow, it's crazy how big this section got
Could you use details and summary tags for the errors so that when most users who don't encounter errors don't see the long error related texts immediately unless they search for it

@kv-chiu
Copy link
Contributor Author

kv-chiu commented Oct 20, 2025

Wow, it's crazy how big this section got Could you use details and summary tags for the errors so that when most users who don't encounter errors don't see the long error related texts immediately unless they search for it

Ok

@kv-chiu
Copy link
Contributor Author

kv-chiu commented Oct 20, 2025

Wow, it's crazy how big this section got Could you use details and summary tags for the errors so that when most users who don't encounter errors don't see the long error related texts immediately unless they search for it

I tried using details and summary, but the nested structure wasn't very readable. So I kept the core corrective approach and simplified potentially repetitive content, and clearly distinguished from the default configuration.

@kv-chiu
Copy link
Contributor Author

kv-chiu commented Oct 20, 2025

before:
image

after:
image

Copy link
Collaborator

@enesgules enesgules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TYSM!

@enesgules enesgules merged commit ebcbeaa into upstash:master Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex CLI on Windows 11: MCP server (Context7) fails with “request timed out” despite fast local startup

2 participants