Skip to main content
prompt GP ChatGPT

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/04-fix-mcp-server.md
Open on GitHub

What 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 build passing in mcp-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-server the build in mcp-server/ is red, sort out the TypeScript errors and get npm run build clean.
  • Run /04-fix-mcp-server and check that node mcp-server/dist/index.js starts without crashing.
  • /04-fix-mcp-server my 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.md

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/.

Similar prompts

All prompts for Agent setup: memory, context, orchestration →

From the same set17

The whole set →
00-overview The 00-overview prompt lays out a 16-step workflow for building a CLI, from Bun setup through production packaging and tests. Use it to split the work into separate chat sessions. GP ChatGPT ★ 3,444repo stars 08-command-system 08-command-system is a Claude Code prompt that audits and restores slash commands in a codebase. It addresses command registry repairs and broken imports. GP ChatGPT ★ 3,444repo stars 13-bridge-ide 13-bridge-ide is a Claude Code prompt for examining the Bridge connection to IDEs and checking CLI behavior with the feature disabled. It also covers activation notes and Chrome modes. GP ChatGPT ★ 3,444repo stars 16-testing The 16-testing prompt wires up Vitest in the claude-code project and writes tests for shims, tools, commands and context. It fires when the leaked-and-rebuilt source has no test suite at all. GP ChatGPT ★ 3,444repo stars 15-production-bundle 15-production-bundle is a Claude Code prompt for configuring production bundling and packaging of CLI tools for Node.js 20+ and Bun 1.1+. GP ChatGPT ★ 3,444repo stars 11-mcp-integration The 11-mcp-integration prompt guides an investigation of Claude Code’s MCP client and server mode. Use it to inspect configuration and outline a client-to-server test. GP ChatGPT ★ 3,444repo stars 10-context-and-prompts 10-context-and-prompts takes the agent through the CLI prompt layer: reads the builder, repairs context collection on Linux, connects memory from CLAUDE.md. The last step is a script that prints the finished prompt. GP ChatGPT ★ 3,444repo stars 05-env-and-auth 05-env-and-auth sets up environment variables and tests API connectivity in claude-code workspaces. Creates a documented .env.example and builds a test script for Bun. GP ChatGPT ★ 3,444repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open