Skip to content

fix: support npx startup for codex package#14

Merged
benvinegar merged 1 commit intomainfrom
fix/codex-npx-startup
Mar 9, 2026
Merged

fix: support npx startup for codex package#14
benvinegar merged 1 commit intomainfrom
fix/codex-npx-startup

Conversation

@benvinegar
Copy link
Member

Summary

  • fix Codex MCP server startup when launched via npx bin/symlink path
  • bump Codex package version to 0.1.1
  • update Codex README version-pinned examples to 0.1.1

Problem

When installed via npm and launched through:

codex mcp add glance -- npx -y -p @modemdev/glance-codex glance-codex

the server could exit before MCP initialize because main-module detection compared import.meta.url to process.argv[1] without resolving symlinks.

Fix

codex/servers/glance-mcp.js

  • switched main-module detection to resolve real paths with realpathSync(fileURLToPath(import.meta.url)) and realpathSync(process.argv[1]) before comparison

This keeps direct node .../glance-mcp.js behavior and also works when the entrypoint is an npx-installed bin symlink.

Validation

  • npm test
  • npm exec -- tsc --noEmit
  • local Codex smoke test with codex exec calling MCP tool glance successfully

@benvinegar benvinegar merged commit 79ce420 into main Mar 9, 2026
4 checks passed
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.

1 participant