feat: register ask_chatgpt MCP tool
This commit is contained in:
+22
-1
@@ -57,9 +57,30 @@ Total: 139 orchestration-only tests, all passing.
|
||||
|
||||
Minimal MCP stdio server in `src/server.js`. MCP initialize handshake succeeds. No tools registered yet.
|
||||
|
||||
### Task 5.2 - Register ask_chatgpt MCP tool ✅
|
||||
|
||||
`ask_chatgpt` is now registered as an MCP tool on the server (`src/server.js`).
|
||||
|
||||
**Registration details:**
|
||||
- Uses shared `baseInputSchema` (question required + context, constraints, expectedOutput, projectSummary, taskSummary, relevantFiles, logs optional).
|
||||
- All 3 external deps injected: `loadConfig`, `createOpenAIClient`, `sendOpenAIResponse`.
|
||||
- Returns structured MCP tool result: `{ content: [{ type: "text", text }], isError, warnings }`.
|
||||
|
||||
**Smoke test results (all passing):**
|
||||
- initialize → server returns `chatgpt-mcp` v0.1.0 ✅
|
||||
- tools/list → exposes `ask_chatgpt` with correct schema ✅
|
||||
- tools/call (happy path, mocked OpenAI) → `{ content: [...], isError: false }` with answer ✅
|
||||
- tools/call (minimal input `{ question: "hi" }`) → works ✅
|
||||
- tools/call (full input, all 10 schema fields) → handled correctly ✅
|
||||
- tools/call (missing OPENAI_API_KEY) → structured MCP error `"Error: Configuration error: OPENAI_API_KEY is missing."` ✅
|
||||
- tools/call (invalid API key) → structured MCP error `"OpenAI API error (OpenAIAuthError): 401"` ✅
|
||||
- All 523 unit tests pass across 18 test files ✅
|
||||
|
||||
**Production code (`src/server.js`):** ~39 lines, single `ask_chatgpt` tool registered with MCP via Stdio transport.
|
||||
|
||||
## Next Pending
|
||||
|
||||
### Task 5.2 - Register ask_chatgpt MCP tool
|
||||
### Task 5.3 - Register remaining MCP tools (review_plan, review_code, debug_issue, architecture_review)
|
||||
|
||||
## General Rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user