logs.gokuls.in

3 pull requests merged across 1 repo

bahdotsh/indxr

  • --global flag: indxr init --global installs MCP config and rules into user-level directories so indxr is available for all projects without per-project setup
  • Claude Code: ~/.claude.json (MCP merge) + ~/.claude/CLAUDE.md (append)
  • Cursor: ~/.cursor/mcp.json (MCP merge)
  • Windsurf: ~/.codeium/windsurf/mcp_config.json (MCP merge) + ~/.codeium/windsurf/memories/global_rules.md (append)
  • Modern rules format: Migrates deprecated .cursorrules.cursor/rules/indxr.mdc and .windsurfrules.windsurf/rules/indxr.md with proper frontmatter
  • Safe MCP merge: Reads existing JSON, adds/updates only the indxr server entry, preserves all other servers and fields
  • 36 init tests (16 new), all 308 tests passing, clippy clean

Test plan

  • cargo test init::tests — all 36 tests pass
  • indxr init --cursor creates .cursor/rules/indxr.mdc (not .cursorrules)
  • indxr init --windsurf creates .windsurf/rules/indxr.md (not .windsurfrules)
  • indxr init --global --cursor merges into ~/.cursor/mcp.json
  • indxr init --global with existing MCP config preserves other servers
  • indxr init --help shows --global flag
  • Workspace detection for Cargo ([workspace].members), npm ("workspaces"), and Go (go.work) with automatic glob expansion and member name resolution
  • New WorkspaceIndex data model wrapping per-member CodebaseIndex instances — non-workspace projects flow through the same path as a single-member workspace (zero branching)
  • All 22 MCP tools updated to accept an optional member param for scoping; cross-member tools search transparently, path-specific tools auto-resolve the member
  • New list_workspace_members tool (23 total) and CLI additions: indxr members, --member, --no-workspace
  • Workspace-aware serve, watch, HTTP transport, INDEX.md generation, and auto-reindex

Test plan

  • cargo fmt — clean
  • cargo clippy --all-features — clean
  • cargo test — 278 tests pass (14 new workspace tests)
  • cargo test --all-features — 301 tests pass (includes HTTP transport tests)
  • Manual: indxr members on a Cargo workspace, npm monorepo, and Go workspace
  • Manual: indxr serve on a monorepo, verify list_workspace_members and member-scoped tool calls
  • Manual: indxr serve --no-workspace on a monorepo, verify single-root behavior
  • Implements MCP Streamable HTTP transport (spec 2025-03-26) alongside the existing stdio transport, enabling multi-client scenarios via indxr serve --http :8080
  • Feature-gated behind --features http (axum, tokio, etc.) to keep the default binary lean — no bloat for stdio-only users
  • Extracts a transport-agnostic process_jsonrpc_message() handler from the existing code, shared by both stdio and HTTP transports

HTTP Transport Details

  • Single /mcp endpoint: POST for JSON-RPC requests, GET for SSE notification stream, DELETE for session termination
  • Full session enforcement via Mcp-Session-Id header (assigned on initialize, required for all subsequent requests)
  • File watcher integration (--watch) broadcasts change notifications to all connected SSE clients
  • RwLock-based shared state for concurrent multi-client access
  • Sync-to-async bridge via spawn_blocking — all existing tool execution stays synchronous

Files Changed

FileChange
src/mcp/http.rsNew — full HTTP transport + 8 in-crate tests
src/mcp/mod.rsExtract process_jsonrpc_message(), add Transport enum, widen visibility
src/mcp/tests.rs6 new tests for the shared handler
Cargo.tomlhttp feature flag + optional deps (axum, tokio, tokio-stream, tower-http, uuid, async-stream)
src/cli.rs--http <ADDR> flag on serve command
src/main.rsHTTP vs stdio dispatch logic
CLAUDE.md, docs/mcp-server.md, roadmap.mdDocumentation

Test plan

  • cargo test — 264 tests pass (no regression, no http feature)
  • cargo test --features http — 272 tests pass (+14 new tests)
  • cargo check and cargo check --features http both compile cleanly
  • Manual: cargo run --features http -- serve --http :8080 --watch + curl requests