Skip to content

MCP server fails opaquely with -32000 when launched outside a git repo #105

Description

@5uck1ess

What happens

When Claude Code's working directory is not inside a git repository, the devkit MCP server fails to connect with only an opaque error visible to the user:

Failed to reconnect to plugin:devkit:devkit-engine: -32000

The user has no indication of why. Many will assume the install is broken and try to reinstall, purge caches, or file confused bug reports.

Actual root cause

devkit mcp checks for a git repo at startup and exits immediately with:

Error: not inside a git repo — run devkit from a project directory

This message goes to the engine's stderr, which Claude Code does not surface to the user. The process exits before completing the MCP initialize handshake, so Claude Code only sees the JSON-RPC -32000 server-error.

Reproduction

  1. mkdir /tmp/not-a-repo && cd /tmp/not-a-repo
  2. Start Claude Code with devkit enabled
  3. /mcpFailed to reconnect to plugin:devkit:devkit-engine: -32000
  4. cd into any git repo, restart → works fine

Suggested fixes (pick one)

  1. Defer the git check. Let devkit mcp always start successfully and only error on the first tool call that needs git state, returning a structured error in the JSON-RPC response so the user sees the real message.
  2. Surface the failure in the launcher. Have the launcher run a pre-flight git check and exit with a stderr message Claude Code is known to log visibly, or write a sentinel file the user can find.
  3. At minimum, document it. Add a "common issues" entry in the README so users searching for `-32000` find the answer.

Option 1 is the most user-friendly — devkit is useful for non-git tasks too (general workflows, capability skills like `scrape`, `research`), and many of those don't need git at all.

Environment

  • devkit `v2.1.34`
  • Claude Code on Windows 11
  • Engine binary verified working — runs fine once cwd is inside a git repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions