JetBrains Extension
Watch the demo
This tutorial covers how to add the JetBrains extension to integrate with any JetBrains IDE. While goose can use the Developer extension for developer-centric tasks, the JetBrains extension provides a more integrated and project-aware way to work with code.
Configuration
Important: The configuration steps depend on your IDE version. You can find the version in [IDE Name] > About (macOS) or Help > About (Windows/Linux).
- 2025.2 and later
- 2025.1 and earlier
Versions 2025.2 and later have built-in MCP server support and generate a dynamic configuration specific to your IDE instance. See your IDE's documentation for more details (e.g. MCP Server for IntelliJ IDEA).
Configure the extension using your IDE's built-in MCP server support:
-
Get your IDE-specific config:
- Go to
Settings > Tools > MCP Serverin your IDE - If needed, click
Enable MCP Serverto enable the MCP server - Click
Copy Stdio Config - Click
OKto save your changes and start the server - Copy the
command,args, andenvvalues from the config
- Go to
-
Add the JetBrains extension to goose using the command from the config:
infoIf the goose Desktop or goose CLI configuration steps aren't successful, follow the
Config Filesteps.- goose Desktop
- goose CLI
- Config File
- Click the button in the top-left to open the sidebar
- Click
Extensionson the sidebar - Click
Add custom extension - On the
Add custom extensionmodal, enter the following:- Extension Name: JetBrains
- Type: STDIO
- Description: Integrate goose with any JetBrains IDE
- Command: Combine the
commandandargsfrom your IDE's Stdio config into a single command string - Environment Variables: Add
IJ_MCP_SERVER_PORTwith the port value from theenvsection of your copied Stdio config
- Click
Add Extensionto save the extension - Navigate to the chat
- Run the
configurecommand:
goose configure- Choose to add a
Command-line Extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ● Command-line Extension (Run a local command or script)
│ ○ Remote Extension (Streamable HTTP)
└- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ jetbrains
└- Enter the command to run when this extension is used.
infoCombinecommandandargsinto a single string. The port value comes from theenvsection of your copied Stdio config.┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◆ What command should be run?
│ YOUR_COMMAND_AND_ARGS_FROM_IDE
└- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ YOUR_COMMAND_AND_ARGS_FROM_IDE
│
◆ Please set the timeout for this tool (in secs):
│ 300
└- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ YOUR_COMMAND_AND_ARGS_FROM_IDE
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ Integrate goose with any JetBrains IDE
└- Add an environment variable for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ YOUR_COMMAND_AND_ARGS_FROM_IDE
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ Integrate goose with any JetBrains IDE
│
◆ Would you like to add environment variables?
│ Yes
│
◇ Environment variable name:
│ IJ_MCP_SERVER_PORT
│
◇ Environment variable value:
│ YOUR_PORT_FROM_IDE
│
◇ Add another environment variable?
│ No
│
└ Added jetbrains extension-
Open your goose
config.yamlfile -
In the
extensionssection, add an entry that uses your IDE's Stdio config, for example:extensions:
jetbrains:
enabled: true
type: stdio
name: JetBrains
description: Integrate goose with any JetBrains IDE
cmd: /Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java
args:
- -classpath
- /Applications/IntelliJ IDEA.app/Contents/plugins/mcpserver/lib/mcpserver-frontend.jar:/Applications/IntelliJ IDEA.app/Contents/lib/util-8.jar
- com.intellij.mcpserver.stdio.McpStdioRunnerKt
envs:
IJ_MCP_SERVER_PORT: "63342"
env_keys:
- IJ_MCP_SERVER_PORT
timeout: 300
bundled: null
available_tools: []Make sure to:
- Replace the
cmdandargsvalues in the example to match your JetBrains IDE installation - Update
IJ_MCP_SERVER_PORTto match your IDE's MCP server port
- Replace the
Versions 2025.1 and earlier require installing the MCP Server plugin and using the JetBrains MCP Proxy Server.
- goose Desktop
- goose CLI
Command
npx -y @jetbrains/mcp-proxy
Required Setup
Add the MCP Server plugin to your IDE.
Note that you'll need Node.js installed on your system to run this command, as it uses npx.
Configure the extension using the MCP Server plugin and proxy server:
-
Add the MCP Server plugin to your IDE.
-
Add the JetBrains extension to goose:
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Click the button in the top-left to open the sidebar
- Navigate to the chat
- Run the
configurecommand:
goose configure- Choose to add a
Command-line Extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ● Command-line Extension (Run a local command or script)
│ ○ Remote Extension (Streamable HTTP)
└- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ jetbrains
└- Enter the command to run when this extension is used.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◆ What command should be run?
│ npx -y @jetbrains/mcp-proxy
└- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ npx -y @jetbrains/mcp-proxy
│
◆ Please set the timeout for this tool (in secs):
│ 300
└- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ npx -y @jetbrains/mcp-proxy
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ Integrate goose with any JetBrains IDE
└- Choose
Nowhen asked to add environment variables.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ jetbrains
│
◇ What command should be run?
│ npx -y @jetbrains/mcp-proxy
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ Integrate goose with any JetBrains IDE
│
◆ Would you like to add environment variables?
│ No
│
└ Added jetbrains extension
Example Usage
In this example, I'm going to upgrade a Java project to the latest LTS version.
Anthropic's Claude 4 Sonnet was used for this task.
- goose Desktop
- goose CLI
When using goose to refactor code, it's recommended to commit your code to version control before making changes. This way, you have a clean snapshot to compare against, making it easy to review goose's modifications, revert if needed, and track improvements.
goose Prompt
using the JetBrains IDE tools, upgrade this project to use the latest Java LTS version and refactor the codebase to use newer Java features where beneficial.
After 2 minutes, goose was done with the upgrade! 🎉
goose Output
I'll make several improvements to modernize this codebase to use Java 21 (latest LTS) features. Here are the changes I'll implement:
1. Update the `pom.xml` to use Java 21
2. Use newer Java features
[... code changes ...]
Here's a summary of the modernization changes made:
1. `pom.xml`:
- Set Java version to 21
- Enabled preview features
- Updated all dependencies to their latest stable versions
2. `AccountsOverviewPage.java`:
- Made the class `final` since it extends the sealed `Page` class
- Updated stream collection to use `.toList()` instead of `collect(Collectors.toList())`
- Made fields final for better immutability
3. `Page.java`:
- Converted to a sealed class
- Restricted which classes can extend it using `permits`
- Made fields protected and final where appropriate
- Added pattern matching for exception handling
- Implemented Optional for null safety
- Used String Templates for error messages
- Added functional programming concepts with Supplier
- Enhanced error handling with specific exception types
4. `LoginComponent.java`:
- Added a private record for credentials
- Implemented pattern matching with record patterns
- Made fields final for better immutability
5. `AccountTests.java`:
- Implemented structured concurrency using `StructuredTaskScope`
- Used parallel execution for UI and API tasks
- Improved error handling with structured task management
- Used pattern matching and type inference with `var`
6. `BaseTests.java`:
- Implemented structured concurrency for setup tasks
- Improved resource management
- Better exception handling
- Used modern Duration API
7. `APIUtil.java`:
- Implemented String Templates (Java 21 preview feature)
- Used modern text blocks
8. `Customers.java`:
- Added sealed interface for customer types
- Implemented pattern matching for switch expressions
- Added pattern matching for instanceof
- Enhanced type safety with records
Key modern Java features used:
- String Templates (Java 21 Preview)
- Pattern Matching for switch (Java 21)
- Sealed Classes and Interfaces (Java 17)
- Records (Java 16)
- Pattern Matching for instanceof (Java 16)
- Text Blocks (Java 15)
- Switch Expressions (Java 14)
The codebase is now using the latest Java LTS version (21) and incorporates many modern Java features that improve:
- Type safety
- Null safety
- Code readability
- Error handling
- Performance
Using the JetBrains extension provided several advantages and made it easier for goose to:
- navigate through the codebase
- track changes
- make consistent modifications across files
- verify the content of files before and after changes