Skip to content

Conversation

@vibegui
Copy link

@vibegui vibegui commented Jan 1, 2026

Summary by cubic

Adds stdio transport to MCP Studio so it can run as a CLI and as a Mesh custom command with full tool support. Also adds filesystem workflow loading with hot reload, Mesh bindings, automatic migrations, and database access via Mesh’s proxy.

  • New Features

    • Stdio entrypoint (server/stdio.ts) and tool registry (server/stdio-tools.ts).
    • Mesh bindings via MCP_CONFIGURATION and ON_MCP_CONFIGURATION; auto migrations; SQL via Mesh proxy with JSON and SSE responses.
    • Filesystem workflows via WORKFLOW_DIR/WORKFLOW_FILES with hot reload and source filtering; new tools WORKFLOW_RELOAD and WORKFLOW_SOURCE_INFO; workflow-loader.ts added.
    • Tools for Workflows, Executions, Assistants (list/get/create/update/delete), and Prompts (list/get); new scripts dev:stdio and stdio; README updated.
  • Migration

    • In Mesh, add a Custom Command: bun with args --watch /path/to/mcp-studio/server/stdio.ts, then configure the database binding; migrations run automatically.
    • Filesystem mode works without PostgreSQL: set WORKFLOW_DIR or WORKFLOW_FILES; without bindings, DB tools will fail.

Written for commit 7acbe27. Summary will update on new commits.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🚀 Preview Deployments Ready!

Your changes have been deployed to preview environments:

📦 mcp-studio

🔗 View Preview

These previews will be automatically updated with new commits to this PR.


Deployed from commit: bf04a38

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="mcp-studio/server/stdio-tools.ts">

<violation number="1" location="mcp-studio/server/stdio-tools.ts:615">
P2: This assignment also needs to use the renamed variable `query` to avoid shadowing the module-level `sql`.</violation>

<violation number="2" location="mcp-studio/server/stdio-tools.ts:667">
P0: Table name mismatch: query references `workflow_step_result` but the migration creates `workflow_execution_step_result`. This will cause a runtime error.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

const params: unknown[] = [args.limit, args.offset];

