1.5 KiB
1.5 KiB
Prompt 04: Fix MCP Server Build
Context
You are working in /workspaces/claude-code/mcp-server/. This is a separate sub-project that provides an MCP (Model Context Protocol) server for exploring the Claude Code source. It's a simpler, self-contained TypeScript project.
Currently npm run build (which runs tsc) fails with TypeScript errors.
Task
-
Run the build and capture errors:
cd /workspaces/claude-code/mcp-server npm run build 2>&1 -
Fix all TypeScript errors in
mcp-server/src/server.tsandmcp-server/src/index.ts. Common issues include:- Duplicate function implementations
- Missing imports
- Type mismatches with the MCP SDK types
-
Verify the fix:
npm run buildShould complete with zero errors and produce output in
mcp-server/dist/. -
Test the MCP server runs:
node dist/index.js --help 2>&1 || node dist/index.js 2>&1 | head -5It may hang waiting for stdio input (that's normal for an MCP server) — just verify it starts without crashing.
Key Files
mcp-server/package.json— build script and dependenciesmcp-server/tsconfig.json— TypeScript configmcp-server/src/server.ts— Main server logic (tools, resources, prompts)mcp-server/src/index.ts— Entrypoint (stdio transport)
Verification
cd mcp-server && npm run buildsucceeds with zero errorsls mcp-server/dist/shows compiled.jsfilesnode mcp-server/dist/index.jsstarts without immediate crash