Commit dcf65a6
authored
fix: detect bin wrapper entry point in isMainModule check (#179)
Fixes isMainModule detection when MCP server is invoked via bin/mcp-wordpress.js wrapper (e.g. Cursor IDE, npx). process.argv[1] points to the bin wrapper rather than dist/index.js, causing main() to never be called.
- Add mcp-wordpress.js to the isMainModule check (POSIX + Windows paths)
- Refactor to named variables for clarity
Co-authored-by: Thorsten <tw-360vier@users.noreply.github.com>1 parent 725bc45 commit dcf65a6
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
| |||
0 commit comments