mcp-speechmatics-transcribe 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,8 +42,10 @@ For a local env file, append --env-file and its absolute path.
42
42
  With no file argument, the command starts the MCP server; the explicit mcp subcommand
43
43
  remains supported. MCP is a thin adapter: it obtains tool definitions from the CLI
44
44
  at startup and on every tools/list request, then forwards each tools/call to a
45
- separate CLI process. Both discovery and execution run through
46
- npx -y --prefer-online mcp-speechmatics-transcribe@latest, reusing npm's cache.
45
+ separate CLI process. An npx-managed installation resolves the latest published CLI
46
+ through npx, reusing npm's cache. Local launches, including npm scripts, use the CLI
47
+ from the same installation through the current Node.js executable. Ambiguous
48
+ launches use the same-installation CLI.
47
49
  Changes detected during discovery emit notifications/tools/list_changed. Clients
48
50
  must request the tool list to discover updates; no background polling is performed.
49
51
  In-flight calls continue with their starting version. The CLI inherits the
@@ -139,7 +141,7 @@ match the package version. npm publishing uses GitHub OIDC after a trusted
139
141
  publisher is configured for this repository and release.yml.
140
142
 
141
143
  For the first publication, authenticate with npm login and publish the checked archive
142
- from work/releases/ using npm publish with --access public.
144
+ from .tmp/releases/ using npm publish with --access public.
143
145
  The release workflow publishes stable versions under latest and prereleases under next.
144
146
 
145
147
  ## License
@@ -6,14 +6,24 @@ import { fileURLToPath } from "node:url";
6
6
  export function runCli(mode, request) {
7
7
  return new Promise((done, reject) => {
8
8
  if (!["--tool-manifest", "--execute-tool"].includes(mode)) throw new Error("Unsupported CLI mode.");
9
- const launchArgs = ["-y", "--prefer-online", "mcp-speechmatics-transcribe@latest", mode];
10
- const windows = process.platform === "win32";
11
- const child = spawn(windows ? "npx " + launchArgs.join(" ") : "npx", windows ? [] : launchArgs, {
12
- shell: windows,
9
+ const modulePath = fileURLToPath(import.meta.url);
10
+ const cachedPackage = /[\\/]_npx[\\/][^\\/]+[\\/]node_modules[\\/]mcp-speechmatics-transcribe[\\/]/i.test(modulePath);
11
+ const npmExec = process.env.npm_command === "exec"
12
+ || (!process.env.npm_command && process.env.npm_lifecycle_event === "npx");
13
+ const useNpx = cachedPackage && npmExec;
14
+ const launchArgs = useNpx
15
+ ? ["-y", "--prefer-online", "--package=mcp-speechmatics-transcribe@latest", "--", "mcp-speechmatics-transcribe", mode]
16
+ : [fileURLToPath(new URL("../cli.js", import.meta.url)), mode];
17
+ const windowsShell = useNpx && process.platform === "win32";
18
+ const environment = Object.fromEntries(Object.entries(process.env)
19
+ .filter(([key]) => !/^npm_config_(package|call)$/i.test(key)));
20
+ const command = useNpx ? "npx" : process.execPath;
21
+ const child = spawn(windowsShell ? command + " " + launchArgs.join(" ") : command, windowsShell ? [] : launchArgs, {
22
+ shell: windowsShell,
13
23
  windowsHide: true,
14
24
  stdio: ["pipe", "pipe", "inherit"],
15
25
  env: {
16
- ...process.env,
26
+ ...environment,
17
27
  SPEECHMATICS_ENV_FILE: process.env.SPEECHMATICS_ENV_FILE
18
28
  ? resolve(process.env.SPEECHMATICS_ENV_FILE)
19
29
  : fileURLToPath(new URL("../.env", import.meta.url)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-speechmatics-transcribe",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Transcribe audio and video files with Speechmatics through a CLI and MCP server.",
5
5
  "type": "module",
6
6
  "license": "MIT",