@visulima/vis-mcp 1.0.9 → 1.0.10

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## @visulima/vis-mcp [1.0.10](https://github.com/visulima/visulima/compare/%40visulima%2Fvis-mcp%401.0.9...%40visulima%2Fvis-mcp%401.0.10) (2026-07-27)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/fs:** upgraded to 5.0.11
7
+ * **@visulima/vis:** upgraded to 2.0.1
8
+
1
9
  ## @visulima/vis-mcp [1.0.9](https://github.com/visulima/visulima/compare/%40visulima%2Fvis-mcp%401.0.8...%40visulima%2Fvis-mcp%401.0.9) (2026-07-27)
2
10
 
3
11
 
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  /**
3
- * Spawn a `vis` subprocess and capture stdout/stderr without piping to the
4
- * parent's stdio. The MCP server must keep its own stdout pristine — anything
5
- * other than JSON-RPC frames corrupts the protocol stream.
6
- *
7
- * `visBin` is the resolved path to the user's installed vis CLI; injected so
8
- * tests can point at a fixture instead of the real CLI.
9
- */
3
+ * Spawn a `vis` subprocess and capture stdout/stderr without piping to the
4
+ * parent's stdio. The MCP server must keep its own stdout pristine — anything
5
+ * other than JSON-RPC frames corrupts the protocol stream.
6
+ *
7
+ * `visBin` is the resolved path to the user's installed vis CLI; injected so
8
+ * tests can point at a fixture instead of the real CLI.
9
+ */
10
10
  declare const execVis: (visBin: string, args: ReadonlyArray<string>, options?: ExecOptions) => Promise<ExecResult>;
11
11
  /**
12
- * Run `vis` and parse stdout as JSON. Throws when the subprocess fails or
13
- * stdout isn't valid JSON — callers map this into an `isError: true` MCP
14
- * response.
15
- */
12
+ * Run `vis` and parse stdout as JSON. Throws when the subprocess fails or
13
+ * stdout isn't valid JSON — callers map this into an `isError: true` MCP
14
+ * response.
15
+ */
16
16
  declare const execVisJson: <T>(visBin: string, args: ReadonlyArray<string>, options?: ExecOptions) => Promise<T>;
