-
Notifications
You must be signed in to change notification settings - Fork 0
Add stdio support to MCP Studio #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
There was a problem hiding this 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 = |
There was a problem hiding this comment.
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 =
+ "SELECT * FROM workflow_execution WHERE workflow_id = ? ORDER BY created_at DESC LIMIT ? OFFSET ?";
+ params.unshift(args.workflow_id);
</file context>
| ); | ||
|
|
||
| const stepResults = await runSQL<Record<string, unknown>>( | ||
| "SELECT * FROM workflow_step_result WHERE execution_id = ? ORDER BY created_at ASC", |
There was a problem hiding this comment.
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<Record<string, unknown>>(
+ "SELECT * FROM workflow_step_result WHERE execution_id = ? ORDER BY created_at ASC",
+ [args.id],
+ );
</file context>
5924f9f to
eac230f
Compare
- 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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
+{ "source": "filesystem" } // Only filesystem workflows
+{ "source": "database" } // Only database workflows
+{ "source": "all" } // Both (default)
</file context>
| #### Examples | ||
|
|
||
| ```json | ||
| // Direct reference - entire value |
There was a problem hiding this comment.
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
+{ "user": "@fetch_user" }
+
</file context>
| if (includeDatabase && meshConfig) { | ||
| try { | ||
| const dbItems = await runSQL<Record<string, unknown>>( | ||
| "SELECT * FROM workflow_collection ORDER BY updated_at DESC", |
There was a problem hiding this comment.
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<void> {
+ if (includeDatabase && meshConfig) {
+ try {
+ const dbItems = await runSQL<Record<string, unknown>>(
+ "SELECT * FROM workflow_collection ORDER BY updated_at DESC",
+ [],
+ );
</file context>
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
Migration
Written for commit 7acbe27. Summary will update on new commits.