### Local installation example (Filesystem MCP server) Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Example configuration for connecting to a locally installed Filesystem MCP server. ```json { "mcpServers": { "filesystem": { "command": "node", "args": [ "/Users/JohnDoe/IdeaProjects/servers/src/filesystem/dist/index.js", "/Users/JohnDoe/Desktop" ] } } } ``` -------------------------------- ### MCP Server Configuration Example Source: https://www.jetbrains.com/help/ai-assistant/junie-agent.html Example structure for configuring MCP servers in the mcp.json file. ```json { "mcpServers": [ // Add server configurations here ] } ``` -------------------------------- ### Example rule file Source: https://www.jetbrains.com/help/ai-assistant/configure-project-rules.html An example of what a rule file with guidelines might look like. ```markdown # General Code Review Guidelines {...} ``` -------------------------------- ### Local installation template Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Template for connecting to a locally installed MCP server. ```json { "mcpServers": { "yourServerName": { "command": "command-to-run-server", "args": [ "path-to-server-executable-or-script", "optional-arguments-for-server" ] } } } ``` -------------------------------- ### Using Docker example (Filesystem MCP server) Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Example configuration for connecting to a Filesystem MCP server using Docker. ```json { "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" ] } } } ``` -------------------------------- ### Using NPX example (Filesystem MCP server) Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Example configuration for connecting to a Filesystem MCP server using NPX. ```json { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/JohnDoe/Desktop" ] } } } ``` -------------------------------- ### Example Guidelines for Self-Review Source: https://www.jetbrains.com/help/ai-assistant/ai-in-vcs-integration.html An example of a Markdown file that can be used to define code review guidelines for AI Assistant. ```markdown # Code Review Guidelines {...} ``` -------------------------------- ### Regex Example for Action Allowlist Source: https://www.jetbrains.com/help/ai-assistant/junie-agent.html An example of a regular expression (Regex) that can be added to the Action Allowlist to match a command pattern. ```regex ^\Qgit log --oneline \E\S+$ ``` -------------------------------- ### ACP Configuration Example Source: https://www.jetbrains.com/help/ai-assistant/acp.html An example of an ACP configuration file showing default MCP settings and configurations for multiple agents like openode, goose, and auggie. ```json { "default_mcp_settings": { "use_idea_mcp": true, "use_custom_mcp": true }, "agent_servers": { "openode": { "command": "/Users//.opencode/bin/opencode", "args": [ "acp" ] }, "goose": { "command": "/Users//.local/bin/goose", "args": [ "acp" ] }, "auggie": { "command": "/Users//.nvm/versions/node/v20.5.0/bin/auggie", "args": [ "--acp" ] } } } ``` -------------------------------- ### Example remote MCP server connection Source: https://www.jetbrains.com/help/ai-assistant/mcp.html An example of connecting to a remote MCP server using HTTP and the Streamable HTTP transport. ```json { "mcpServers": { "microsoftdocs": { "url": "https://learn.microsoft.com/api/mcp" } } } ``` -------------------------------- ### Example .aiignore file configuration Source: https://www.jetbrains.com/help/ai-assistant/disable-ai-assistant.html This example shows how to configure an .aiignore file to restrict AI Assistant from processing specific files and folders, using syntax similar to .gitignore. ```text # Ignore build output directories target/ out/ # Ignore Maven wrapper files .mvn/ # Ignore project files .idea/ *.iml # Ignore compiled Java class files *.class # Ignore all .java files except the ones from the 'src/main' folder *.java !src/main/**/*.java # Ignore test reports and test directories test-results/ allure-results/ ``` -------------------------------- ### Custom Agent Configuration Example Source: https://www.jetbrains.com/help/ai-assistant/acp.html This JSON structure defines the configuration for custom agents, including default MCP settings and a list of agent servers with their commands, arguments, and environment variables. ```json { "default_mcp_settings": {}, "agent_servers": { "Example Agent": { "command": "/path/to/agent", "args": [ "acp" ], "env": { "API_KEY": "your-api-key-here" } } } } ``` -------------------------------- ### Using Docker template Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Template for connecting to an MCP server using Docker. ```json { "mcpServers": { "yourServerName": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/local/path,dst=/container/path", "docker-image-name", "/container/path" ] } } } ``` -------------------------------- ### list_recent_sql_queries Source: https://www.jetbrains.com/help/ai-assistant/mcp.html This feature is not available in free subscription plans. Retrieves a list of recent, including currently running, queries for the given database connection. For each query returns: Unique ID of a query session. Time spent on running the query (in milliseconds). The current state of the query. For example, running, cancelling, finished, and so on. Completion status of the query. For example, success, finished with error, cancelled, and so on. Text of the query. Parameters: `connectionId` : Unique connection ID. ```tool list_recent_sql_queries ``` -------------------------------- ### Using NPX template Source: https://www.jetbrains.com/help/ai-assistant/mcp.html Template for connecting to an MCP server using NPX. ```json { "mcpServers": { "yourServerName": { "command": "npx", "args": [ "-y", "npm-package-name", "optional-arguments-for-server" ] } } } ``` -------------------------------- ### Invoke code completion suggestions Source: https://www.jetbrains.com/help/ai-assistant/code-completion.html You can invoke code completion suggestions by starting to type in the editor, AI Chat, or Commit Message field. Suggestions appear as you type. You can also trigger code completion by pressing Alt+Shift+0. ```text Start typing in the editor, AI Chat, or Commit Message field. The suggestions start to appear as you type. Code AI Chat Code Comments Commit Message You can also trigger the code completion by pressing `Alt``Shift``0`. ``` -------------------------------- ### Open AI Assistant Requests Log Source: https://www.jetbrains.com/help/ai-assistant/how-we-handle-your-code-and-data.html Steps to open the AI Assistant requests log after enabling the registry key. ```text 1. In the main menu, go to Navigate | Search Everywhere or press `Shift` twice to open the search window. 2. Type Open AI Assistant Requests Log in Editor and press `Enter`. 3. Review log in the `ai-assistant-requests.md` file that opens. ``` -------------------------------- ### IDE Specific Docstring Generation Source: https://www.jetbrains.com/help/ai-assistant/generate-documentation-with-ai.html This snippet shows IDE-specific shortcuts to trigger AI Assistant documentation generation. ```text /** in IntelliJ IDEA, PhpStorm, WebStorm. """ in PyCharm. // in GoLand. ```