Feature: 033-typescript-code-execution
# 1. Switch to feature branch
git checkout 033-typescript-code-execution
# 2. Add esbuild dependency
go get github.com/evanw/esbuild
# 3. Verify build
go build ./cmd/mcpproxy
# 4. Run tests
go test ./internal/jsruntime/... -v -race
go test ./internal/server/... -v -race
go test ./internal/httpapi/... -v -race- internal/jsruntime/typescript.go - Transpilation layer (new file)
- internal/jsruntime/typescript_test.go - Unit tests (new file)
- internal/jsruntime/errors.go - Add
ErrorCodeTranspileError - internal/jsruntime/runtime.go - Add
LanguagetoExecutionOptions, call transpiler - internal/jsruntime/runtime_test.go - TypeScript execution tests
- internal/server/mcp.go - Add
languageto tool schema - internal/server/mcp_code_execution.go - Parse language parameter
- internal/server/mcp_code_execution_test.go - MCP integration tests
- internal/httpapi/code_exec.go - Add
Languageto request struct - internal/httpapi/code_exec_test.go - REST API tests
- cmd/mcpproxy/code_cmd.go - Add
--languageflag - docs/ - Update documentation
# Build
go build -o mcpproxy ./cmd/mcpproxy
# Test TypeScript via CLI (requires code_execution enabled in config)
./mcpproxy code exec --language typescript --code "const x: number = 42; ({ result: x })"
# Expected: {"ok": true, "value": {"result": 42}}
# Test JavaScript still works (backward compat)
./mcpproxy code exec --code "({ result: input.value * 2 })" --input='{"value": 21}'
# Expected: {"ok": true, "value": {"result": 42}}internal/jsruntime/runtime.go- Current execution flow (understandExecute()function)internal/server/mcp.golines 448-466 - Tool schema registrationinternal/server/mcp_code_execution.go- MCP handler (language parameter parsing goes here)internal/httpapi/code_exec.go- REST API handlercmd/mcpproxy/code_cmd.go- CLI command