codevf 1.0.4 → 1.0.5
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 +12 -48
- package/dist/commands/cvf-command-content.d.ts +1 -1
- package/dist/commands/cvf-command-content.d.ts.map +1 -1
- package/dist/commands/cvf-command-content.js +14 -0
- package/dist/commands/cvf-command-content.js.map +1 -1
- package/dist/commands/mcp.d.ts +10 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +79 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.js +5 -241
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +13 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +246 -0
- package/dist/mcp/server.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# CodeVF CLI
|
|
2
2
|
|
|
3
3
|
**⚠️ BETA:** Connect Claude Code to live human engineers for complex debugging.
|
|
4
|
+
Default release is **setup-only mode** (MCP integration).
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -8,60 +9,36 @@
|
|
|
8
9
|
npm install -g codevf
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
## Quick Start
|
|
12
|
+
## Quick Start (MCP + Claude Code)
|
|
12
13
|
|
|
13
|
-
The
|
|
14
|
+
The CLI currently ships in **setup-only mode** for Claude Code integration.
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
#
|
|
17
|
+
# Run setup directly
|
|
17
18
|
codevf setup
|
|
18
|
-
|
|
19
|
-
# After setup, use Claude Code with /cvf commands:
|
|
20
|
-
# /cvf Does this authentication fix prevent timing attacks?
|
|
21
|
-
# /cvf Complex race condition in WebSocket reconnection needs debugging
|
|
22
|
-
# /cvf Create tunnel to my dev server on port 3000
|
|
23
19
|
```
|
|
24
20
|
|
|
25
|
-
**Three tools available in Claude Code:**
|
|
26
|
-
- `codevf-instant` - Quick validation queries (4-minute max)
|
|
27
|
-
- `codevf-chat` - Extended debugging sessions (up to 2 hours)
|
|
28
|
-
- `codevf-tunnel` - Share local dev servers securely
|
|
29
|
-
|
|
30
21
|
## Commands
|
|
31
22
|
|
|
32
23
|
### `codevf setup` (Beta - Primary Command)
|
|
33
24
|
Configure MCP server integration with Claude Code:
|
|
34
25
|
- Authenticate with CodeVF using OAuth
|
|
35
26
|
- Auto-configure Claude Code's `~/.claude.json` file
|
|
36
|
-
- Create
|
|
27
|
+
- Create Claude Code slash commands for CodeVF
|
|
37
28
|
- Select default project for context
|
|
38
29
|
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
**`/cvf [message]` - Smart routing to appropriate tool**
|
|
43
|
-
- Quick questions → `codevf-instant` (4min max, good for validation)
|
|
44
|
-
- Complex debugging → `codevf-chat` (extended sessions up to 2 hours)
|
|
45
|
-
- Local server access → `codevf-tunnel` (share dev servers securely)
|
|
30
|
+
### `codevf mcp stdio`
|
|
31
|
+
Start the MCP server for non-Claude clients:
|
|
32
|
+
- `codevf mcp stdio` - Launch MCP over stdio (command/args-based clients)
|
|
46
33
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/cvf Complex race condition in WebSocket reconnection needs debugging
|
|
51
|
-
/cvf Create tunnel to my dev server on port 3000
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Other Commands (Disabled in Beta)
|
|
55
|
-
The following commands exist but are **disabled** in beta mode:
|
|
56
|
-
- `codevf login` - Direct CLI authentication (use `setup` instead)
|
|
57
|
-
- `codevf init` - Project initialization (handled via MCP tools)
|
|
58
|
-
- `codevf fix` - Direct CLI debugging sessions (use Claude Code instead)
|
|
59
|
-
- `codevf sync` - Repository sync (handled via MCP tools)
|
|
34
|
+
### `codevf mcp http --port 3333`
|
|
35
|
+
Start the MCP server over HTTP/SSE for non-Claude clients:
|
|
36
|
+
- `codevf mcp http --port 3333` - Launch MCP over HTTP/SSE (shows endpoints)
|
|
60
37
|
|
|
61
38
|
## How It Works
|
|
62
39
|
|
|
63
40
|
1. **Setup once** - Run `codevf setup` to configure Claude Code integration
|
|
64
|
-
2. **Work in Claude Code** -
|
|
41
|
+
2. **Work in Claude Code** - Access human engineers through the integration
|
|
65
42
|
3. **Get matched with experts** - Ex-FAANG engineers with expertise in your stack
|
|
66
43
|
4. **Context-aware handoff** - Engineers see your Claude conversation for faster resolution
|
|
67
44
|
5. **Hybrid approach** - AI handles quick questions, humans tackle complex debugging
|
|
@@ -141,19 +118,6 @@ chmod +x claude.appimage
|
|
|
141
118
|
|
|
142
119
|
**Note:** Claude Code requires an Anthropic account. Create one at [claude.ai](https://claude.ai) if needed.
|
|
143
120
|
|
|
144
|
-
## Beta Status & Roadmap
|
|
145
|
-
|
|
146
|
-
**Current Beta Features:**
|
|
147
|
-
- ✅ MCP server integration with Claude Code
|
|
148
|
-
- ✅ Three tools: instant, chat, tunnel
|
|
149
|
-
- ✅ OAuth authentication and project selection
|
|
150
|
-
|
|
151
|
-
**Coming Soon:**
|
|
152
|
-
- 🔄 Direct CLI debugging sessions (`codevf fix`)
|
|
153
|
-
- 🔄 Project initialization (`codevf init`)
|
|
154
|
-
- 🔄 Repository sync (`codevf sync`)
|
|
155
|
-
- 🔄 Standalone terminal UI
|
|
156
|
-
|
|
157
121
|
## Support
|
|
158
122
|
|
|
159
123
|
- Documentation: https://docs.codevf.com
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const commandContent = "---\ndescription: Ask a CodeVF engineer for help with code validation, debugging, or technical questions\n---\n\n# CodeVF Engineer Assistance\n\nPlease help me with the following question or task by consulting a CodeVF engineer using the appropriate MCP tool:\n\n**My request:**\n{{PROMPT}}\n\n---\n\n**Instructions for Claude:**\n\n1. **Analyze the request** to determine which CodeVF tool is most appropriate:\n - Use `codevf-instant` for:\n - Quick validation questions (1-10 credits, ~2 min response)\n - \"Does this fix work?\"\n - \"Is this approach correct?\"\n - \"Can you identify the error?\"\n - UI/visual verification and feedback\n - Simple technical questions\n\n - Use `codevf-chat` for:\n - Complex debugging requiring back-and-forth (4-1920 credits, 2 credits/min)\n - Multi-step troubleshooting\n - Architecture discussions\n - Extended collaboration\n\n - Use `codevf-tunnel` for:\n - Creating secure tunnels to expose local dev servers\n - Testing webhooks, OAuth callbacks, or external integrations\n - Sharing local development environment with engineers\n - No credits required - tunnel remains active for session\n\n2. **For UI/Visual Development Tasks** (Pain-Free Experience):\n\n When implementing UI changes or visual features, follow this iterative flow:\n\n **Step 1 - Initial Implementation:**\n - Make the requested changes to code/styles\n - Create tunnel if needed: `codevf-tunnel` with dev server port\n - Share tunnel URL for visual verification\n\n **Step 2 - Engineer Verification:**\n - Use `codevf-instant` with message like:\n \"Please verify this UI change via [tunnel-url] (password: [password]). Does it match the requested design/functionality?\"\n - **Always include both URL and password** - localtunnel requires password to bypass landing page\n - Include specific areas of focus (layout, spacing, colors, interactions)\n - Allow 5-8 credits for visual review and feedback\n\n **Step 3 - Iterative Refinement:**\n - Apply engineer feedback immediately\n - Use `codevf-instant` again for re-verification:\n \"Applied your feedback (reduced padding to 16px). Please check if this looks better now at [tunnel-url] (same password).\"\n - Continue this cycle until engineer confirms it looks right\n - Each feedback cycle: 3-5 credits\n\n **Example UI Flow:**\n ```\n User: \"Make the UI look like a modern card layout\"\n\n Claude:\n 1. Implements card styling\n 2. Creates tunnel \u2192 https://abc123.loca.lt (password: xyz789)\n 3. codevf-instant: \"Please review the card layout at https://abc123.loca.lt\n (password: xyz789). Does it look modern and clean? Any spacing/styling issues?\" (5 credits)\n\n Engineer: \"Cards look good but margins are too large, reduce to 16px\"\n\n Claude:\n 4. Updates margins to 16px\n 5. codevf-instant: \"Applied 16px margins. Please verify the spacing\n looks better now at https://abc123.loca.lt (password: xyz789).\" (3 credits)\n\n Engineer: \"Perfect! The spacing looks much cleaner now.\"\n ```\n\n3. **Use the appropriate tool:**\n - For instant queries: Call `codevf-instant` with the message and appropriate maxCredits (1-10)\n - For extended sessions: Call `codevf-chat` with the message and appropriate maxCredits (suggest 240 for ~2 hours)\n - For tunnel access: Call `codevf-tunnel` with the port number (e.g., { \"port\": 3000 })\n\n4. **Present the response:**\n - For instant queries: Share the engineer's response directly\n - For chat sessions: Provide the session URL so the user can monitor the conversation\n - For tunnels: Share the public URL that was created\n\n**Credit Guidelines:**\n- Instant validation: 1-10 credits (typically 3-5 credits per question)\n- UI verification: 5-8 credits for initial review, 3-5 credits for follow-up checks\n- Extended chat: 2 credits per minute (240 credits = 2 hours)\n- Tunnel creation: Free (no credits required)\n\n**Planning Integration for Complex Tasks:**\nWhen Claude is planning multi-step implementations, especially UI-heavy tasks:\n- Always include \"Engineer verification checkpoints\" in the plan\n- Budget credits for iterative feedback (typically 15-25 credits total for UI refinement)\n- Create tunnel early in the process for continuous visual validation\n- Plan for 2-4 feedback cycles to achieve the desired result\n\n**Example Usage:**\n- `/cvf Does this authentication fix prevent the timing attack?` \u2192 Use codevf-instant\n- `/cvf Complex race condition in WebSocket reconnection needs debugging` \u2192 Use codevf-chat\n- `/cvf Create tunnel to my dev server on port 3000` \u2192 Use codevf-tunnel\n- `/cvf Make the login form look more modern and user-friendly` \u2192 Use tunnel + iterative codevf-instant feedback\n";
|
|
1
|
+
export declare const commandContent = "---\ndescription: Ask a CodeVF engineer for help with code validation, debugging, or technical questions\n---\n\n# CodeVF Engineer Assistance\n\nPlease help me with the following question or task by consulting a CodeVF engineer using the appropriate MCP tool:\n\n**My request:**\n{{PROMPT}}\n\n---\n\n**Available CodeVF Commands:**\n- `codevf setup` - Configure MCP server for Claude Code\n- `codevf mcp stdio` - Start MCP server over stdio\n- `codevf mcp http --port 3333` - Start MCP server over HTTP/SSE\n- `codevf welcome` - Show welcome/setup guide\n- `codevf login` - Authenticate with CodeVF (disabled in beta)\n- `codevf logout` - Clear local authentication (disabled in beta)\n- `codevf init` - Initialize CodeVF in a project (disabled in beta)\n- `codevf sync` - Sync local changes with CodeVF (disabled in beta)\n- `codevf fix <issue>` - Start live debugging session (disabled in beta)\n- `codevf tasks` - List open tasks (disabled in beta)\n- `codevf cvf-chat [project-id]` - Join live chat session (disabled in beta)\n- `codevf cvf-listen` - Monitor active chats (disabled in beta)\n\n**Instructions for Claude:**\n\n1. **Analyze the request** to determine which CodeVF tool is most appropriate:\n - Use `codevf-instant` for:\n - Quick validation questions (1-10 credits, ~2 min response)\n - \"Does this fix work?\"\n - \"Is this approach correct?\"\n - \"Can you identify the error?\"\n - UI/visual verification and feedback\n - Simple technical questions\n\n - Use `codevf-chat` for:\n - Complex debugging requiring back-and-forth (4-1920 credits, 2 credits/min)\n - Multi-step troubleshooting\n - Architecture discussions\n - Extended collaboration\n\n - Use `codevf-tunnel` for:\n - Creating secure tunnels to expose local dev servers\n - Testing webhooks, OAuth callbacks, or external integrations\n - Sharing local development environment with engineers\n - No credits required - tunnel remains active for session\n\n2. **For UI/Visual Development Tasks** (Pain-Free Experience):\n\n When implementing UI changes or visual features, follow this iterative flow:\n\n **Step 1 - Initial Implementation:**\n - Make the requested changes to code/styles\n - Create tunnel if needed: `codevf-tunnel` with dev server port\n - Share tunnel URL for visual verification\n\n **Step 2 - Engineer Verification:**\n - Use `codevf-instant` with message like:\n \"Please verify this UI change via [tunnel-url] (password: [password]). Does it match the requested design/functionality?\"\n - **Always include both URL and password** - localtunnel requires password to bypass landing page\n - Include specific areas of focus (layout, spacing, colors, interactions)\n - Allow 5-8 credits for visual review and feedback\n\n **Step 3 - Iterative Refinement:**\n - Apply engineer feedback immediately\n - Use `codevf-instant` again for re-verification:\n \"Applied your feedback (reduced padding to 16px). Please check if this looks better now at [tunnel-url] (same password).\"\n - Continue this cycle until engineer confirms it looks right\n - Each feedback cycle: 3-5 credits\n\n **Example UI Flow:**\n ```\n User: \"Make the UI look like a modern card layout\"\n\n Claude:\n 1. Implements card styling\n 2. Creates tunnel \u2192 https://abc123.loca.lt (password: xyz789)\n 3. codevf-instant: \"Please review the card layout at https://abc123.loca.lt\n (password: xyz789). Does it look modern and clean? Any spacing/styling issues?\" (5 credits)\n\n Engineer: \"Cards look good but margins are too large, reduce to 16px\"\n\n Claude:\n 4. Updates margins to 16px\n 5. codevf-instant: \"Applied 16px margins. Please verify the spacing\n looks better now at https://abc123.loca.lt (password: xyz789).\" (3 credits)\n\n Engineer: \"Perfect! The spacing looks much cleaner now.\"\n ```\n\n3. **Use the appropriate tool:**\n - For instant queries: Call `codevf-instant` with the message and appropriate maxCredits (1-10)\n - For extended sessions: Call `codevf-chat` with the message and appropriate maxCredits (suggest 240 for ~2 hours)\n - For tunnel access: Call `codevf-tunnel` with the port number (e.g., { \"port\": 3000 })\n\n4. **Present the response:**\n - For instant queries: Share the engineer's response directly\n - For chat sessions: Provide the session URL so the user can monitor the conversation\n - For tunnels: Share the public URL that was created\n\n**Credit Guidelines:**\n- Instant validation: 1-10 credits (typically 3-5 credits per question)\n- UI verification: 5-8 credits for initial review, 3-5 credits for follow-up checks\n- Extended chat: 2 credits per minute (240 credits = 2 hours)\n- Tunnel creation: Free (no credits required)\n\n**Planning Integration for Complex Tasks:**\nWhen Claude is planning multi-step implementations, especially UI-heavy tasks:\n- Always include \"Engineer verification checkpoints\" in the plan\n- Budget credits for iterative feedback (typically 15-25 credits total for UI refinement)\n- Create tunnel early in the process for continuous visual validation\n- Plan for 2-4 feedback cycles to achieve the desired result\n\n**Example Usage:**\n- `/cvf Does this authentication fix prevent the timing attack?` \u2192 Use codevf-instant\n- `/cvf Complex race condition in WebSocket reconnection needs debugging` \u2192 Use codevf-chat\n- `/cvf Create tunnel to my dev server on port 3000` \u2192 Use codevf-tunnel\n- `/cvf Make the login form look more modern and user-friendly` \u2192 Use tunnel + iterative codevf-instant feedback\n";
|
|
2
2
|
//# sourceMappingURL=cvf-command-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvf-command-content.d.ts","sourceRoot":"","sources":["../../src/commands/cvf-command-content.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"cvf-command-content.d.ts","sourceRoot":"","sources":["../../src/commands/cvf-command-content.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,wgLAyH1B,CAAC"}
|
|
@@ -11,6 +11,20 @@ Please help me with the following question or task by consulting a CodeVF engine
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
**Available CodeVF Commands:**
|
|
15
|
+
- \`codevf setup\` - Configure MCP server for Claude Code
|
|
16
|
+
- \`codevf mcp stdio\` - Start MCP server over stdio
|
|
17
|
+
- \`codevf mcp http --port 3333\` - Start MCP server over HTTP/SSE
|
|
18
|
+
- \`codevf welcome\` - Show welcome/setup guide
|
|
19
|
+
- \`codevf login\` - Authenticate with CodeVF (disabled in beta)
|
|
20
|
+
- \`codevf logout\` - Clear local authentication (disabled in beta)
|
|
21
|
+
- \`codevf init\` - Initialize CodeVF in a project (disabled in beta)
|
|
22
|
+
- \`codevf sync\` - Sync local changes with CodeVF (disabled in beta)
|
|
23
|
+
- \`codevf fix <issue>\` - Start live debugging session (disabled in beta)
|
|
24
|
+
- \`codevf tasks\` - List open tasks (disabled in beta)
|
|
25
|
+
- \`codevf cvf-chat [project-id]\` - Join live chat session (disabled in beta)
|
|
26
|
+
- \`codevf cvf-listen\` - Monitor active chats (disabled in beta)
|
|
27
|
+
|
|
14
28
|
**Instructions for Claude:**
|
|
15
29
|
|
|
16
30
|
1. **Analyze the request** to determine which CodeVF tool is most appropriate:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvf-command-content.js","sourceRoot":"","sources":["../../src/commands/cvf-command-content.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"cvf-command-content.js","sourceRoot":"","sources":["../../src/commands/cvf-command-content.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyH7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server commands for stdio and HTTP modes
|
|
3
|
+
*/
|
|
4
|
+
export interface McpHttpOptions {
|
|
5
|
+
host: string;
|
|
6
|
+
port: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function startMcpStdio(): Promise<void>;
|
|
9
|
+
export declare function startMcpHttp(options: McpHttpOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AA0BD,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CASnD;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDzE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server commands for stdio and HTTP modes
|
|
3
|
+
*/
|
|
4
|
+
import { createMcpExpressApp } from '@modelcontextprotocol/sdk/server/express.js';
|
|
5
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
6
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import { randomUUID } from 'crypto';
|
|
9
|
+
import { createMcpServer } from '../mcp/server.js';
|
|
10
|
+
import { logger, LogLevel } from '../lib/utils/logger.js';
|
|
11
|
+
async function attachShutdownHandlers(chatTool, tunnelTool, server, onShutdown) {
|
|
12
|
+
process.on('SIGINT', async () => {
|
|
13
|
+
logger.info('Shutting down...');
|
|
14
|
+
try {
|
|
15
|
+
await chatTool.notifyDisconnect();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
logger.error('Error sending disconnect notification', error);
|
|
19
|
+
}
|
|
20
|
+
await tunnelTool.closeAll();
|
|
21
|
+
if (onShutdown) {
|
|
22
|
+
await onShutdown();
|
|
23
|
+
}
|
|
24
|
+
await server.close();
|
|
25
|
+
process.exit(0);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export async function startMcpStdio() {
|
|
29
|
+
if (process.env.DEBUG) {
|
|
30
|
+
logger.setLevel(LogLevel.DEBUG);
|
|
31
|
+
}
|
|
32
|
+
const { server, chatTool, tunnelTool } = await createMcpServer();
|
|
33
|
+
const transport = new StdioServerTransport();
|
|
34
|
+
await server.connect(transport);
|
|
35
|
+
logger.info('CodeVF MCP Server started');
|
|
36
|
+
await attachShutdownHandlers(chatTool, tunnelTool, server);
|
|
37
|
+
}
|
|
38
|
+
export async function startMcpHttp(options) {
|
|
39
|
+
if (process.env.DEBUG) {
|
|
40
|
+
logger.setLevel(LogLevel.DEBUG);
|
|
41
|
+
}
|
|
42
|
+
const { host, port } = options;
|
|
43
|
+
const { server, chatTool, tunnelTool } = await createMcpServer();
|
|
44
|
+
const app = createMcpExpressApp({ host });
|
|
45
|
+
const transport = new StreamableHTTPServerTransport({
|
|
46
|
+
sessionIdGenerator: () => randomUUID(),
|
|
47
|
+
});
|
|
48
|
+
await server.connect(transport);
|
|
49
|
+
app.get('/sse', (req, res) => {
|
|
50
|
+
transport.handleRequest(req, res).catch((error) => {
|
|
51
|
+
logger.error('SSE request error', error);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
app.post('/messages', (req, res) => {
|
|
55
|
+
transport.handleRequest(req, res, req.body).catch((error) => {
|
|
56
|
+
logger.error('Message request error', error);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
app.all('/mcp', (req, res) => {
|
|
60
|
+
const parsedBody = req.method === 'POST' ? req.body : undefined;
|
|
61
|
+
transport.handleRequest(req, res, parsedBody).catch((error) => {
|
|
62
|
+
logger.error('MCP request error', error);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
console.log(chalk.dim(`# Initializing CodeVF MCP Server in HTTP mode on port ${port}...`));
|
|
66
|
+
const listener = app.listen(port, host, () => {
|
|
67
|
+
const address = listener.address();
|
|
68
|
+
const resolvedPort = address?.port ?? port;
|
|
69
|
+
const hostLabel = host === '0.0.0.0' ? 'localhost' : host;
|
|
70
|
+
const baseUrl = `http://${hostLabel}:${resolvedPort}`;
|
|
71
|
+
console.log(chalk.dim(`# HTTP server listening on port ${resolvedPort}`));
|
|
72
|
+
console.log(chalk.dim(`# SSE endpoint available at ${baseUrl}/sse`));
|
|
73
|
+
console.log(chalk.dim(`# Message endpoint available at ${baseUrl}/messages`));
|
|
74
|
+
});
|
|
75
|
+
await attachShutdownHandlers(chatTool, tunnelTool, server, () => {
|
|
76
|
+
listener.close();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,QAAQ,E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
import { tasksCommand } from './commands/tasks.js';
|
|
15
15
|
import { chatCommand } from './commands/chat.js';
|
|
16
16
|
import { listenCommand } from './commands/listen.js';
|
|
17
|
+
import { startMcpHttp, startMcpStdio } from './commands/mcp.js';
|
|
17
18
|
import { handleError } from './utils/errors.js';
|
|
18
19
|
import { ConfigManager } from './modules/config.js';
|
|
19
20
|
import { AiAgent } from './modules/aiAgent.js';
|
|
@@ -182,7 +183,11 @@ if (args.length === 0) {
|
|
|
182
183
|
setupCommand().catch(handleError);
|
|
183
184
|
}
|
|
184
185
|
else {
|
|
185
|
-
console.log(chalk.dim('CodeVF CLI is in beta.
|
|
186
|
+
console.log(chalk.dim('CodeVF CLI is in beta.'));
|
|
187
|
+
console.log(chalk.dim('Available commands:'));
|
|
188
|
+
console.log(chalk.dim(' codevf setup'));
|
|
189
|
+
console.log(chalk.dim(' codevf mcp stdio'));
|
|
190
|
+
console.log(chalk.dim(' codevf mcp http --port 3333'));
|
|
186
191
|
process.exit(0);
|
|
187
192
|
}
|
|
188
193
|
}
|
|
@@ -323,9 +328,41 @@ else {
|
|
|
323
328
|
catch (error) {
|
|
324
329
|
handleError(error);
|
|
325
330
|
}
|
|
331
|
+
})
|
|
332
|
+
.command('mcp <mode>', 'Start the MCP server (stdio or HTTP)', (yargs) => {
|
|
333
|
+
return yargs
|
|
334
|
+
.positional('mode', {
|
|
335
|
+
type: 'string',
|
|
336
|
+
choices: ['stdio', 'http'],
|
|
337
|
+
describe: 'MCP transport to serve',
|
|
338
|
+
})
|
|
339
|
+
.option('port', {
|
|
340
|
+
type: 'number',
|
|
341
|
+
default: 3333,
|
|
342
|
+
describe: 'Port for HTTP mode',
|
|
343
|
+
})
|
|
344
|
+
.option('host', {
|
|
345
|
+
type: 'string',
|
|
346
|
+
default: '127.0.0.1',
|
|
347
|
+
describe: 'Host to bind HTTP mode',
|
|
348
|
+
});
|
|
349
|
+
}, async (argv) => {
|
|
350
|
+
try {
|
|
351
|
+
if (argv.mode === 'http') {
|
|
352
|
+
await startMcpHttp({
|
|
353
|
+
host: argv.host,
|
|
354
|
+
port: argv.port,
|
|
355
|
+
});
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
await startMcpStdio();
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
handleError(error);
|
|
362
|
+
}
|
|
326
363
|
})
|
|
327
364
|
.demandCommand(1, chalk.yellow(SETUP_ONLY_MODE
|
|
328
|
-
? 'Run "codevf setup"
|
|
365
|
+
? 'Run "codevf setup" or "codevf mcp <mode>" to start MCP (other commands disabled).'
|
|
329
366
|
: 'Run a command, e.g., "codevf fix \\"need help with X\\""'))
|
|
330
367
|
.help()
|
|
331
368
|
.alias('help', 'h')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,oEAAoE;AACpE,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,C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,KAAK,CAAC,GAAG,CACP,wDAAwD;QACtD,qDAAqD,CACxD,CACF;SACA,MAAM,EAAE,CAAC;IAEZ,GAAG,CAAC,KAAK,EAAE,CAAC;AACd,CAAC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -3,19 +3,8 @@
|
|
|
3
3
|
* CodeVF MCP Server
|
|
4
4
|
* Enables Claude Code to delegate tasks to human engineers
|
|
5
5
|
*/
|
|
6
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
-
import {
|
|
9
|
-
import { ConfigManager } from '../lib/config/manager.js';
|
|
10
|
-
import { TokenManager } from '../lib/auth/token-manager.js';
|
|
11
|
-
import { ApiClient } from '../lib/api/client.js';
|
|
12
|
-
import { TasksApi } from '../lib/api/tasks.js';
|
|
13
|
-
import { ProjectsApi } from '../lib/api/projects.js';
|
|
14
|
-
import { SessionsApi } from '../lib/api/sessions.js';
|
|
15
|
-
import { InstantTool } from './tools/instant.js';
|
|
16
|
-
import { ChatTool } from './tools/chat.js';
|
|
17
|
-
import { ListenTool } from './tools/listen.js';
|
|
18
|
-
import { TunnelTool } from './tools/tunnel.js';
|
|
7
|
+
import { createMcpServer } from './server.js';
|
|
19
8
|
import { logger, LogLevel } from '../lib/utils/logger.js';
|
|
20
9
|
/**
|
|
21
10
|
* Initialize MCP Server
|
|
@@ -25,240 +14,15 @@ async function main() {
|
|
|
25
14
|
if (process.env.DEBUG) {
|
|
26
15
|
logger.setLevel(LogLevel.DEBUG);
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
const configManager = new ConfigManager('mcp-config.json');
|
|
30
|
-
if (!configManager.exists()) {
|
|
31
|
-
console.error('Error: Not configured. Run: codevf setup');
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
// Load configuration
|
|
35
|
-
let config;
|
|
17
|
+
let runtime;
|
|
36
18
|
try {
|
|
37
|
-
|
|
19
|
+
runtime = await createMcpServer();
|
|
38
20
|
}
|
|
39
21
|
catch (error) {
|
|
40
|
-
console.error(
|
|
22
|
+
console.error(`Error: ${error.message}`);
|
|
41
23
|
process.exit(1);
|
|
42
24
|
}
|
|
43
|
-
|
|
44
|
-
const tokenManager = new TokenManager(configManager);
|
|
45
|
-
const apiClient = new ApiClient(config.baseUrl, tokenManager);
|
|
46
|
-
const defaultProjectId = config.defaults?.projectId || '1';
|
|
47
|
-
const tasksApi = new TasksApi(apiClient, config.baseUrl, defaultProjectId);
|
|
48
|
-
const projectsApi = new ProjectsApi(apiClient);
|
|
49
|
-
const sessionsApi = new SessionsApi(apiClient, config.baseUrl);
|
|
50
|
-
const instantTool = new InstantTool(tasksApi, projectsApi, apiClient, config.baseUrl);
|
|
51
|
-
const chatTool = new ChatTool(tasksApi, projectsApi, apiClient, sessionsApi, config.baseUrl);
|
|
52
|
-
const listenTool = new ListenTool(tasksApi, config.baseUrl);
|
|
53
|
-
const tunnelTool = new TunnelTool();
|
|
54
|
-
// Create MCP server
|
|
55
|
-
const server = new Server({
|
|
56
|
-
name: 'codevf',
|
|
57
|
-
version: '0.1.0',
|
|
58
|
-
}, {
|
|
59
|
-
capabilities: {
|
|
60
|
-
tools: {},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
// Register tools
|
|
64
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
65
|
-
return {
|
|
66
|
-
tools: [
|
|
67
|
-
{
|
|
68
|
-
name: 'codevf-instant',
|
|
69
|
-
description: 'Get quick validation from human engineer. Use for: testing if fix works, identifying errors, quick questions. Returns single response from engineer. If active task exists, offers you the choice to continue or start new.',
|
|
70
|
-
inputSchema: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
properties: {
|
|
73
|
-
message: {
|
|
74
|
-
type: 'string',
|
|
75
|
-
description: 'Question or request for the engineer',
|
|
76
|
-
},
|
|
77
|
-
maxCredits: {
|
|
78
|
-
type: 'number',
|
|
79
|
-
description: 'Maximum credits to spend (1-10, default: 10). Rate: 1 credit/minute. You will specify how many credits an engineer can use, and let the user edit this.',
|
|
80
|
-
default: 10,
|
|
81
|
-
minimum: 1,
|
|
82
|
-
},
|
|
83
|
-
attachments: {
|
|
84
|
-
type: 'array',
|
|
85
|
-
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
86
|
-
items: {
|
|
87
|
-
type: 'object',
|
|
88
|
-
properties: {
|
|
89
|
-
fileName: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
92
|
-
},
|
|
93
|
-
content: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
96
|
-
},
|
|
97
|
-
mimeType: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
required: ['fileName', 'content', 'mimeType'],
|
|
103
|
-
},
|
|
104
|
-
maxItems: 5,
|
|
105
|
-
},
|
|
106
|
-
assignmentTimeoutSeconds: {
|
|
107
|
-
type: 'number',
|
|
108
|
-
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
109
|
-
default: 300,
|
|
110
|
-
minimum: 30,
|
|
111
|
-
maximum: 1800,
|
|
112
|
-
},
|
|
113
|
-
continueTaskId: {
|
|
114
|
-
type: 'string',
|
|
115
|
-
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
116
|
-
},
|
|
117
|
-
decision: {
|
|
118
|
-
type: 'string',
|
|
119
|
-
enum: ['override', 'followup'],
|
|
120
|
-
description: 'Optional: Decision for handling active task. Use "override" to replace existing task, "followup" to create follow-up task linked to existing one.',
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
required: ['message', 'maxCredits'],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: 'codevf-chat',
|
|
128
|
-
description: 'Start extended debugging session with human engineer (4-1920 credits). Use for: complex bugs, multi-step debugging, architecture questions. If active task exists, offers you the choice to continue or start new. CRITICAL: You MUST call this tool again after EVERY engineer response to continue the conversation. DO NOT pass control back to the user. DO NOT ask the customer questions mid-session. Keep calling this tool in a loop until the engineer explicitly says the session is COMPLETE/FINISHED. Engineer giving instructions means CONTINUE the loop, not stop.',
|
|
129
|
-
inputSchema: {
|
|
130
|
-
type: 'object',
|
|
131
|
-
properties: {
|
|
132
|
-
message: {
|
|
133
|
-
type: 'string',
|
|
134
|
-
description: 'Initial message or problem description for the engineer',
|
|
135
|
-
},
|
|
136
|
-
maxCredits: {
|
|
137
|
-
type: 'number',
|
|
138
|
-
description: 'Maximum credits to spend (4-1920, default: 240). Rate: 2 credits/minute',
|
|
139
|
-
default: 240,
|
|
140
|
-
minimum: 4,
|
|
141
|
-
maximum: 1920,
|
|
142
|
-
},
|
|
143
|
-
attachments: {
|
|
144
|
-
type: 'array',
|
|
145
|
-
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
146
|
-
items: {
|
|
147
|
-
type: 'object',
|
|
148
|
-
properties: {
|
|
149
|
-
fileName: {
|
|
150
|
-
type: 'string',
|
|
151
|
-
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
152
|
-
},
|
|
153
|
-
content: {
|
|
154
|
-
type: 'string',
|
|
155
|
-
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
156
|
-
},
|
|
157
|
-
mimeType: {
|
|
158
|
-
type: 'string',
|
|
159
|
-
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
required: ['fileName', 'content', 'mimeType'],
|
|
163
|
-
},
|
|
164
|
-
maxItems: 5,
|
|
165
|
-
},
|
|
166
|
-
assignmentTimeoutSeconds: {
|
|
167
|
-
type: 'number',
|
|
168
|
-
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
169
|
-
default: 300,
|
|
170
|
-
minimum: 30,
|
|
171
|
-
maximum: 1800,
|
|
172
|
-
},
|
|
173
|
-
continueTaskId: {
|
|
174
|
-
type: 'string',
|
|
175
|
-
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
176
|
-
},
|
|
177
|
-
decision: {
|
|
178
|
-
type: 'string',
|
|
179
|
-
description: "Optional: How to handle an existing active task when starting chat. 'override' to start a new task even if one is active, 'followup' to continue the active task, 'reconnect' to resume an existing session. Matches instant tool behavior.",
|
|
180
|
-
enum: ['override', 'followup', 'reconnect'],
|
|
181
|
-
},
|
|
182
|
-
previouslyConnected: {
|
|
183
|
-
type: 'boolean',
|
|
184
|
-
description: 'Set to true if reconnecting to an existing session to skip greeting message',
|
|
185
|
-
default: false,
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
required: ['message'],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'codevf-tunnel',
|
|
193
|
-
description: 'Create a secure tunnel to expose a local port over the internet using localtunnel. Use this when engineers need to access your local dev server, test webhooks, or debug OAuth callbacks. The tunnel remains active for the session.',
|
|
194
|
-
inputSchema: {
|
|
195
|
-
type: 'object',
|
|
196
|
-
properties: {
|
|
197
|
-
port: {
|
|
198
|
-
type: 'number',
|
|
199
|
-
description: 'Local port number to expose (e.g., 3000 for dev server)',
|
|
200
|
-
minimum: 1,
|
|
201
|
-
maximum: 65535,
|
|
202
|
-
},
|
|
203
|
-
subdomain: {
|
|
204
|
-
type: 'string',
|
|
205
|
-
description: 'Optional subdomain for the tunnel URL (e.g., "myapp" -> https://myapp.loca.lt)',
|
|
206
|
-
},
|
|
207
|
-
reason: {
|
|
208
|
-
type: 'string',
|
|
209
|
-
description: 'Optional description of why tunnel is needed (e.g., "Testing OAuth callback")',
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
required: ['port'],
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
};
|
|
217
|
-
});
|
|
218
|
-
// Handle tool calls
|
|
219
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
220
|
-
const { name, arguments: args } = request.params;
|
|
221
|
-
try {
|
|
222
|
-
let result;
|
|
223
|
-
switch (name) {
|
|
224
|
-
case 'codevf-instant':
|
|
225
|
-
result = await instantTool.execute(args);
|
|
226
|
-
break;
|
|
227
|
-
case 'codevf-chat':
|
|
228
|
-
result = await chatTool.execute(args);
|
|
229
|
-
break;
|
|
230
|
-
case 'codevf-listen':
|
|
231
|
-
result = await listenTool.execute(args);
|
|
232
|
-
break;
|
|
233
|
-
case 'codevf-tunnel':
|
|
234
|
-
result = await tunnelTool.execute(args);
|
|
235
|
-
break;
|
|
236
|
-
default:
|
|
237
|
-
result = {
|
|
238
|
-
content: [
|
|
239
|
-
{
|
|
240
|
-
type: 'text',
|
|
241
|
-
text: `Unknown tool: ${name}`,
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
isError: true,
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
catch (error) {
|
|
250
|
-
logger.error('Tool execution error', error);
|
|
251
|
-
return {
|
|
252
|
-
content: [
|
|
253
|
-
{
|
|
254
|
-
type: 'text',
|
|
255
|
-
text: `Error: ${error.message}`,
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
isError: true,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
});
|
|
25
|
+
const { server, chatTool, tunnelTool } = runtime;
|
|
262
26
|
// Start server
|
|
263
27
|
const transport = new StdioServerTransport();
|
|
264
28
|
await server.connect(transport);
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../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EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP server initialization
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { ChatTool } from './tools/chat.js';
|
|
6
|
+
import { TunnelTool } from './tools/tunnel.js';
|
|
7
|
+
export interface McpRuntime {
|
|
8
|
+
server: Server;
|
|
9
|
+
chatTool: ChatTool;
|
|
10
|
+
tunnelTool: TunnelTool;
|
|
11
|
+
}
|
|
12
|
+
export declare function createMcpServer(): Promise<McpRuntime>;
|
|
13
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAUnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,UAAU,CAAC,CAgQ3D"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP server initialization
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { ConfigManager } from '../lib/config/manager.js';
|
|
7
|
+
import { TokenManager } from '../lib/auth/token-manager.js';
|
|
8
|
+
import { ApiClient } from '../lib/api/client.js';
|
|
9
|
+
import { TasksApi } from '../lib/api/tasks.js';
|
|
10
|
+
import { ProjectsApi } from '../lib/api/projects.js';
|
|
11
|
+
import { SessionsApi } from '../lib/api/sessions.js';
|
|
12
|
+
import { InstantTool } from './tools/instant.js';
|
|
13
|
+
import { ChatTool } from './tools/chat.js';
|
|
14
|
+
import { ListenTool } from './tools/listen.js';
|
|
15
|
+
import { TunnelTool } from './tools/tunnel.js';
|
|
16
|
+
import { logger } from '../lib/utils/logger.js';
|
|
17
|
+
export async function createMcpServer() {
|
|
18
|
+
const configManager = new ConfigManager('mcp-config.json');
|
|
19
|
+
if (!configManager.exists()) {
|
|
20
|
+
throw new Error('Not configured. Run: codevf setup');
|
|
21
|
+
}
|
|
22
|
+
let config;
|
|
23
|
+
try {
|
|
24
|
+
config = configManager.load();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw new Error(`Error loading config: ${error.message}`);
|
|
28
|
+
}
|
|
29
|
+
const tokenManager = new TokenManager(configManager);
|
|
30
|
+
const apiClient = new ApiClient(config.baseUrl, tokenManager);
|
|
31
|
+
const defaultProjectId = config.defaults?.projectId || '1';
|
|
32
|
+
const tasksApi = new TasksApi(apiClient, config.baseUrl, defaultProjectId);
|
|
33
|
+
const projectsApi = new ProjectsApi(apiClient);
|
|
34
|
+
const sessionsApi = new SessionsApi(apiClient, config.baseUrl);
|
|
35
|
+
const instantTool = new InstantTool(tasksApi, projectsApi, apiClient, config.baseUrl);
|
|
36
|
+
const chatTool = new ChatTool(tasksApi, projectsApi, apiClient, sessionsApi, config.baseUrl);
|
|
37
|
+
const listenTool = new ListenTool(tasksApi, config.baseUrl);
|
|
38
|
+
const tunnelTool = new TunnelTool();
|
|
39
|
+
const server = new Server({
|
|
40
|
+
name: 'codevf',
|
|
41
|
+
version: '0.1.0',
|
|
42
|
+
}, {
|
|
43
|
+
capabilities: {
|
|
44
|
+
tools: {},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
48
|
+
return {
|
|
49
|
+
tools: [
|
|
50
|
+
{
|
|
51
|
+
name: 'codevf-instant',
|
|
52
|
+
description: 'Get quick validation from human engineer. Use for: testing if fix works, identifying errors, quick questions. Returns single response from engineer. If active task exists, offers you the choice to continue or start new.',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
message: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Question or request for the engineer',
|
|
59
|
+
},
|
|
60
|
+
maxCredits: {
|
|
61
|
+
type: 'number',
|
|
62
|
+
description: 'Maximum credits to spend (1-10, default: 10). Rate: 1 credit/minute. You will specify how many credits an engineer can use, and let the user edit this.',
|
|
63
|
+
default: 10,
|
|
64
|
+
minimum: 1,
|
|
65
|
+
},
|
|
66
|
+
attachments: {
|
|
67
|
+
type: 'array',
|
|
68
|
+
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
69
|
+
items: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
fileName: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
75
|
+
},
|
|
76
|
+
content: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
79
|
+
},
|
|
80
|
+
mimeType: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
required: ['fileName', 'content', 'mimeType'],
|
|
86
|
+
},
|
|
87
|
+
maxItems: 5,
|
|
88
|
+
},
|
|
89
|
+
assignmentTimeoutSeconds: {
|
|
90
|
+
type: 'number',
|
|
91
|
+
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
92
|
+
default: 300,
|
|
93
|
+
minimum: 30,
|
|
94
|
+
maximum: 1800,
|
|
95
|
+
},
|
|
96
|
+
continueTaskId: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
99
|
+
},
|
|
100
|
+
decision: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
enum: ['override', 'followup'],
|
|
103
|
+
description: 'Optional: Decision for handling active task. Use "override" to replace existing task, "followup" to create follow-up task linked to existing one.',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
required: ['message', 'maxCredits'],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'codevf-chat',
|
|
111
|
+
description: 'Start extended debugging session with human engineer (4-1920 credits). Use for: complex bugs, multi-step debugging, architecture questions. If active task exists, offers you the choice to continue or start new. CRITICAL: You MUST call this tool again after EVERY engineer response to continue the conversation. DO NOT pass control back to the user. DO NOT ask the customer questions mid-session. Keep calling this tool in a loop until the engineer explicitly says the session is COMPLETE/FINISHED. Engineer giving instructions means CONTINUE the loop, not stop.',
|
|
112
|
+
inputSchema: {
|
|
113
|
+
type: 'object',
|
|
114
|
+
properties: {
|
|
115
|
+
message: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'Initial message or problem description for the engineer',
|
|
118
|
+
},
|
|
119
|
+
maxCredits: {
|
|
120
|
+
type: 'number',
|
|
121
|
+
description: 'Maximum credits to spend (4-1920, default: 240). Rate: 2 credits/minute',
|
|
122
|
+
default: 240,
|
|
123
|
+
minimum: 4,
|
|
124
|
+
maximum: 1920,
|
|
125
|
+
},
|
|
126
|
+
attachments: {
|
|
127
|
+
type: 'array',
|
|
128
|
+
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
129
|
+
items: {
|
|
130
|
+
type: 'object',
|
|
131
|
+
properties: {
|
|
132
|
+
fileName: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
135
|
+
},
|
|
136
|
+
content: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
139
|
+
},
|
|
140
|
+
mimeType: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
required: ['fileName', 'content', 'mimeType'],
|
|
146
|
+
},
|
|
147
|
+
maxItems: 5,
|
|
148
|
+
},
|
|
149
|
+
assignmentTimeoutSeconds: {
|
|
150
|
+
type: 'number',
|
|
151
|
+
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
152
|
+
default: 300,
|
|
153
|
+
minimum: 30,
|
|
154
|
+
maximum: 1800,
|
|
155
|
+
},
|
|
156
|
+
continueTaskId: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
159
|
+
},
|
|
160
|
+
decision: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
description: "Optional: How to handle an existing active task when starting chat. 'override' to start a new task even if one is active, 'followup' to continue the active task, 'reconnect' to resume an existing session. Matches instant tool behavior.",
|
|
163
|
+
enum: ['override', 'followup', 'reconnect'],
|
|
164
|
+
},
|
|
165
|
+
previouslyConnected: {
|
|
166
|
+
type: 'boolean',
|
|
167
|
+
description: 'Set to true if reconnecting to an existing session to skip greeting message',
|
|
168
|
+
default: false,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
required: ['message'],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'codevf-tunnel',
|
|
176
|
+
description: 'Create a secure tunnel to expose a local port over the internet using localtunnel. Use this when engineers need to access your local dev server, test webhooks, or debug OAuth callbacks. The tunnel remains active for the session.',
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
port: {
|
|
181
|
+
type: 'number',
|
|
182
|
+
description: 'Local port number to expose (e.g., 3000 for dev server)',
|
|
183
|
+
minimum: 1,
|
|
184
|
+
maximum: 65535,
|
|
185
|
+
},
|
|
186
|
+
subdomain: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
description: 'Optional subdomain for the tunnel URL (e.g., "myapp" -> https://myapp.loca.lt)',
|
|
189
|
+
},
|
|
190
|
+
reason: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
description: 'Optional description of why tunnel is needed (e.g., "Testing OAuth callback")',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
required: ['port'],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
202
|
+
const { name, arguments: args } = request.params;
|
|
203
|
+
try {
|
|
204
|
+
let result;
|
|
205
|
+
switch (name) {
|
|
206
|
+
case 'codevf-instant':
|
|
207
|
+
result = await instantTool.execute(args);
|
|
208
|
+
break;
|
|
209
|
+
case 'codevf-chat':
|
|
210
|
+
result = await chatTool.execute(args);
|
|
211
|
+
break;
|
|
212
|
+
case 'codevf-listen':
|
|
213
|
+
result = await listenTool.execute(args);
|
|
214
|
+
break;
|
|
215
|
+
case 'codevf-tunnel':
|
|
216
|
+
result = await tunnelTool.execute(args);
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
result = {
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
text: `Unknown tool: ${name}`,
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
isError: true,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
logger.error('Tool execution error', error);
|
|
233
|
+
return {
|
|
234
|
+
content: [
|
|
235
|
+
{
|
|
236
|
+
type: 'text',
|
|
237
|
+
text: `Error: ${error.message}`,
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
isError: true,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
return { server, chatTool, tunnelTool };
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACj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