Model Context Protocol (MCP) | AI Assistant (original) (raw)

AI Assistant can interact with external tools and data sources via the Model Context Protocol (MCP). By connecting to MCP servers, AI Assistant gains access to a range of tools that significantly extend its capabilities.

Supported transport mechanisms

Currently, AI Assistant supports only one transport mechanism for communicating with an MCP server: stdio. This means that AI Assistant launches the MCP server as a subprocess and exchanges data through its standard input and output streams.

Where to get an MCP server

There are many MCP-compatible servers available, depending on your use case and setup. As a starting point, you can explore the reference servers provided in the official MCP repository, which includes examples, usage instructions, and configuration details.

What is needed to connect to an MCP server

To connect AI Assistant to an MCP server, you need a JSON configuration that defines the command and arguments for starting the server. The exact configuration depends on the specific MCP server. In most cases, the server's developers will provide a recommended configuration you can get and use.

Connect to an MCP server

To connect to an MCP server:

  1. Go to .
    Alternatively, you can open the screen with the MCP settings by typing / in the chat and selecting the Add Command option.
    Add Command
  2. On the Model Context Protocol (MCP) settings page, click Add to add a new MCP server configuration.
  3. In the New MCP Server dialog, select how you want to specify the parameters of the MCP server:
    Define a command that starts the MCP server:
    Configure MCP server parameters
    • Name – specify a name for the MCP server.
    • Command – specify the command used to launch the MCP server.
    • Arguments – specify additional parameters passed to the command at server startup.
    • Environment Variables – specify optional variables the server may need (API keys or configuration settings).
    • Working directory – specify the path to the folder from which the server is launched. This allows you to use relative paths in arguments instead of absolute paths.
      Provide a JSON configuration:
      As JSON
    • JSON configuration – provide a JSON snippet with the parameters required to start the MCP server.
      The configuration must follow this format:
      { "mcpServers": { "yourServerName": { "command": "path-or-command-to-start-server", "args": [ "optional-arguments-passed-to-server" ] } } }
    • Working directory – specify the path to the folder from which the server is launched. This allows you to use relative paths in arguments instead of absolute paths.
  4. Click OK. The MCP server will appear in the list.
  5. In the Level column, select whether the setup must be available globally or only in the current project.
  6. Click Apply. This will start the configured server and establish a connection to it.

As a result, the tools provided by the MCP server become available to AI Assistant. It can trigger them automatically when processing your request, or you can invoke them manually by typing the appropriate / command in the chat:

List of commands available on the MCP server

Review available tools

Once the connection to the MCP server is successfully established, you can review the list of available tools by clicking the icon in the Status column.

List of available tools

Stop the MCP server

To stop the MCP server:

  1. Deselect the checkbox for the MCP server you want to stop.
    Stop MCP server
  2. Click Apply.

Get MCP server logs

For debugging purposes, you might want to review the logs of the spawned MCP server. To do this:

  1. In the main menu, go to and select Show Log in Explorer on Windows or Show Log in Finder on macOS. This opens the logs directory.
  2. Locate the mcp folder and open it. This folder contains the logs for each configured MCP server.

JSON configuration examples

This section provides example configurations for connecting AI Assistant to an MCP server, depending on how the server is hosted. It covers locally installed servers, NPX-based setups, Docker-based environments, and a workaround for connecting to remote servers.

Local installation

If the MCP server is installed on your machine, you can connect to it by running the server executable along with any required arguments. A template for such a configuration would look like this:

{ "mcpServers": { "yourServerName": { "command": "command-to-run-server", "args": [ "path-to-server-executable-or-script", "optional-arguments-for-server" ] } } }

For example, if you use the Filesystem MCP server, your configuration may look like this:

{ "mcpServers": { "filesystem": { "command": "node", "args": [ "/Users/JohnDoe/IdeaProjects/servers/src/filesystem/dist/index.js", "/Users/JohnDoe/Desktop" ] } } }

Here, the node command runs the server script. The first argument specifies the path to the server script, and the second argument tells the server which directory it is allowed to operate in.

Using NPX

If the MCP server is not installed locally, you can use npx to download and run it on demand. A template for such a configuration would look like this:

{ "mcpServers": { "yourServerName": { "command": "npx", "args": [ "-y", "npm-package-name", "optional-arguments-for-server" ] } } }

For example, if you use the Filesystem MCP server, your configuration may look like this:

{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/JohnDoe/Desktop" ] } } }

Here, the npx command runs the @modelcontextprotocol/server-filesystem package. The path provided in the arguments tells the server which directory it is allowed to operate in.

Using Docker

You can run the MCP server in an isolated environment using Docker. This starts the server inside a container and mounts local folders into it so the server can access them. A template for such a configuration would look like this:

{ "mcpServers": { "yourServerName": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/local/path,dst=/container/path", "docker-image-name", "/container/path" ] } } }

For example, if you use the Filesystem MCP server, your configuration may look like this:

{ "mcpServers": { "filesystem": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/Users/JohnDoe/Desktop,dst=/projects/Desktop", "--mount", "type=bind,src=/Users/JohnDoe/Documents,dst=/projects/Documents,ro", "mcp/filesystem", "/projects" ] } } }

Here, the docker command runs the mcp/filesystem image. The local folders /Users/JohnDoe/Desktop and /Users/JohnDoe/Documents are mounted into the container, and the /projects argument tells the server where to operate inside the container.

Workaround for remote servers

If you want to connect to a remote MCP server that uses the HTTP + SSE or Streamable HTTP transport mechanisms, you can use a workaround with the
mcp-remote proxy package. This proxy bridges AI Assistant and the remote server by running temporarily via npx. A template for such a configuration would look like this:

{ "mcpServers": { "yourServerName": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://remote-mcp-server.example.com/sse" ] } } }

{ "mcpServers": { "yourServerName": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://remote-mcp-server.example.com/mcp" ] } } }

For example, to connect AI Assistant to the Microsoft Learn Docs MCP Server, the configuration would look like this:

{ "mcpServers": { "microsoft.docs.mcp": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://learn.microsoft.com/api/mcp" ] } } }

Here, npx runs the mcp-remote package, which forwards requests from AI Assistant to the specified remote MCP server.

Use your IDE as an MCP server

Starting with version 2025.2, JetBrains IDEs come with an integrated MCP server, allowing external clients such as Claude Desktop, Cursor, Codex, VS Code, and others to access tools provided by the IDE. This provides users with the ability to control and interact with JetBrains IDEs without leaving their application of choice.

External client setup

For external clients like Claude Code, Claude Desktop, Cursor, VS Code, Codex, and Windsurf, configuration can be performed automatically:

  1. In the main menu, go to .
  2. Click Enable MCP Server.
  3. In the Clients Auto-Configuration section, click Auto-Configure for each client you want to set up for use with the MCP server. This will automatically update their JSON configuration.
    MCP Server settings
  4. Restart your client for configuration to take effect.

If you want to connect to the MCP server from any other client, you will need to perform manual configuration:

  1. In the Manual Client Configuration section, click either Copy SSE Config or Copy Stdio Config depending on the connection type.
    MCP Server manual configuration
  2. Paste the copied configuration into your client's settings or configuration file.
  3. Restart your client for configuration to take effect.

Execute actions without confirmation

The MCP server allows connected external clients to execute terminal commands or run configurations in the IDE without prompting for user confirmation each time.

To enable this mode:

  1. In the main menu, go to .
  2. In the Command execution section, enable the Run shell commands or run configurations without confirmation (brave mode) setting.
  3. Click Apply.

Supported tools

Below is the list of tools provided by the MCP server:

execute_run_configuration

Runs a specific run configuration in the current project and waits up to the specified timeout for it to finish. Use this tool to execute a run configuration retrieved with the get_run_configurations tool.

Returns the execution result, including exit code, output, and success status.

Parameters:

get_run_configurations

Returns a list of run configurations for the current project. A run configuration defines how to run an application, task, or test suite from sources.

The tool also provides additional information like command line, working directory, and environment variables if they are available.

Use this tool to query the list of available run configurations in the current project.

Parameters:

get_file_problems

Analyzes the specified file for errors and warnings using IntelliJ inspections. Use this tool to identify coding issues, syntax errors, and other problems in a specific file.

Returns a list of problems, including severity, description, and location information.

Parameters:

get_project_dependencies

Returns a list of all dependencies defined in the project. Provides structured information about library names.

Parameters:

get_project_modules

Returns a list of all modules in the project with their types. Provides structured information about each module, including its name and type.

Parameters:

create_new_file

Creates a new file at the specified path within the project directory. Optionally, writes the provided text into the file.

Parameters:

find_files_by_glob

Searches for all files in the project whose relative paths match the specified glob pattern. The search is performed recursively in all subdirectories of the project directory or a specified subdirectory. Use this tool to find files by a glob pattern (for example, **/*.txt).

Parameters:

find_files_by_name_keyword

Searches for all files in the project whose names contain the specified keyword (case-sensitive). Use this tool to locate files when you know part of the file name.

Parameters:

get_all_open_file_paths

Returns the paths of all files opened for editing in the active editor or any other open editors, relative to the project root. Use this tool to explore currently open editors.

Parameters:

list_directory_tree

Provides a tree representation of the specified directory in the pseudo-graphic format, similar to the tree utility. Use this tool to explore the contents of a directory or the entire project. Prefer this tool over command-line utilities like ls or dir for directory listing.

Parameters:

open_file_in_editor

Opens the specified file in the JetBrains IDE editor. Requires a filePath parameter containing the path to the file to open. The file path can be absolute or relative to the project root.

Parameters:

reformat_file

Reformats the specified file in the JetBrains IDE. Use this tool to apply code formatting to a file identified by its path.

Parameters:

get_file_text_by_path

Retrieves the text content of a file using its path relative to the project root. Use this tool to read file contents when you have the file's project-relative path.

Parameters:

replace_text_in_file

Replaces text in a file with flexible options for find-and-replace operations. Use this tool to make targeted changes without replacing the entire file content. This is the most efficient tool for file modifications when you know the exact text to replace.

Returns one of the following responses:

Parameters:

search_in_files_by_regex

Searches for a regex pattern within all files in the project using IntelliJ's search engine. Prefer this tool over reading files with command-line tools because it is much faster.

Occurrences in the results are highlighted by surrounding them with || characters. For example: some text ||substring|| text.

Parameters:

search_in_files_by_text

Searches for a text substring within all files in the project using IntelliJ's search engine. Prefer this tool over reading files with command-line tools because it is much faster.

Occurrences in the results are highlighted by surrounding them with || characters. For example some text ||substring|| text.

Parameters:

get_symbol_info

Retrieves information about the symbol at the specified position in the specified file. Provides the same information as IntelliJ IDEA's Quick Documentation feature. The information may include the symbol's name, signature, type, documentation, and other details, depending on the programming language.

If the position references a symbol, the tool will return a code snippet with the symbol's declaration, if available. Use this tool to understand a symbol's declaration, semantics, and location.

Parameters:

rename_refactoring

Renames a symbol (variable, function, class, etc.) in the specified file. Use this tool to perform rename refactoring operations.

Unlike a simple text search-and-replace, the rename_refactoring tool is a context-aware utility that understands the code's structure. It intelligently updates all references to the specified symbol throughout the project, ensuring code integrity and preventing broken references. It is always the preferred method for renaming programmatic symbols.

The tool returns a success message if the rename operation was successful, or an error message if the file or symbol cannot be found, or if the rename operation fails.

Parameters:

execute_terminal_command

Executes a specified shell command in the IDE's integrated terminal. Use this tool to run terminal commands within the IDE environment.

Important features and limitations:

Returns possible responses:

Parameters:

get_repositories

Retrieves the list of VCS roots in the project. Use this tool to identify all repositories in a multi-repository project.

Parameters:

10 October 2025