17
17
  interface ExecResult {
18
18
  exitCode: number;
@@ -26,29 +26,29 @@ interface ExecOptions {
26
26
  cwd?: string;
27
27
  env?: Record<string, string | undefined>;
28
28
  /**
29
- * Maximum combined stdout+stderr (in code units, an over-approximation of
30
- * bytes) before the child is killed. Defaults to 64 MiB.
31
- */
29
+ * Maximum combined stdout+stderr (in code units, an over-approximation of
30
+ * bytes) before the child is killed. Defaults to 64 MiB.
31
+ */
32
32
  maxBufferBytes?: number;
33
33
  /** Hard ceiling. The default 120s suits cache lookups and listings. */
34
34
  timeoutMs?: number;
35
35
  }
36
36
  /**
37
- * Run `vis list ...` and parse stdout as JSON, served from a short-TTL memo
38
- * keyed on `workspaceRoot` + `args`. A rejected lookup is never cached, so a
39
- * transient CLI failure does not poison subsequent calls.
40
- */
37
+ * Run `vis list ...` and parse stdout as JSON, served from a short-TTL memo
38
+ * keyed on `workspaceRoot` + `args`. A rejected lookup is never cached, so a
39
+ * transient CLI failure does not poison subsequent calls.
40
+ */
41
41
  declare const listVisJson: <T>(visBin: string, workspaceRoot: string, args: ReadonlyArray<string>, ttlMs?: number) => Promise<T>;
42
42
  /** Clear the memo. Exposed for tests and long-running embeds that need a reset. */
43
43
  declare const clearListCache: () => void;
44
44
  /**
45
- * MCP tool response shape used across all `vis` tools. Kept in one place so
46
- * adding a new tool doesn't require re-deriving the type from the SDK.
47
- *
48
- * The index signature matches the SDK's `CallToolResult` shape — the SDK
49
- * extends the JSON-RPC result with an open `_meta` bag and refuses anything
50
- * stricter at the assignment site.
51
- */
45
+ * MCP tool response shape used across all `vis` tools. Kept in one place so
46
+ * adding a new tool doesn't require re-deriving the type from the SDK.
47
+ *
48
+ * The index signature matches the SDK's `CallToolResult` shape — the SDK
49
+ * extends the JSON-RPC result with an open `_meta` bag and refuses anything
50
+ * stricter at the assignment site.
51
+ */
52
52
  interface McpToolResponse {
53
53
  [key: string]: unknown;
54
54
  content: {
@@ -57,19 +57,19 @@ interface McpToolResponse {
57
57
  }[];
58
58
  isError?: boolean;
59
59
  /**
60
- * Typed payload mirrored from `content`. Present only for tools that declare
61
- * an `outputSchema`; lets MCP clients validate and render the result instead
62
- * of re-parsing the JSON string in the text block.
63
- */
60
+ * Typed payload mirrored from `content`. Present only for tools that declare
61
+ * an `outputSchema`; lets MCP clients validate and render the result instead
62
+ * of re-parsing the JSON string in the text block.
63
+ */
64
64
  structuredContent?: Record<string, unknown>;
65
65
  }
66
66
  declare const okResponse: (payload: unknown) => McpToolResponse;
67
67
  /**
68
- * Like {@link okResponse} but also attaches `structuredContent` so clients of a
69
- * tool that declared an `outputSchema` get a validated, typed payload alongside
70
- * the JSON text block. Only object payloads are valid structured content per the
71
- * MCP spec, so the caller must pass a record.
72
- */
68
+ * Like {@link okResponse} but also attaches `structuredContent` so clients of a
69
+ * tool that declared an `outputSchema` get a validated, typed payload alongside
70
+ * the JSON text block. Only object payloads are valid structured content per the
71
+ * MCP spec, so the caller must pass a record.
72
+ */
73
73
  declare const okStructuredResponse: (payload: Record<string, unknown>) => McpToolResponse;
74
74
  declare const errorResponse: (error: unknown) => McpToolResponse;
75
75
  interface ToolContext {
@@ -79,90 +79,64 @@ interface ToolContext {
79
79
  workspaceRoot: string;
80
80
  }
81
81
  /**
82
- * Dependencies a tool needs from the MCP SDK. Threaded through so each tool
83
- * stays a plain registration function and tests can swap in a fake `server`
84
- * without touching the real SDK.
85
- */
82
+ * Dependencies a tool needs from the MCP SDK. Threaded through so each tool
83
+ * stays a plain registration function and tests can swap in a fake `server`
84
+ * without touching the real SDK.
85
+ */
86
86
  interface ToolDeps {
87
87
  server: McpServer;
88
88
  }
89
89
  /**
90
- * Register every tool against an already-built MCP server. Pure wiring — no
91
- * I/O — so tests can drive it against an `InMemoryTransport` without forking
92
- * a subprocess.
93
- */
90
+ * Register every tool against an already-built MCP server. Pure wiring — no
91
+ * I/O — so tests can drive it against an `InMemoryTransport` without forking
92
+ * a subprocess.
93
+ */
94
94
  declare const registerAllTools: (deps: ToolDeps, context: ToolContext) => void;
95
95
  /**
96
- * Build a fully-configured MCP server with all vis tools registered. Returns
97
- * the server and deps so callers can connect any transport. Tests use this
98
- * with `InMemoryTransport.createLinkedPair()`.
99
- */
96
+ * Build a fully-configured MCP server with all vis tools registered. Returns
97
+ * the server and deps so callers can connect any transport. Tests use this
98
+ * with `InMemoryTransport.createLinkedPair()`.
99
+ */
100
100
  declare const createMcpServer: (context: ToolContext) => Promise<{
101
101
  deps: ToolDeps;
102
102
  server: McpServer;
103
103
  }>;
104
104
  /**
105
- * Boot the vis MCP server over stdio.
106
- *
107
- * Critical invariant: nothing in this process may write to stdout outside
108
- * the MCP transport. Any console.log in tool handlers will frame-corrupt
109
- * the JSON-RPC stream. Logs go to stderr only.
110
- */
105
+ * Boot the vis MCP server over stdio.
106
+ *
107
+ * Critical invariant: nothing in this process may write to stdout outside
108
+ * the MCP transport. Any console.log in tool handlers will frame-corrupt
109
+ * the JSON-RPC stream. Logs go to stderr only.
110
+ */
111
111
  declare const startMcpServer: () => Promise<void>;
112
- declare const registerAdvisoryStatus: ({
113
- server
114
- }: ToolDeps, context: ToolContext) => void;
115
- declare const registerAudit: ({
116
- server
117
- }: ToolDeps, context: ToolContext) => void;
118
- declare const registerCacheHash: ({
119
- server
120
- }: ToolDeps, context: ToolContext) => void;
121
- declare const registerCacheWhy: ({
122
- server
123
- }: ToolDeps, context: ToolContext) => void;
124
- declare const registerDescribeProject: ({
125
- server
126
- }: ToolDeps, context: ToolContext) => void;
127
- declare const registerDescribeTemplate: ({
128
- server
129
- }: ToolDeps, context: ToolContext) => void;
130
- declare const registerFmt: ({
131
- server
132
- }: ToolDeps, context: ToolContext) => void;
133
- declare const registerGetRunLogs: ({
134
- server
135
- }: ToolDeps, context: ToolContext) => void;
136
- declare const registerLint: ({
137
- server
138
- }: ToolDeps, context: ToolContext) => void;
139
- declare const registerListProjects: ({
140
- server
141
- }: ToolDeps, context: ToolContext) => void;
142
- declare const registerListRuns: ({
143
- server
144
- }: ToolDeps, context: ToolContext) => void;
145
- declare const registerListTargets: ({
146
- server
147
- }: ToolDeps, context: ToolContext) => void;
148
- declare const registerListTemplates: ({
149
- server
150
- }: ToolDeps, context: ToolContext) => void;
112
+ declare const registerAdvisoryStatus: ({ server }: ToolDeps, context: ToolContext) => void;
113
+ declare const registerAudit: ({ server }: ToolDeps, context: ToolContext) => void;
114
+ declare const registerCacheHash: ({ server }: ToolDeps, context: ToolContext) => void;
115
+ declare const registerCacheWhy: ({ server }: ToolDeps, context: ToolContext) => void;
116
+ declare const registerDescribeProject: ({ server }: ToolDeps, context: ToolContext) => void;
117
+ declare const registerDescribeTemplate: ({ server }: ToolDeps, context: ToolContext) => void;
118
+ declare const registerFmt: ({ server }: ToolDeps, context: ToolContext) => void;
119
+ declare const registerGetRunLogs: ({ server }: ToolDeps, context: ToolContext) => void;
120
+ declare const registerLint: ({ server }: ToolDeps, context: ToolContext) => void;
121
+ declare const registerListProjects: ({ server }: ToolDeps, context: ToolContext) => void;
122
+ declare const registerListRuns: ({ server }: ToolDeps, context: ToolContext) => void;
123
+ declare const registerListTargets: ({ server }: ToolDeps, context: ToolContext) => void;
124
+ declare const registerListTemplates: ({ server }: ToolDeps, context: ToolContext) => void;
151
125
  declare const isValidRunId: (value: string) => boolean;
152
126
  /**
153
- * Task IDs are `&lt;project>:&lt;target>`; both halves are package or npm-scope
154
- * shaped. The exec layer uses argv-form spawn so shell metacharacters are
155
- * inert, but a leading `-` would be parsed as a CLI flag by the vis CLI.
156
- */
127
+ * Task IDs are `&lt;project>:&lt;target>`; both halves are package or npm-scope
128
+ * shaped. The exec layer uses argv-form spawn so shell metacharacters are
129
+ * inert, but a leading `-` would be parsed as a CLI flag by the vis CLI.
130
+ */
157
131
  declare const isValidTaskId: (value: string) => boolean;
158
132
  /**
159
- * Guard for free-form positional arguments forwarded to the vis CLI (template
160
- * names, file paths). Spawn is argv-form so shell metacharacters are inert, but
161
- * a leading `-` would be parsed as a CLI flag — turning an LLM-supplied
162
- * `files: ["--fix"]` into a write operation that violates the `readOnlyHint`
163
- * contract clients rely on for auto-approval. Callers must additionally insert
164
- * a literal `--` separator before any positionals so a value that *becomes*
165
- * flag-shaped through some other path can never be reinterpreted as an option.
166
- */
133
+ * Guard for free-form positional arguments forwarded to the vis CLI (template
134
+ * names, file paths). Spawn is argv-form so shell metacharacters are inert, but
135
+ * a leading `-` would be parsed as a CLI flag — turning an LLM-supplied
136
+ * `files: ["--fix"]` into a write operation that violates the `readOnlyHint`
137
+ * contract clients rely on for auto-approval. Callers must additionally insert
138
+ * a literal `--` separator before any positionals so a value that *becomes*
139
+ * flag-shaped through some other path can never be reinterpreted as an option.
140
+ */
167
141
  declare const isSafePositional: (value: string) => boolean;
168
142
  export { type ExecOptions, type ExecResult, type McpToolResponse, type ToolContext, type ToolDeps, clearListCache, createMcpServer, errorResponse, execVis, execVisJson, isSafePositional, isValidRunId, isValidTaskId, listVisJson, okResponse, okStructuredResponse, registerAdvisoryStatus, registerAllTools, registerAudit, registerCacheHash, registerCacheWhy, registerDescribeProject, registerDescribeTemplate, registerFmt, registerGetRunLogs, registerLint, registerListProjects, registerListRuns, registerListTargets, registerListTemplates, startMcpServer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/vis-mcp",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "MCP (Model Context Protocol) server for @visulima/vis — exposes vis tooling to AI agents over stdio",
5
5
  "keywords": [
6
6
  "agent",
@@ -59,12 +59,12 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@modelcontextprotocol/sdk": "^1.29.0",
62
- "@visulima/fs": "5.0.10",
62
+ "@visulima/fs": "5.0.11",
63
63
  "@visulima/path": "3.0.0",
64
64
  "zod": "4.4.3"
65
65
  },
66
66
  "peerDependencies": {
67
- "@visulima/vis": "2.0.0"
67
+ "@visulima/vis": "2.0.1"
68
68
  },
69
69
  "engines": {
70
70
  "node": "^22.14.0 || >=24.10.0"