fix(mcp): use bin wrapper to fix npx permission denied (#9536)

Fix npx @xen-orchestra/mcp failing with "Permission denied".

tsc does not preserve the executable bit on compiled files, so bin pointing to ./dist/index.mjs (mode 644) caused the error. This adds a bin/xo-mcp.mjs wrapper tracked by git with mode 755, following the same pattern as other packages (@xen-orchestra/xapi, @xen-orchestra/proxy, etc.).
This commit is contained in:
Mathieu
2026-02-26 13:34:08 +01:00
committed by GitHub
parent 6bc2844092
commit 89494457a1
4 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env node
import { main } from '../dist/index.mjs'
main().catch(error => {
console.error('Fatal error:', error instanceof Error ? error.message : error)
process.exitCode = 1
})

View File

@@ -6,7 +6,7 @@
"type": "module",
"main": "./dist/index.mjs",
"bin": {
"xo-mcp": "./dist/index.mjs"
"xo-mcp": "./bin/xo-mcp.mjs"
},
"scripts": {
"build": "tsc",

View File

@@ -427,7 +427,7 @@ Present this information in a friendly, conversational way.`,
// =============================================================================
// Start server
// =============================================================================
async function main() {
export async function main() {
const env = validateEnv()
let xoClient: XoClient | null = null

View File

@@ -17,6 +17,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [MCP] Fix `npx @xen-orchestra/mcp` failing with “Permission denied” (PR [#9536](https://github.com/vatesfr/xen-orchestra/pull/9536))
### Packages to release
> When modifying a package, add it here with its release type.
@@ -33,6 +35,7 @@
<!--packages-start-->
- @xen-orchestra/mcp patch
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor