Skip to content

fix: update MCP server import path after src/ reorganization#466

Merged
carlos-alm merged 1 commit intomainfrom
fix/mcp-import-path
Mar 16, 2026
Merged

fix: update MCP server import path after src/ reorganization#466
carlos-alm merged 1 commit intomainfrom
fix/mcp-import-path

Conversation

@carlos-alm
Copy link
Contributor

Summary

Closes #465

Test plan

  • node src/cli.js mcp starts without ERR_MODULE_NOT_FOUND
  • MCP tools respond correctly in Claude Code

The refactor in #458 moved src/mcp.js to src/mcp/index.js but didn't
update the dynamic import in cli/commands/mcp.js, causing the MCP
server to fail with ERR_MODULE_NOT_FOUND on every launch.

Closes #465

Impact: 1 functions changed, 0 affected
@claude
Copy link

claude bot commented Mar 16, 2026

Claude finished @carlos-alm's task —— View job


Reviewing PR #466: Fix MCP server import path

Todo List:

  • Read and analyze the changed file
  • Verify the import path fix is correct
  • Phase 1: Root cause analysis
  • Phase 2: Configuration change detection
  • Phase 3: Test integrity check
  • Phase 4: Code quality assessment
  • Phase 5: Backlog compliance evaluation
  • Provide final assessment and rating

Analysis Summary

The Fix: Changes import path from ../../mcp.js to ../../mcp/index.js to match the file reorganization in PR #458.

Root Cause Analysis

Problem Being Solved: Real issue - MCP server failing with ERR_MODULE_NOT_FOUND after file reorganization in #458
Why This Approach: Direct fix of broken import path - addresses root cause, not symptoms
Risk Assessment: Minimal risk - simple path correction with no logic changes

Backlog Compliance

  • Zero-dep: ✓ — no new dependencies added
  • Foundation-aligned: ✓ — maintains existing MCP functionality without violating principles
  • Problem-fit: 3 — fixes broken functionality but doesn't directly address core AI agent navigation problem
  • Breaking: No — purely internal path fix, no API changes
  • Tier: 1

Critical Concerns

None. This is a straightforward bug fix with minimal risk.

Positive aspects:

  • ✅ Addresses real runtime error blocking MCP functionality
  • ✅ Surgical fix with no side effects
  • ✅ Import path correctly points to reorganized file structure
  • ✅ No other files affected by similar broken imports
  • ✅ Maintains all existing MCP server functionality
  • ✅ Good commit message with context and issue reference

Code Quality:

  • Import path is correct (src/mcp/index.js exports startMCPServer)
  • No functional logic changes
  • Follows existing code patterns
  • Single responsibility change

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: Clean, necessary bug fix that restores broken functionality. Well-executed with proper testing plan. Only loses one star because it's a maintenance fix rather than value-adding functionality.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

Fixes a broken dynamic import in the mcp CLI command caused by #458's reorganization of src/. The old path (../../mcp.js) no longer exists; this PR updates it to ../../mcp/index.js, which correctly re-exports startMCPServer from src/mcp/server.js.

  • Updated dynamic import path in src/cli/commands/mcp.js from ../../mcp.js to ../../mcp/index.js
  • No logic, API, or behavioral changes — purely a path correction

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal one-line import path fix with no behavioral changes.
  • The change is a single-line import path correction. The old path (../../mcp.js) is confirmed to no longer exist, and the new path (../../mcp/index.js) is verified to exist and export the expected startMCPServer function. No logic changes, no new code, no risk.
  • No files require special attention.

Important Files Changed

Filename Overview
src/cli/commands/mcp.js Single-line import path fix: ../../mcp.js../../mcp/index.js. Correctly resolves startMCPServer after #458 moved the MCP module into src/mcp/.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["src/cli/commands/mcp.js"] -->|"dynamic import (fixed)"| B["src/mcp/index.js"]
    B -->|"re-exports"| C["src/mcp/server.js"]
    C -->|"exports"| D["startMCPServer()"]
    style A fill:#d4edda,stroke:#28a745
    style B fill:#d4edda,stroke:#28a745
Loading

Last reviewed commit: 41430f6

@carlos-alm carlos-alm merged commit 1a777b3 into main Mar 16, 2026
16 checks passed
@carlos-alm carlos-alm deleted the fix/mcp-import-path branch March 16, 2026 10:12
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server fails to start: broken import path after src/ reorganization

1 participant