Skip to content
Merged
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
6 changes: 3 additions & 3 deletions codex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ codex mcp add glance -- npx -y @modemdev/glance-codex
Optional: pin a specific version:

```bash
codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.0
codex mcp add glance -- npx -y @modemdev/glance-codex@0.1.1
```

Local development / manual install:
Expand Down Expand Up @@ -71,8 +71,8 @@ Prerequisite: configure `NPM_TOKEN` in the `glance-agent-plugins` repository wit
3. Create and push a matching tag:

```bash
git tag codex-v0.1.0
git push origin codex-v0.1.0
git tag codex-v0.1.1
git push origin codex-v0.1.1
```

The `Release codex package` workflow validates tag/version alignment, checks for already-published versions, runs `npm pack --dry-run`, and publishes with npm provenance.
Expand Down
2 changes: 1 addition & 1 deletion codex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modemdev/glance-codex",
"version": "0.1.0",
"version": "0.1.1",
"description": "glance.sh MCP server package for Codex",
"license": "MIT",
"type": "module",
Expand Down
11 changes: 9 additions & 2 deletions codex/servers/glance-mcp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

import { pathToFileURL } from "node:url"
import { realpathSync } from "node:fs"
import { fileURLToPath } from "node:url"

const DEFAULT_BASE_URL = process.env.GLANCE_BASE_URL?.trim() || "https://glance.sh"

Expand Down Expand Up @@ -740,7 +741,13 @@ function isMainModule() {
return false
}

return import.meta.url === pathToFileURL(process.argv[1]).href
try {
const invokedPath = realpathSync(process.argv[1])
const currentPath = realpathSync(fileURLToPath(import.meta.url))
return invokedPath === currentPath
} catch {
return false
}
}

if (isMainModule()) {
Expand Down