clyops-mcp 0.2.0 → 0.3.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dan VerWeire
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,7 +6,7 @@ its description and input schema come from its own `--help-json-schema`, so the
6
6
  options, types, choices and ranges the tool validates, and nothing needs to be written per tool.
7
7
 
8
8
  ```sh
9
- npm install -g clyops-mcp
9
+ pnpm add --global clyops-mcp
10
10
  ```
11
11
 
12
12
  ## Local agent (stdio)
@@ -104,3 +104,8 @@ app.listen(8080);
104
104
 
105
105
  `createMcpServer({name, tools, ...})` returns the SDK `Server` for any other transport. Each HTTP
106
106
  request is handled statelessly with its own server instance.
107
+
108
+ `--positionals-order first|last` controls generated argument order (default:
109
+ `first`). An option terminator is only emitted for positional values starting
110
+ with `-`, which are always placed after the options. The Node API exposes this
111
+ as `positionalsOrder`.
package/dist/cli.js CHANGED
@@ -20,6 +20,7 @@ cli.opt('CLYOPS_MCP_READ_ONLY', 'read-only', '', 'flag', 'Serve only tools that
20
20
  cli.optArray('CLYOPS_MCP_PATHS_WITHIN', 'paths-within', '', 'Path arguments must resolve inside this directory', 'Security', 'dir:exists');
21
21
  cli.opt('CLYOPS_MCP_MAX_OUTPUT', 'max-output', '', '16777216', 'Keep at most this many bytes of a tool\'s stdout and stderr (0: all)', 'Security', 'int:0-');
22
22
  cli.opt('CLYOPS_MCP_AUDIT', 'audit', '', 'optional', 'Append a JSON line per run to this file (-: stderr)', 'Security', 'path');
23
+ cli.opt('CLYOPS_MCP_POSITIONALS_ORDER', 'positionals-order', '', 'first', 'Positionals before or after options', 'Tools', 'choice:first,last');
23
24
  const args = cli.run();
24
25
  // stdout is the MCP channel; clyops logs to stderr.
25
26
  const onError = (cmd, err) => warn('%s%s', cmd ? `skipping ${cmd.words.join(' ')}: ` : '', err.message);
@@ -43,6 +44,7 @@ const mcp = {
43
44
  instructions: tree.description || undefined,
44
45
  tools,
45
46
  cwd: args.CLYOPS_MCP_CWD ?? undefined,
47
+ positionalsOrder: args.CLYOPS_MCP_POSITIONALS_ORDER,
46
48
  timeoutMs: args.CLYOPS_MCP_TIMEOUT * 1000,
47
49
  within: within.length ? within : undefined,
48
50
  maxOutput: args.CLYOPS_MCP_MAX_OUTPUT,
package/dist/server.d.ts CHANGED
@@ -2,6 +2,8 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { type AuditEntry, type Tool } from 'clyops-tools';
3
3
  import type { IncomingMessage, ServerResponse } from 'node:http';
4
4
  export interface McpOptions {
5
+ /** Positionals before or after options (default: first). */
6
+ positionalsOrder?: 'first' | 'last';
5
7
  /** Server name shown to clients (e.g. the tools directory's name). */
6
8
  name: string;
7
9
  version?: string;
package/dist/server.js CHANGED
@@ -109,7 +109,7 @@ export function createMcpServer(opts) {
109
109
  let result;
110
110
  try {
111
111
  result = await runTool(tool, declared ? input : checked.data, {
112
- cwd: opts.cwd, timeoutMs: opts.timeoutMs, signal: extra.signal, within: opts.within, maxOutput: opts.maxOutput,
112
+ cwd: opts.cwd, timeoutMs: opts.timeoutMs, positionalsOrder: opts.positionalsOrder, signal: extra.signal, within: opts.within, maxOutput: opts.maxOutput,
113
113
  stdin: stdinData, stdout: binaryStdout(tool) ? 'buffer' : 'text',
114
114
  });
115
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clyops-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Give an AI agent a directory of clyops tools over MCP (stdio or streamable HTTP), with each tool's input schema from its --help-json-schema.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,20 +35,19 @@
35
35
  "dist",
36
36
  "src"
37
37
  ],
38
- "scripts": {
39
- "build": "tsc -p tsconfig.json && chmod +x dist/cli.js",
40
- "typecheck": "tsc -p tsconfig.json --noEmit",
41
- "test": "node --test test/*.test.mjs",
42
- "prepublishOnly": "npm run build && npm test"
43
- },
44
38
  "dependencies": {
45
39
  "@modelcontextprotocol/sdk": "^1.32.1",
46
- "clyops": "0.2.0",
47
- "clyops-tools": "0.2.0"
40
+ "clyops": "0.3.0",
41
+ "clyops-tools": "0.3.0"
48
42
  },
49
43
  "devDependencies": {
50
44
  "@types/node": "^22.0.0",
51
45
  "typescript": "^5.6.0",
52
46
  "express": "^5.2.1"
47
+ },
48
+ "scripts": {
49
+ "build": "tsc -p tsconfig.json && chmod +x dist/cli.js",
50
+ "typecheck": "tsc -p tsconfig.json --noEmit",
51
+ "test": "node --test test/*.test.mjs"
53
52
  }
54
- }
53
+ }
package/src/cli.ts CHANGED
@@ -22,6 +22,7 @@ cli.opt('CLYOPS_MCP_READ_ONLY', 'read-only', '', 'flag', 'Serve
22
22
  cli.optArray('CLYOPS_MCP_PATHS_WITHIN', 'paths-within', '', 'Path arguments must resolve inside this directory', 'Security', 'dir:exists');
23
23
  cli.opt('CLYOPS_MCP_MAX_OUTPUT', 'max-output', '', '16777216', 'Keep at most this many bytes of a tool\'s stdout and stderr (0: all)', 'Security', 'int:0-');
24
24
  cli.opt('CLYOPS_MCP_AUDIT', 'audit', '', 'optional', 'Append a JSON line per run to this file (-: stderr)', 'Security', 'path');
25
+ cli.opt('CLYOPS_MCP_POSITIONALS_ORDER', 'positionals-order', '', 'first', 'Positionals before or after options', 'Tools', 'choice:first,last');
25
26
  const args = cli.run();
26
27
 
27
28
  // stdout is the MCP channel; clyops logs to stderr.
@@ -46,6 +47,7 @@ const mcp = {
46
47
  instructions: tree.description || undefined,
47
48
  tools,
48
49
  cwd: (args.CLYOPS_MCP_CWD as string | null) ?? undefined,
50
+ positionalsOrder: args.CLYOPS_MCP_POSITIONALS_ORDER as 'first' | 'last',
49
51
  timeoutMs: (args.CLYOPS_MCP_TIMEOUT as number) * 1000,
50
52
  within: within.length ? within : undefined,
51
53
  maxOutput: args.CLYOPS_MCP_MAX_OUTPUT as number,
package/src/server.ts CHANGED
@@ -9,6 +9,8 @@ import { InputError, isTextType, runTool, tail, toJsonSchema, type AuditEntry, t
9
9
  import type { IncomingMessage, ServerResponse } from 'node:http';
10
10
 
11
11
  export interface McpOptions {
12
+ /** Positionals before or after options (default: first). */
13
+ positionalsOrder?: 'first' | 'last';
12
14
  /** Server name shown to clients (e.g. the tools directory's name). */
13
15
  name: string;
14
16
  version?: string;
@@ -127,7 +129,7 @@ export function createMcpServer(opts: McpOptions): Server {
127
129
  let result: ToolResult;
128
130
  try {
129
131
  result = await runTool(tool, declared ? input : checked.data, {
130
- cwd: opts.cwd, timeoutMs: opts.timeoutMs, signal: extra.signal, within: opts.within, maxOutput: opts.maxOutput,
132
+ cwd: opts.cwd, timeoutMs: opts.timeoutMs, positionalsOrder: opts.positionalsOrder, signal: extra.signal, within: opts.within, maxOutput: opts.maxOutput,
131
133
  stdin: stdinData, stdout: binaryStdout(tool) ? 'buffer' : 'text',
132
134
  });
133
135
  } catch (err) {