# AskMe Debug Tools
Debug tools for rapid UI development of the AskMe MCP server without requiring an MCP client.
## Overview
These tools simulate the behavior of each MCP tool by starting a mock server on port 3000, sending realistic test data, and outputting the formatted result that would be sent to the LLM.
## Available Tools
### 1. Ask One Question (`ask-one-question`)
Simulates a free-form question with realistic context about API architecture decisions.
### 2. Ask Multiple Choice (`ask-multiple-choice`)
Simulates multiple choice questions with priority ratings and comments for feature prioritization.
### 3. Challenge Hypothesis (`challenge-hypothesis`)
Simulates hypothesis evaluation with agreement levels (1-7 scale) for architectural decisions.
### 4. Choose Next (`choose-next`)
Simulates decision workflows with multiple strategic options for sprint planning.
## Usage
### Build First
```bash
npx nx build askme-debug-tools
```
### Run Individual Tools
```bash
# Using Nx targets (recommended)
npx nx debug:ask-one-question askme-debug-tools
npx nx debug:ask-multiple-choice askme-debug-tools
npx nx debug:challenge-hypothesis askme-debug-tools
npx nx debug:choose-next askme-debug-tools
# Or using the main CLI directly
node dist/askme-debug-tools/main.js ask-one-question
node dist/askme-debug-tools/main.js ask-multiple-choice
node dist/askme-debug-tools/main.js challenge-hypothesis
node dist/askme-debug-tools/main.js choose-next
```
### Interactive Development
```bash
# Terminal 1: Start debug tool
npx nx debug:ask-one-question askme-debug-tools
# Terminal 2: Start UI development server
npx nx serve askme-ui
# Browser: Open http://localhost:3000 to interact with mock data
```
## How It Works
1. **Mock Server**: Each script starts an HTTP server on port 3000 with browser bridge endpoints
2. **Test Data**: Realistic mock data is sent via Server-Sent Events (SSE)
3. **UI Interaction**: Open http://localhost:3000 to see and interact with the UI
4. **Auto Response**: If no UI response within timeout, uses mock human response
5. **LLM Output**: Formatted result is output to stdout, showing what the LLM would receive
6. **Clean Exit**: Server stops and process exits cleanly
## Mock Data Examples
### Ask One Question
- **Topic**: API architecture decision for authentication system
- **Context**: Microservices platform with specific requirements
- **Options**: Auth0/Okta, AWS Cognito, Custom JWT, Keycloak
### Ask Multiple Choice
- **Questions**: Feature prioritization, deployment environments, testing strategies
- **Format**: Priority ratings (-3 to +3) with detailed comments
### Challenge Hypothesis
- **Topic**: Monolith to microservices migration decision
- **Format**: 7-point agreement scale with detailed reasoning
### Choose Next
- **Topic**: Q4 sprint planning with 5 strategic options
- **Format**: Detailed options with icons, descriptions, and strategic context
## Development Benefits
- **Fast Iteration**: No need to set up MCP client connections
- **Realistic Data**: Production-quality test scenarios
- **UI Focus**: Test UI behavior with consistent, predictable data
- **Debug Friendly**: Easy to modify mock responses and timing
- **Standalone**: Works independently of the main MCP server
## File Structure
```
askme-debug-tools/src/
├── debug-ask-one-question.ts # Ask one question simulator
├── debug-ask-multiple-choice.ts # Multiple choice simulator
├── debug-challenge-hypothesis.ts # Hypothesis evaluation simulator
├── debug-choose-next.ts # Decision workflow simulator
├── main.ts # CLI dispatcher
└── shared/
├── mock-server.ts # HTTP server with SSE endpoints
├── mock-data.ts # Realistic test data
└── response-simulator.ts # Auto-response simulation
```
## Port Usage
- **Port 3000**: Mock server (matches real askme-server default)
- **Port 4200**: UI development server (Angular default)
## Tips
- Run the debug tool first, then start UI development server
- Use different terminals to see both debug output and UI logs
- Modify mock data in `shared/mock-data.ts` for different test scenarios
- Adjust response delays in individual debug scripts
- Check stdout for formatted LLM results, stderr for debug logs