|
| 1 | +# MCP Server Configuration |
| 2 | + |
| 3 | +## Adding the Vue-Skuilder MCP Server to Claude Code |
| 4 | + |
| 5 | +### Local Configuration (Default) |
| 6 | + |
| 7 | +For personal use, add the server to your local configuration: |
| 8 | + |
| 9 | +```bash |
| 10 | +claude mcp add stumcptmp node "~/pn/vue-skuilder/studio-mcp/packages/cli/dist/mcp-server.js 2aeb8315ef78f3e89ca386992d00825b" |
| 11 | +``` |
| 12 | + |
| 13 | +### Project Configuration (Shared) |
| 14 | + |
| 15 | +For team collaboration, configure the server to project scope so it's shared via `.mcp.json`. You can either use the CLI command or create the file directly. |
| 16 | + |
| 17 | +#### Using CLI Command |
| 18 | + |
| 19 | +```bash |
| 20 | +claude mcp add stumcptmp -s project node "./packages/cli/dist/mcp-server.js" "2aeb8315ef78f3e89ca386992d00825b" |
| 21 | +``` |
| 22 | + |
| 23 | +#### Creating .mcp.json Directly |
| 24 | + |
| 25 | +Alternatively, create a `.mcp.json` file manually at the project root: |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "mcpServers": { |
| 30 | + "stumcptmp": { |
| 31 | + "command": "./packages/cli/dist/mcp-server.js", |
| 32 | + "args": ["2aeb8315ef78f3e89ca386992d00825b"], |
| 33 | + "env": {} |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +#### Using Environment Variables in Project Config |
| 40 | + |
| 41 | +For flexible course selection across different environments, either use the CLI: |
| 42 | + |
| 43 | +```bash |
| 44 | +claude mcp add stumcptmp -s project -e COURSE_ID=2aeb8315ef78f3e89ca386992d00825b node "./packages/cli/dist/mcp-server.js" "${COURSE_ID}" |
| 45 | +``` |
| 46 | + |
| 47 | +Or create the `.mcp.json` file directly with environment variable expansion: |
| 48 | + |
| 49 | +```json |
| 50 | +{ |
| 51 | + "mcpServers": { |
| 52 | + "stumcptmp": { |
| 53 | + "command": "./packages/cli/dist/mcp-server.js", |
| 54 | + "args": ["${COURSE_ID}"], |
| 55 | + "env": { |
| 56 | + "COURSE_ID": "2aeb8315ef78f3e89ca386992d00825b" |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +### Command Breakdown |
| 64 | + |
| 65 | +- `stumcptmp` - Server name identifier |
| 66 | +- `-s project` - Store configuration in shared `.mcp.json` file |
| 67 | +- `node` - Command to execute (or use `./packages/cli/dist/mcp-server.js` directly) |
| 68 | +- `~/pn/vue-skuilder/studio-mcp/packages/cli/dist/mcp-server.js` - Path to compiled MCP server |
| 69 | +- `2aeb8315ef78f3e89ca386992d00825b` - Course ID to connect to |
| 70 | + |
| 71 | +### Verification |
| 72 | + |
| 73 | +After adding the server, verify the configuration: |
| 74 | + |
| 75 | +```bash |
| 76 | +claude mcp list |
| 77 | +claude mcp get stumcptmp |
| 78 | +``` |
| 79 | + |
| 80 | +## Generating .mcp.json from Studio Builds |
| 81 | + |
| 82 | +The `studio` command automatically displays MCP connection information when launching a studio session. You can use this information to programmatically generate `.mcp.json` files. |
| 83 | + |
| 84 | +### Using Studio Command Output |
| 85 | + |
| 86 | +When running `skuilder studio`, the command outputs MCP connection details: |
| 87 | + |
| 88 | +```bash |
| 89 | +skuilder studio ./my-course |
| 90 | +# ... studio startup output ... |
| 91 | +🔗 MCP Server: node /path/to/cli/dist/mcp-server.js unpacked_courseId_20250122_abc123 5985 |
| 92 | + Connect MCP clients using the command above |
| 93 | + Environment variables for MCP: |
| 94 | + COUCHDB_SERVER_URL=localhost:5985 |
| 95 | + COUCHDB_SERVER_PROTOCOL=http |
| 96 | + COUCHDB_USERNAME=admin |
| 97 | + COUCHDB_PASSWORD=password |
| 98 | +``` |
| 99 | + |
| 100 | +### Programmatic .mcp.json Generation |
| 101 | + |
| 102 | +Based on the studio command output, you can generate an `.mcp.json` file: |
| 103 | + |
| 104 | +```json |
| 105 | +{ |
| 106 | + "mcpServers": { |
| 107 | + "vue-skuilder-studio": { |
| 108 | + "command": "./packages/cli/dist/mcp-server.js", |
| 109 | + "args": ["unpacked_courseId_20250122_abc123", "5985"], |
| 110 | + "env": { |
| 111 | + "COUCHDB_SERVER_URL": "localhost:5985", |
| 112 | + "COUCHDB_SERVER_PROTOCOL": "http", |
| 113 | + "COUCHDB_USERNAME": "admin", |
| 114 | + "COUCHDB_PASSWORD": "password" |
| 115 | + } |
| 116 | + } |
| 117 | + } |
| 118 | +} |
| 119 | +``` |
| 120 | + |
| 121 | +### Dynamic Course/Database Selection |
| 122 | + |
| 123 | +For flexible studio sessions with different courses, use environment variables: |
| 124 | + |
| 125 | +```json |
| 126 | +{ |
| 127 | + "mcpServers": { |
| 128 | + "vue-skuilder-studio": { |
| 129 | + "command": "./packages/cli/dist/mcp-server.js", |
| 130 | + "args": ["${STUDIO_DATABASE_NAME:-unpacked_default}", "${STUDIO_PORT:-5985}"], |
| 131 | + "env": { |
| 132 | + "COUCHDB_SERVER_URL": "${COUCHDB_SERVER_URL:-localhost:5985}", |
| 133 | + "COUCHDB_SERVER_PROTOCOL": "${COUCHDB_SERVER_PROTOCOL:-http}", |
| 134 | + "COUCHDB_USERNAME": "${COUCHDB_USERNAME:-admin}", |
| 135 | + "COUCHDB_PASSWORD": "${COUCHDB_PASSWORD:-password}" |
| 136 | + } |
| 137 | + } |
| 138 | + } |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +### Notes |
| 143 | + |
| 144 | +- **Local scope**: Configuration private to you in this project only |
| 145 | +- **Project scope**: Configuration shared with team via `.mcp.json` (should be committed to git) |
| 146 | +- **Direct file creation**: You can manually create/edit `.mcp.json` instead of using CLI commands - Claude Code reads this file on startup |
| 147 | +- **Studio integration**: Use `skuilder studio` output to get exact MCP connection parameters |
| 148 | +- **Dynamic databases**: Studio creates temporary databases with names like `unpacked_courseId_timestamp_hash` |
| 149 | +- Requires CouchDB to be running (studio command handles this automatically) |
| 150 | +- After configuration changes, restart Claude Code to load the new server |
| 151 | +- Claude Code will prompt for approval before using project-scoped servers from `.mcp.json` |
0 commit comments