Implementation: How should Claude Code sessions access MCP tools (preflight,...

Documentation for Sessions

⚙️ Implementation: How should Claude Code sessions access MCP tools (preflight,...

📋 Decision Context

Question:

How should Claude Code sessions access MCP tools (preflight, log_decision, find_similar)?

Task: Not specified


🎯 Decision Made

Chosen:

Create universal MCP client script using stdio transport

Options Considered:

  1. Wait for native Claude Code MCP integration
  2. Create universal MCP client script using stdio transport
  3. Use REST API endpoints only
  4. Manual curl commands for each tool

💭 Reasoning

Implemented tools/scripts/mcp-client.js that spawns independent MCP server processes via tsx, communicates using JSON-RPC 2.0 protocol over stdio. Benefits: (1) Works immediately without native integration, (2) No conflicts with Cursor native MCP, (3) Full access to all MCP tools, (4) Simple usage via yarn scripts, (5) Well-documented with comprehensive README. Tested successfully with get_stats, preflight, and log_decision tools. Achieves 600-1200ms response time which is acceptable. Added yarn scripts (mcp, mcp:stats, mcp:preflight) for ease of use. Production-ready with comprehensive error handling and timeout protection.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation