04-fix-mcp-server — Claude Code prompt: fix the MCP server build
04-fix-mcp-server — a Claude prompt that runs the TypeScript build in mcp-server/, repairs compiler errors in server.ts and index.ts, then checks the server starts.
no license ★ 3,444 updated 2026-10-14
.claude/commands/04-fix-mcp-server.mdWhat 04-fix-mcp-server does
Point it at a checkout that has the mcp-server/ subproject, the small TypeScript project behind the MCP server for reading Claude sources. The prompt begins with npm run build to collect tsc output, then works through what broke in mcp-server/src/server.ts and mcp-server/src/index.ts. Expect duplicated function bodies, imports nobody added, and types that do not line up with the MCP SDK.
A second build should finish clean and leave .js files in mcp-server/dist/. Starting node dist/index.js --help is the smoke test. A process that sits there waiting on stdio input behaves normally, so the only thing to watch for is an immediate crash.
The tail of the file handles a rejected git push. A GitHub OAuth token sits in .mcpregistry_github_token inside commits 5e99ad6 and 7adaa5d, and deleting the file from disk does nothing while those commits remain. Two routes are spelled out: a git filter-branch pass with --index-filter over HEAD~5..HEAD, or an interactive rebase you stop at each commit. Both finish by adding the token filenames to .gitignore.
What it helps with
- get
npm run buildpassing inmcp-server/ - clear duplicate functions and missing imports in
server.ts - confirm the compiled MCP server boots without crashing
- strip a leaked OAuth token out of git history
- keep token files out of later commits with
.gitignore
Example prompts for the agent
/04-fix-mcp-serverthe build inmcp-server/is red, sort out the TypeScript errors and getnpm run buildclean.- Run
/04-fix-mcp-serverand check thatnode mcp-server/dist/index.jsstarts without crashing. /04-fix-mcp-servermy push is blocked by a token in old commits, rewrite them.
How to install 04-fix-mcp-server
Manually: put the files in place
.claude/commands/04-fix-mcp-server.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 04-fix-mcp-server
How do I install 04-fix-mcp-server in Claude Code?
Place the file at .claude/commands/04-fix-mcp-server.md inside your project. It then runs as /04-fix-mcp-server.
What does 04-fix-mcp-server do?
It builds mcp-server/, fixes the TypeScript errors in server.ts and index.ts, and confirms the server starts. The second half of the prompt removes an OAuth token from git history.
What do I need before running it?
A repository containing the mcp-server/ subproject, with package.json holding the build script, a tsconfig.json, and sources under src/.