Skip to content

feat(mcp): add JetBrains and VS Code MCP server presets#12

Merged
trick77 merged 4 commits intomasterfrom
feat/mcp-intellij
May 8, 2026
Merged

feat(mcp): add JetBrains and VS Code MCP server presets#12
trick77 merged 4 commits intomasterfrom
feat/mcp-intellij

Conversation

@trick77
Copy link
Copy Markdown
Owner

@trick77 trick77 commented May 8, 2026

Summary

Adds two new presets that connect opencode to a running editor as an MCP client of the editor:

  • mcp-intellij — uses the official JetBrains "MCP Server" plugin (IntelliJ IDEA, PyCharm, WebStorm, GoLand, RustRover, etc.) at http://127.0.0.1:64342/stream.
  • mcp-vscode — uses the community JuehangQin.vscode-mcp-server extension at http://127.0.0.1:3000/mcp. (VS Code has no first-party equivalent of the JetBrains plugin.)

What you get

Once the editor-side plugin/extension is enabled, opencode can see what you're doing in the IDE in real time and drive it back:

  • Live editor context — open files, caret position, selected text, recent files (JetBrains); diagnostics, symbol search, document outlines (both)
  • Project awareness — project structure, modules, problems
  • IDE actions — open files, jump to symbols, run/debug configurations (JetBrains); move/rename with refactor-aware imports (VS Code)
  • Smart edits — apply changes through the editor's own edit/refactoring engine instead of raw text patching

The result: prompts like "fix the thing I'm looking at" work without copy-paste.

Mechanics

  • Both presets wire a type: remote entry into opencode.json pointing at the editor's loopback endpoint (no auth — the editors bind to loopback only).
  • Extends the @prompt directive with an optional 4th default field. Empty input falls back to the default; rejected on type=secret. Existing 2- and 3-field forms are untouched.
  • Updates AGENTS.md (format docs) and README.md (preset table). New parser tests in test/parse-conf.test.ts.

Important: the editor-side plugin/extension is not built in. It must be installed AND switched on before either preset is useful:

  • JetBrains: install the "MCP Server" plugin and enable it in Settings → Tools → MCP Server.
  • VS Code: install JuehangQin.vscode-mcp-server from the Marketplace, enable it, and toggle it active via the command palette ("MCP Server: Toggle Active").
    opencode cannot reach the endpoint otherwise.

Test plan

  • npm test — 47/47 pass
  • npm run build clean
  • mcp-intellij: install with empty input → port 64342; with 64999 → URL updated; re-install no-op; remove cleans entry
  • mcp-vscode: install with empty input → port 3000, URL http://127.0.0.1:3000/mcp
  • Backwards-compat: mcp-remote-add-noauth with empty input still errors
  • End-to-end against a running JetBrains IDE with the MCP Server plugin
  • End-to-end against a running VS Code with JuehangQin.vscode-mcp-server toggled on

trick77 added 4 commits May 6, 2026 15:37
Adds presets/mcp-intellij.conf for the JetBrains "MCP Server" plugin
(loopback HTTP at port 64342 by default). Extends the @prompt
directive with an optional 4th field "default" used when the user
submits an empty line; rejected on type=secret. Existing 2- and
3-field @prompt forms are unchanged.
@trick77 trick77 merged commit cc6cc19 into master May 8, 2026
2 checks passed
@trick77 trick77 deleted the feat/mcp-intellij branch May 8, 2026 05:30
@trick77 trick77 changed the title feat(mcp-intellij): add JetBrains IDE MCP preset with prompt defaults feat(mcp): add JetBrains and VS Code MCP server presets May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant