2025-02-05 08:10:22 -06:00
---
title: JetBrains Extension
2025-11-05 08:09:35 -08:00
description: Use JetBrains MCP Server as a goose Extension
2025-02-05 08:10:22 -06:00
---
import Tabs from '@theme/Tabs ';
import TabItem from '@theme/TabItem ';
2025-02-06 23:38:35 -06:00
import YouTubeShortEmbed from '@site/src/components/YouTubeShortEmbed ';
2025-08-08 14:19:24 -07:00
import CLIExtensionInstructions from '@site/src/components/CLIExtensionInstructions ';
2025-08-18 08:40:05 -07:00
import { PanelLeft } from 'lucide-react';
2025-02-06 23:38:35 -06:00
<YouTubeShortEmbed videoUrl="https://www.youtube.com/embed/1fP5elf9qQM" />
2025-02-05 08:10:22 -06:00
2025-11-05 08:09:35 -08:00
This tutorial covers how to add the JetBrains extension to integrate with any JetBrains IDE. While goose can use the [Developer extension ](/docs/mcp/developer-mcp ) for developer-centric tasks, the JetBrains extension provides a more integrated and project-aware way to work with code.
2025-03-06 21:54:59 -06:00
2025-08-08 14:19:24 -07:00
## Configuration
2025-03-06 21:54:59 -06:00
2025-08-18 08:40:05 -07:00
**Important ** : The configuration steps depend on your IDE version. You can find the version in `[IDE Name] > About` (macOS) or `Help > About` (Windows/Linux).
<Tabs groupId="ideVersion">
2026-04-02 08:07:31 -04:00
<TabItem value="2026.1" label="2026.1 and later" default>
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
Versions 2026.1 and later expose a streamable HTTP endpoint directly. No plugin install or npm required.
2025-08-18 08:40:05 -07:00
2026-02-24 15:55:02 -05:00
:::tip Quick Install
2025-08-18 08:40:05 -07:00
<Tabs groupId="interface">
2025-10-21 20:52:00 +01:00
<TabItem value="ui" label="goose Desktop" default>
2026-04-02 08:07:31 -04:00
Use `Add custom extension` in Settings → Extensions with the URL from `Copy HTTP Stream Config` in your IDE.
2025-08-18 08:40:05 -07:00
</TabItem>
2025-10-21 20:52:00 +01:00
<TabItem value="cli" label="goose CLI">
2026-04-02 08:07:31 -04:00
Use `goose configure` with the URL from `Copy HTTP Stream Config` in your IDE.
2025-08-18 08:40:05 -07:00
</TabItem>
</Tabs>
:::
<br/>
2026-04-02 08:07:31 -04:00
Configure the extension using your IDE's built-in HTTP stream endpoint:
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
1. Get your IDE-specific URL:
2025-08-18 08:40:05 -07:00
1. Go to `Settings > Tools > MCP Server` in your IDE
2026-04-02 08:07:31 -04:00
2. Check `Enable MCP Server` and confirm the permissions dialog if shown
3. Click `Copy HTTP Stream Config`
4. Note the `url` value (e.g. `http://127.0.0.1:64344/stream` ) — the port is auto-assigned and varies per IDE instance
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
2. Add the JetBrains extension to goose using the URL from the config:
2026-01-13 16:07:36 -08:00
2025-08-18 08:40:05 -07:00
<Tabs groupId="interface">
2025-10-21 20:52:00 +01:00
<TabItem value="ui" label="goose Desktop" default>
2025-08-18 08:40:05 -07:00
1. Click the <PanelLeft className="inline" size={16} /> button in the top-left to open the sidebar
2. Click `Extensions` on the sidebar
3. Click `Add custom extension`
4. On the `Add custom extension` modal, enter the following:
- **Extension Name**: JetBrains
2026-04-02 08:07:31 -04:00
- **Type**: Streamable HTTP
2026-01-13 05:42:48 +08:00
- **Description**: Integrate goose with any JetBrains IDE
2026-04-02 08:07:31 -04:00
- **URL**: Paste the `url` from `Copy HTTP Stream Config`
2025-08-18 08:40:05 -07:00
5. Click `Add Extension` to save the extension
6. Navigate to the chat
</TabItem>
2025-10-21 20:52:00 +01:00
<TabItem value="cli" label="goose CLI">
2026-01-13 05:42:48 +08:00
<CLIExtensionInstructions
2025-08-18 08:40:05 -07:00
name="jetbrains"
2025-11-05 08:09:35 -08:00
description="Integrate goose with any JetBrains IDE"
2026-04-02 08:07:31 -04:00
type="http"
url="http://127.0.0.1:<PORT>/stream"
2025-08-18 08:40:05 -07:00
timeout={300}
2026-01-13 05:42:48 +08:00
commandNote={
<>
2026-04-02 08:07:31 -04:00
Paste the <code>url</code> from <code>Copy HTTP Stream Config</code>. The port varies per IDE instance.
2026-01-13 05:42:48 +08:00
</>
}
2025-08-18 08:40:05 -07:00
/>
</TabItem>
</Tabs>
2025-08-08 14:19:24 -07:00
</TabItem>
2026-04-02 08:07:31 -04:00
<TabItem value="2025.2" label="2025.2 – 2025.x">
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
Versions 2025.2 through 2025.x have built-in MCP server support using stdio transport. See your IDE's documentation for more details (e.g. [MCP Server ](https://www.jetbrains.com/help/idea/mcp-server.html ) for IntelliJ IDEA).
2025-08-18 08:40:05 -07:00
2026-02-24 15:55:02 -05:00
:::tip Quick Install
2025-08-18 08:40:05 -07:00
<Tabs groupId="interface">
2025-10-21 20:52:00 +01:00
<TabItem value="ui" label="goose Desktop" default>
2026-04-02 08:07:31 -04:00
Use `Add custom extension` in Settings → Extensions with the command from `Copy Stdio Config` in your IDE.
2025-08-18 08:40:05 -07:00
</TabItem>
2025-10-21 20:52:00 +01:00
<TabItem value="cli" label="goose CLI">
2026-04-02 08:07:31 -04:00
Use `goose configure` with the command from `Copy Stdio Config` in your IDE.
2025-08-18 08:40:05 -07:00
</TabItem>
</Tabs>
:::
<br/>
2026-04-02 08:07:31 -04:00
Configure the extension using your IDE's built-in MCP server support:
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
1. Get your IDE-specific config:
2025-08-18 08:40:05 -07:00
2026-04-02 08:07:31 -04:00
1. Go to `Settings > Tools > MCP Server` in your IDE
2. If needed, click `Enable MCP Server` to enable the MCP server
3. Click `Copy Stdio Config`
4. Click `OK` to save your changes and start the server
5. Copy the `command` , `args` , and `env` values from the config
2. Add the JetBrains extension to goose using the command from the config:
2025-08-18 08:40:05 -07:00
<Tabs groupId="interface">
2025-10-21 20:52:00 +01:00
<TabItem value="ui" label="goose Desktop" default>
2026-04-02 08:07:31 -04:00
1. Click the <PanelLeft className="inline" size={16} /> button in the top-left to open the sidebar
2. Click `Extensions` on the sidebar
3. Click `Add custom extension`
4. On the `Add custom extension` modal, enter the following:
- **Extension Name**: JetBrains
- **Type**: STDIO
- **Description**: Integrate goose with any JetBrains IDE
- **Command**: Combine the `command` and `args` from your IDE's Stdio config into a single command string
- **Environment Variables**: Add `IJ_MCP_SERVER_PORT` with the port value from the `env` section of your copied Stdio config
5. Click `Add Extension` to save the extension
6. Navigate to the chat
</TabItem>
<TabItem value="cli" label="goose CLI">
<CLIExtensionInstructions
name="jetbrains"
2025-11-05 08:09:35 -08:00
description="Integrate goose with any JetBrains IDE"
2026-04-02 08:07:31 -04:00
type="stdio"
command="YOUR_COMMAND_AND_ARGS_FROM_IDE"
2025-08-18 08:40:05 -07:00
timeout={300}
2026-04-02 08:07:31 -04:00
envVars={[{ key: "IJ_MCP_SERVER_PORT", value: "YOUR_PORT_FROM_IDE" }]}
commandNote={
<>
Combine <code>command</code> and <code>args</code> into a single string. The port value comes from the <code>env</code> section of your copied Stdio config.
</>
}
2025-08-18 08:40:05 -07:00
/>
</TabItem>
</Tabs>
2025-02-05 08:10:22 -06:00
</TabItem>
</Tabs>
## Example Usage
In this example, I'm going to upgrade a Java project to the latest LTS version.
<Tabs groupId="interface">
2025-10-21 20:52:00 +01:00
<TabItem value="ui" label="goose Desktop" default>
2025-04-29 12:21:06 -04:00
1. Open [IntelliJ ](https://www.jetbrains.com/idea/download ) (JetBrains' Java and Kotlin IDE)
2025-11-05 08:09:35 -08:00
2. Open a new session in goose Desktop
2025-04-29 12:21:06 -04:00
:::note
2025-11-05 08:09:35 -08:00
You will interact with two separate apps: the goose Desktop app and the IntelliJ IDE.
2025-04-29 12:21:06 -04:00
:::
</TabItem>
2025-10-21 20:52:00 +01:00
<TabItem value="cli" label="goose CLI">
2025-02-05 08:10:22 -06:00
1. Open [IntelliJ ](https://www.jetbrains.com/idea/download ) (JetBrains' Java and Kotlin IDE)
2025-11-05 08:09:35 -08:00
2. Open a terminal within your IDE and start a new goose session:
2025-02-05 08:10:22 -06:00
```sh
goose session
` ``
</TabItem>
</Tabs>
2026-01-13 05:42:48 +08:00
:::tip
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.
2025-02-05 08:10:22 -06:00
:::
2025-11-05 08:09:35 -08:00
### goose Prompt
2025-02-05 08:10:22 -06:00
` ``
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.
` ``
2025-11-05 08:09:35 -08:00
After 2 minutes, goose was done with the upgrade! 🎉
2025-02-05 08:10:22 -06:00
2025-11-05 08:09:35 -08:00
### goose Output
2025-02-05 08:10:22 -06:00
` ``md
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
2026-01-13 05:42:48 +08:00
2. Use newer Java features
2025-02-05 08:10:22 -06:00
[... 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
` ``
2025-11-05 08:09:35 -08:00
Using the JetBrains extension provided several advantages and made it easier for goose to:
2025-02-05 08:10:22 -06:00
- navigate through the codebase
- track changes
- make consistent modifications across files
- verify the content of files before and after changes