Expose IDE MCP tools (openFile, getOpenEditors, etc.) as agent-callable

Resolved 💬 3 comments Opened Apr 17, 2026 by mudejar Closed May 27, 2026

Feature description

When Claude Code CLI connects to an IDE integration (e.g., claudecode.nvim) via its WebSocket MCP server, the IDE exposes several tools including openFile, getOpenEditors, getCurrentSelection, saveDocument, and getDiagnostics. However, the CLI only surfaces getDiagnostics as a tool the agent can invoke directly. The others appear to be used internally (e.g., openDiff for showing file edits) but are not available for the agent to call on its own.

Use Case

When asking the agent architecture or codebase questions, it would be valuable for it to open relevant files and highlight specific line ranges in the editor — rather than just printing file:line references that the user has to navigate to manually. This would make exploratory Q&A sessions significantly more interactive.

Current Behavior

  • The IDE plugin registers all tools in its MCP server (e.g., claudecode.nvim exposes 10 tools)
  • Claude Code CLI connects and receives the full tool list
  • Only getDiagnostics is exposed as agent-callable (mcp__ide__getDiagnostics)
  • openFile, getCurrentSelection, getOpenEditors, saveDocument, etc. are not available for the agent to call

Desired Behavior

Expose additional IDE tools as agent-callable, at minimum:

  • openFile — open a file and optionally select/highlight a line range
  • getOpenEditors — list currently open buffers
  • getCurrentSelection — read the user's current selection

Proposed solution

Add these tools to the allowlist of IDE MCP tools that are surfaced to the agent. They are already implemented and functional in IDE plugins — the change is in the CLI's tool mapping layer.

Possible approaches:

  1. Expand the hardcoded allowlist in the CLI to include openFile, getOpenEditors, and getCurrentSelection
  2. Allow IDE plugins to advertise per-tool metadata (e.g., agent_callable: true) so plugin maintainers can control which tools the agent can invoke

Option 2 gives plugin maintainers control over which tools are safe for autonomous agent use vs. which should remain internal-only.

Alternatives considered

  • Print file:line references in chat output: This is the current workaround. The agent outputs references like src/foo.lua:42 and the user navigates manually. Works, but breaks flow during exploratory Q&A sessions.
  • Use openDiff as a proxy: The agent could create a no-op diff to force a file open, but this is a hack that pollutes the diff workflow and requires user interaction to dismiss.
  • Custom MCP server wrapping the editor: A standalone MCP server could send RPC commands to the editor, but this duplicates functionality the IDE plugins already provide.

Additional context

  • IDE plugin: claudecode.nvim v432121f (main branch)
  • Neovim version: v0.11.6
  • Terminal: iTerm2
  • OS: macOS 26.4 (arm64)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