if (args.workflow_id) {
sql =
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This assignment also needs to use the renamed variable query to avoid shadowing the module-level sql.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-studio/server/stdio-tools.ts, line 615:

<comment>This assignment also needs to use the renamed variable `query` to avoid shadowing the module-level `sql`.</comment>

<file context>
@@ -0,0 +1,1109 @@
+      const params: unknown[] = [args.limit, args.offset];
+
+      if (args.workflow_id) {
+        sql =
+          &quot;SELECT * FROM workflow_execution WHERE workflow_id = ? ORDER BY created_at DESC LIMIT ? OFFSET ?&quot;;
+        params.unshift(args.workflow_id);
</file context>
Fix with Cubic

);

const stepResults = await runSQL<Record<string, unknown>>(
"SELECT * FROM workflow_step_result WHERE execution_id = ? ORDER BY created_at ASC",
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: Table name mismatch: query references workflow_step_result but the migration creates workflow_execution_step_result. This will cause a runtime error.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-studio/server/stdio-tools.ts, line 667:

<comment>Table name mismatch: query references `workflow_step_result` but the migration creates `workflow_execution_step_result`. This will cause a runtime error.</comment>

<file context>
@@ -0,0 +1,1109 @@
+      );
+
+      const stepResults = await runSQL&lt;Record&lt;string, unknown&gt;&gt;(
+        &quot;SELECT * FROM workflow_step_result WHERE execution_id = ? ORDER BY created_at ASC&quot;,
+        [args.id],
+      );
</file context>
Fix with Cubic

@vibegui vibegui force-pushed the feat/studio-stdio branch from 5924f9f to eac230f Compare January 1, 2026 05:09
- Introduced a new filesystem mode for loading workflows from JSON files, allowing for version-controlled workflows and database-free operation.
- Added tools for reloading workflows and retrieving source information, improving workflow management and visibility.
- Updated the workflow collection tools to support filtering by source (filesystem or database) and enhanced pagination logic.
- Enhanced error handling and logging for workflow operations, ensuring better user experience and debugging capabilities.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 3 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="mcp-studio/README.md">

<violation number="1" location="mcp-studio/README.md:77">
P2: JSON code blocks contain JavaScript-style comments (`//`) which are not valid JSON. Users copying these examples will get parsing errors. Consider using separate code blocks for each example with markdown text explanations, or use JSONC (JSON with Comments) as the language identifier.</violation>

<violation number="2" location="mcp-studio/README.md:356">
P2: JSON examples contain inline comments which are not valid JSON syntax. Consider removing comments and using markdown list format instead, or change the code fence to `jsonc` for JSON with Comments.</violation>
</file>

<file name="mcp-studio/server/stdio-tools.ts">

<violation number="1" location="mcp-studio/server/stdio-tools.ts:531">
P2: Database query fetches all rows without LIMIT, then paginates in memory. With large datasets, this could cause performance and memory issues. Consider fetching a reasonable upper bound from the database (e.g., `LIMIT 1000`) or documenting this limitation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

The `COLLECTION_WORKFLOW_LIST` tool accepts a `source` parameter:

```json
{ "source": "filesystem" } // Only filesystem workflows
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: JSON examples contain inline comments which are not valid JSON syntax. Consider removing comments and using markdown list format instead, or change the code fence to jsonc for JSON with Comments.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-studio/README.md, line 356:

<comment>JSON examples contain inline comments which are not valid JSON syntax. Consider removing comments and using markdown list format instead, or change the code fence to `jsonc` for JSON with Comments.</comment>

<file context>
@@ -9,6 +9,383 @@ MCP server for managing workflows, executions, assistants, and prompts. Supports
+The `COLLECTION_WORKFLOW_LIST` tool accepts a `source` parameter:
+
+```json
+{ &quot;source&quot;: &quot;filesystem&quot; }  // Only filesystem workflows
+{ &quot;source&quot;: &quot;database&quot; }    // Only database workflows  
+{ &quot;source&quot;: &quot;all&quot; }         // Both (default)
</file context>
Fix with Cubic

#### Examples

```json
// Direct reference - entire value
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: JSON code blocks contain JavaScript-style comments (//) which are not valid JSON. Users copying these examples will get parsing errors. Consider using separate code blocks for each example with markdown text explanations, or use JSONC (JSON with Comments) as the language identifier.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-studio/README.md, line 77:

<comment>JSON code blocks contain JavaScript-style comments (`//`) which are not valid JSON. Users copying these examples will get parsing errors. Consider using separate code blocks for each example with markdown text explanations, or use JSONC (JSON with Comments) as the language identifier.</comment>

<file context>
@@ -9,6 +9,383 @@ MCP server for managing workflows, executions, assistants, and prompts. Supports
+#### Examples
+
+```json
+// Direct reference - entire value
+{ &quot;user&quot;: &quot;@fetch_user&quot; }
+
</file context>
Fix with Cubic

if (includeDatabase && meshConfig) {
try {
const dbItems = await runSQL<Record<string, unknown>>(
"SELECT * FROM workflow_collection ORDER BY updated_at DESC",
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Database query fetches all rows without LIMIT, then paginates in memory. With large datasets, this could cause performance and memory issues. Consider fetching a reasonable upper bound from the database (e.g., LIMIT 1000) or documenting this limitation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-studio/server/stdio-tools.ts, line 531:

<comment>Database query fetches all rows without LIMIT, then paginates in memory. With large datasets, this could cause performance and memory issues. Consider fetching a reasonable upper bound from the database (e.g., `LIMIT 1000`) or documenting this limitation.</comment>

<file context>
@@ -465,24 +498,64 @@ export async function registerStdioTools(server: McpServer): Promise&lt;void&gt; {
+      if (includeDatabase &amp;&amp; meshConfig) {
+        try {
+          const dbItems = await runSQL&lt;Record&lt;string, unknown&gt;&gt;(
+            &quot;SELECT * FROM workflow_collection ORDER BY updated_at DESC&quot;,
+            [],
+          );
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants