viagen 0.0.56 → 0.0.57

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
@@ -86,10 +86,29 @@ viagen({
86
86
  sandboxFiles: [...], // copy files manually into sandbox
87
87
  systemPrompt: '...', // custom system prompt (see below)
88
88
  editable: ['src','conf'], // files/dirs editable in the UI
89
+ mcpServers: { ... }, // additional MCP servers for Claude
89
90
  })
90
91
  ```
91
92
 
92
93
 
94
+ ### Custom MCP Servers
95
+
96
+ Pass additional [MCP server](https://modelcontextprotocol.io) configurations to give Claude access to custom tools:
97
+
98
+ ```ts
99
+ viagen({
100
+ mcpServers: {
101
+ 'my-db': {
102
+ command: 'npx',
103
+ args: ['-y', '@my-org/db-mcp-server'],
104
+ env: { DATABASE_URL: process.env.DATABASE_URL },
105
+ },
106
+ },
107
+ })
108
+ ```
109
+
110
+ These are merged with viagen's built-in platform tools (when connected). User-provided servers take precedence if names collide.
111
+
93
112
  ### Editable Files
94
113
 
95
114
  Add a file editor panel to the chat UI:
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Plugin } from 'vite';
2
+ import { McpServerConfig } from '@anthropic-ai/claude-agent-sdk';
2
3
 
3
4
  declare const DEFAULT_SYSTEM_PROMPT = "\n You are embedded in a Vite dev server as the \"viagen\" plugin.\n Your job is to help build and modify the app. Files you edit will trigger Vite HMR automatically.\n You can read .viagen/server.log to check recent Vite dev server output (compile errors, HMR updates, warnings).\n Be concise.\n\n You have agent-browser available for interacting with the running app in a real browser.\n Use it to visually verify your changes, test interactions, and catch UI issues.\n Key commands:\n agent-browser open <url> \u2014 open a page\n agent-browser snapshot \u2014 get accessibility tree with element refs (@e1, @e2, etc.)\n agent-browser click @e<N> \u2014 click an element by ref\n agent-browser fill @e<N> \"value\" \u2014 fill an input\n agent-browser screenshot <file> \u2014 capture a screenshot (you can view the image)\n agent-browser diff snapshot --baseline <file> \u2014 compare page state before/after\n agent-browser close \u2014 close the browser\n After making changes, consider using agent-browser to verify the result visually.\n";
4
5
 
@@ -97,6 +98,8 @@ interface ViagenOptions {
97
98
  * @example ['src/components', '.env', 'vite.config.ts']
98
99
  */
99
100
  editable?: string[];
101
+ /** Additional MCP servers to make available to Claude. Merged with built-in viagen tools. */
102
+ mcpServers?: Record<string, McpServerConfig>;
100
103
  /** Enable verbose debug logging. Also enabled by VIAGEN_DEBUG=1 in .env. */
101
104
  debug?: boolean;
102
105
  }
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ function registerHealthRoutes(server, env, errorRef) {
110
110
  );
111
111
  }
112
112
  });
113
- const currentVersion = true ? "0.0.56" : "0.0.0";
113
+ const currentVersion = true ? "0.0.57" : "0.0.0";
114
114
  debug("health", `version resolved: ${currentVersion}`);
115
115
  let versionCache = null;
116
116
  server.middlewares.use("/via/version", (_req, res) => {
@@ -19286,6 +19286,10 @@ Page URL: ${pageUrl}`);
19286
19286
  });
19287
19287
  mcpServers = { [viagenMcp.name]: viagenMcp };
19288
19288
  }
19289
+ if (options?.mcpServers) {
19290
+ mcpServers = { ...mcpServers, ...options.mcpServers };
19291
+ debug("server", `merged ${Object.keys(options.mcpServers).length} user MCP server(s)`);
19292
+ }
19289
19293
  const isPlanMode = env["VIAGEN_TASK_TYPE"] === "plan";
19290
19294
  let systemPrompt = options?.systemPrompt;
19291
19295
  if (isPlanMode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viagen",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Vite dev server plugin that exposes endpoints for chatting with Claude Code SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",