docs(sdk): lancement des serveurs MCP JavaScript packagés — #294 (manifest: aucune substitution ${node}/${runtimeNode}/${hostNode} ni champ runtime, IdeA ne fournit pas de runtime Node plugin-scoped; command n'est pas du shell — démarrage direct avec args séparés, pas de fichiers de startup/alias/PATH du shell de login; command relatif résolu sous pluginRoot — command:"node" sans allowAbsoluteCommand devient ${pluginRoot}/node (cause ENOENT UnityPlugin #12); absolu littéral refusé sans allowAbsoluteCommand=true, command devenu absolu après substitution ${pluginRoot}/${appDataDir} passé tel quel; shebang #!/usr/bin/env node dépend du node visible du process app IdeA; recommandations: exécutable packagé incluant son runtime ou runtime géré sous stockage plugin/app pointé via ${pluginRoot}/${appDataDir}, sinon dépendance hôte explicite absolue /usr/bin/node avec allowAbsoluteCommand=true et scripts dans args; même règle pour command:"bash"; packaging-distribution: section Packaged Executables And Runtimes — bit exécutable et shebang valides dans le package installé, éviter le bare command:"node" en plugins distribués/multi-harness; services: distinction runCommand() (exécutable hôte de l'environnement task, aucune substitution) vs règles manifest mcpServers avec lien croisé; affirmations vérifiées par Git contre l'hôte crates/application/src/plugin/mod.rs:3199 substitution puis looks_absolute/allow_absolute_command sinon préfixage pluginRoot, et validation :3637 absolu littéral sans flag rejeté; QA verte reconfirmée par Git: npm run check — build, typecheck:examples, package:hello-plugin)
This commit is contained in:
@ -43,6 +43,25 @@ IdeA resolves React/ReactDOM bare imports to the host instance. Other bare
|
||||
dependencies are not host-resolved. Bundle or vendor third-party dependencies
|
||||
other than React/ReactDOM into package-relative files.
|
||||
|
||||
## Packaged Executables And Runtimes
|
||||
|
||||
Manifest-declared MCP servers are launched from `contributes.mcpServers` by
|
||||
starting the declared `command` directly. IdeA does not inject a shell and does
|
||||
not provide a plugin-scoped Node.js runtime.
|
||||
|
||||
For a packaged MCP server, prefer a package-relative executable such as
|
||||
`scripts/my-plugin-mcp-server`. The installed file must keep the executable bit
|
||||
and, when it is a script, a valid shebang. A JavaScript server with
|
||||
`#!/usr/bin/env node` still requires `node` in the environment inherited by the
|
||||
IdeA app process; this is not guaranteed to match the user's interactive shell,
|
||||
especially when Node is provided by shell startup tooling.
|
||||
|
||||
For reproducible JavaScript MCP servers, either ship/install a runtime under the
|
||||
plugin package or app-owned storage and point the manifest at that executable,
|
||||
or declare an explicit absolute host dependency with `allowAbsoluteCommand:
|
||||
true`. Avoid relying on a bare `command: "node"` in distributed or multi-harness
|
||||
plugins.
|
||||
|
||||
## TypeScript Build
|
||||
|
||||
The hello plugin uses plain `tsc`:
|
||||
|
||||
Reference in New Issue
Block a user