|
1 | 1 | # MCP Studio |
2 | 2 |
|
3 | | -Your MCP server description goes here. |
| 3 | +MCP server for managing workflows, executions, assistants, and prompts. Supports both HTTP and stdio transports. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Workflows**: Create, update, delete, and list workflow definitions |
| 8 | +- **Executions**: View and manage workflow execution history |
| 9 | +- **Assistants**: Manage AI assistant configurations |
| 10 | +- **Prompts**: Store and retrieve prompt templates |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +### HTTP Transport (Mesh Web Connection) |
| 15 | + |
| 16 | +```bash |
| 17 | +# Development with hot reload |
| 18 | +bun run dev |
| 19 | + |
| 20 | +# Production |
| 21 | +bun run build:server |
| 22 | +node dist/server/main.js |
| 23 | +``` |
| 24 | + |
| 25 | +### Stdio Transport (Mesh Custom Command) |
| 26 | + |
| 27 | +```bash |
| 28 | +# Run directly |
| 29 | +bun run stdio |
| 30 | + |
| 31 | +# Development with hot reload |
| 32 | +bun run dev:stdio |
| 33 | +``` |
| 34 | + |
| 35 | +#### Adding to Mesh as Custom Command |
| 36 | + |
| 37 | +In Mesh, add a new custom command connection: |
| 38 | + |
| 39 | +1. Go to **MCPs** → **Add MCP** → **Custom Command** |
| 40 | +2. Configure the command: |
| 41 | + - **Command**: `bun` |
| 42 | + - **Args**: `--watch /path/to/mcp-studio/server/stdio.ts` |
| 43 | +3. Click **Save** - Mesh will spawn the process and fetch the tools |
| 44 | +4. Go to the **Settings** tab to configure the database binding |
| 45 | +5. Select a PostgreSQL connection from the **Database** dropdown |
| 46 | +6. Click **Save Changes** |
| 47 | + |
| 48 | +This enables: |
| 49 | +- Live reloading during development |
| 50 | +- Mesh bindings UI for database configuration (same dropdowns as HTTP connections) |
| 51 | +- Automatic migrations when bindings are configured |
| 52 | + |
| 53 | +## Bindings |
| 54 | + |
| 55 | +The stdio transport supports Mesh bindings via: |
| 56 | + |
| 57 | +- `MCP_CONFIGURATION` - Returns the state schema for the bindings UI (uses `BindingOf` format) |
| 58 | +- `ON_MCP_CONFIGURATION` - Receives configured bindings (connection IDs) and runs migrations |
| 59 | + |
| 60 | +The binding schema uses the same format as HTTP mode: |
| 61 | +```typescript |
| 62 | +const StdioStateSchema = z.object({ |
| 63 | + DATABASE: BindingOf("@deco/postgres").describe("PostgreSQL database binding"), |
| 64 | +}); |
| 65 | +``` |
| 66 | + |
| 67 | +This renders as a dropdown in Mesh UI showing all connections that implement `@deco/postgres`. |
| 68 | + |
| 69 | +## Environment Variables |
| 70 | + |
| 71 | +| Variable | Required | Description | |
| 72 | +|----------|----------|-------------| |
| 73 | +| `DATABASE_URL` | Yes | PostgreSQL connection string (e.g., from Supabase project settings) | |
| 74 | + |
| 75 | +**Note**: STDIO connections receive binding configuration (connection IDs) from Mesh, but still require `DATABASE_URL` env var for actual database connectivity. This is because STDIO processes cannot proxy database calls through Mesh. |
| 76 | + |
| 77 | +## Available Tools |
| 78 | + |
| 79 | +### Workflow Collection |
| 80 | +- `COLLECTION_WORKFLOW_LIST` - List all workflows |
| 81 | +- `COLLECTION_WORKFLOW_GET` - Get a single workflow by ID |
| 82 | +- `COLLECTION_WORKFLOW_CREATE` - Create a new workflow |
| 83 | +- `COLLECTION_WORKFLOW_UPDATE` - Update an existing workflow |
| 84 | +- `COLLECTION_WORKFLOW_DELETE` - Delete a workflow |
| 85 | + |
| 86 | +### Execution Collection |
| 87 | +- `COLLECTION_WORKFLOW_EXECUTION_LIST` - List workflow executions |
| 88 | +- `COLLECTION_WORKFLOW_EXECUTION_GET` - Get execution details with step results |
| 89 | + |
| 90 | +### Assistant Collection |
| 91 | +- `COLLECTION_ASSISTANT_LIST` - List all assistants |
| 92 | +- `COLLECTION_ASSISTANT_GET` - Get a single assistant by ID |
| 93 | +- `COLLECTION_ASSISTANT_CREATE` - Create a new assistant |
| 94 | +- `COLLECTION_ASSISTANT_UPDATE` - Update an existing assistant |
| 95 | +- `COLLECTION_ASSISTANT_DELETE` - Delete an assistant |
| 96 | + |
| 97 | +### Prompt Collection |
| 98 | +- `COLLECTION_PROMPT_LIST` - List all prompts |
| 99 | +- `COLLECTION_PROMPT_GET` - Get a single prompt by ID |
| 100 | + |
| 101 | +## Development |
| 102 | + |
| 103 | +```bash |
| 104 | +# Install dependencies |
| 105 | +bun install |
| 106 | + |
| 107 | +# Type check |
| 108 | +bun run check |
| 109 | + |
| 110 | +# Format code |
| 111 | +bun run fmt |
| 112 | +``` |
0 commit comments