Skip to main content

Model Context Protocol

Model Context Protocol (MCP) extends Qoder CN by connecting it to external tools and data sources. Learn about supported transport types, configuration steps, and example scenarios.

Before you start

Update the Qoder CN IDE plugin to the required version:
  • JetBrains: version 2.5.0 or later.
  • VS Code: version 2.5.0 or later.
See Installation guide for details.

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context and tools to LLMs. Connect Qoder CN Agent with external data sources and tools through standardized interfaces to extend its capabilities. Connect to existing MCP services or build your own. Marketplaces such as ModelScope MCP Square and Higress MCP Marketplace offer a wide range of ready-to-use services.
Popular MCP marketplacesCommon scenarios
  • Retrieve database schemas to generate Data Access Object (DAO) code, or complete data queries.
  • Retrieve information from online documentation to generate code, optimize code, or chat.
  • Generate interaction and frontend code from design systems.
Qoder CN supports two transport types:
  • Standard Input/Output (stdio) Communicates through standard input and output streams. Best suited for local integrations and command-line tools.
  • Server-Sent Events (SSE) Enables server-to-client streaming with HTTP POST for client-to-server communication.

How to configure and use MCP services

  • MCP services are supported in Agent mode, together with the Qwen3 model.
  • You can connect up to 10 MCP services at a time.

Add MCP service

1. Access the MCP service page
Click your avatar in the top-right corner, then go to Your Settings > MCP tools.
Note MCP services apply to all local projects in the IDE once added.
2. Add a service
Method 1: Add through MCP marketplace
Important Qoder CN IDE does not support searching in MCP Square
  1. Click MCP Square to browse MCP services from the ModelScope community.
  2. Find the desired service in MCP Square and click Install.
Note Some MCP servers require environment variables such as API_KEY or ACCESS_TOKEN.
  1. In My Servers, verify the new service shows (connected). Expand to view available tools.
Note If dependencies required by the command are missing, the service will show an error message when you start. Please manually install the required dependencies. See FAQ for more help.
Method 2: Add manually
Important Qoder CN IDE only supports adding MCP services via configuration files.
  1. On the MCP Service page, click "+" and select a method:
    • Add manually:
      • STDIO type: Fill in the name, command, arguments, and (optional) environment variables.
      • SSE type: Fill in the name and service endpoint.
    • Add by configuration:
      • Add the configuration in JSON format.
  2. Verify the new service shows (connected). Expand to view available tools.

Use MCP tools

Qoder CN automatically selects the appropriate MCP tool based on your prompt and the tool descriptions, then uses the results for subsequent steps.

1. Enter prompt

Switch to Agent mode in the IDE chat box and enter your prompt.

2. Execute tool

Qoder CN prompts for confirmation before calling an MCP tool.

3. Check execution results

The Qoder CN chat box displays the results. Expand to view detailed input and output.

4. Review code and accept changes

After the conversation completes, you can review and accept the final generated code.

Example scenarios

Qoder CN supports two types of MCP services:
  1. SSE type (remote service hosting) : Runs on a remote server with minimal setup. Ideal for beginners. This example uses the Fetch MCP service from ModelScope MCP Market to retrieve and process webpage content.
  2. STDIO type (local service running) : Runs locally and requires environment setup. Suited for experienced developers. This example uses the weather MCP to query city weather.

Scenario 1: Using remote MCP to retrieve and process content from web pages

Use the Fetch MCP Server to retrieve web page content and convert HTML to Markdown.

1. Get the MCP SSE service endpoint

  1. Log on to the ModelScope MCP Market to get the MCP SSE service endpoint.

  2. Copy the code snippet under Connecting to MCP via an SSE URL.

2. Add MCP service

In MCP Services, configure the MCP server:

3. Complete configuration

Verify the service shows (connected). Expand to view available tools.

4. Use MCP in Qoder CN

Switch to Agent mode and enter a prompt to summarize online documentation:

plaintext
Please summarize the content of this document: https://help.aliyun.com/zh/lingma/developer-reference/listkbfiles-get-the-list-of-knowledge-base-files

Enter the next prompt to generate code:

plaintext
Generate sample code based on the API documentation: https://help.aliyun.com/zh/lingma/developer-reference/listkbfiles-get-the-list-of-knowledge-base-files

Scenario 2: Using local MCP to query city weather

Use the weather MCP to query city weather information.

1. Check environment

Ensure Node.js is installed locally. You can ask Qoder CN to verify:
  • Prompt:
plaintext
Please help me check my local environment to ensure Node.js is installed

2. Add MCP service

In MCP Services, configure the MCP server with the following parameters:
  • Name: weather
  • Type: STDIO
  • Command: npx
  • Arguments:
plaintext
-y @h1deya/mcp-server-weather
MCP service configuration information
  • Service configuration informationjson
    {
    "mcpServers": {
    "weather": {
    "command": "npx",
    "args": [
    "-y",
    "@h1deya/mcp-server-weather"
    ],
    }
    }
    }
  • Source code: weather MCP service

3. Complete configuration

Verify the service shows (connected). Expand to view available tools.

4. Use MCP in Qoder CN

Switch to Agent mode and enter a prompt to check the weather. Prompt 1:plaintext
Help me check the weather in San Francisco, USA
Prompt 2:plaintext
Are there any weather alerts in the US tomorrow?

MCP FAQ

Service installation or startup errors

1. Missing environment for the npx command

  • Error message: failed to start command: exec: "npx": executable file not found in $PATH
  • Solution: Download and install Node.js.
Node.js must be v18 or later, and npm must be v8 or later. Older versions may cause tool invocation to fail.
  • Visit the Node.js official site to download and install Node.js 18 or later, or use one of the methods below:
Installation and verification steps
  1. Download and install

Windows


Use nvm-windows to manage multiple versions:
powershell
nvm install 22.14.0  # Install the specified version
nvm use 22.14.0

macOS


Install with Homebrew (install Homebrew first).
bash
# 1. Install Node.js
brew update
brew install node

# 2. Verify the core toolchain
echo "Node.js version: $(node -v)"
echo "npm version: $(npm -v)"
echo "npx version: $(npx -v)"

# 3. Configure environment variables (if necessary)
echo 'export PATH="/usr/local/opt/node@16/bin:$PATH"' >> ~/.zshrc
  1. After installation, run the following commands in the terminal to verify.
Plain%20Text
node -v
npx -v
  1. If the installation succeeded, the terminal displays the installed Node.js version.

2. Missing environment for the uvx command

  • Error message: failed to start command: exec: "uvx": executable file not found in $PATH
  • Solution: Install uv. uvx is a command-line tool provided by uv for quickly running Python scripts.
    • Visit the Python official site to download and install Python 3.8 or later, or use one of the methods below: Installation and verification steps
      1. Download and install

      Windows


      Install on Windows with the following command:
      powershell
      powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
      

      macOS


      Install on macOS and Linux with the following command:
      bash
      curl -LsSf https://astral.sh/uv/install.sh | sh
      
      1. After installation, run the following command in the terminal to verify.
      Bash
      uv --version
      
      1. If the installation succeeded, the terminal displays the installed uv version.

3. Unable to initialize the MCP Client

  • Error message: failed to initialize MCP client: context deadline exceeded
  • Possible causes, including but not limited to:
    • Incorrect service parameter configuration: The parameters of the MCP service may be configured incorrectly, affecting service initialization.
    • Resource fetch failure: Network issues prevent resources from being fetched successfully, causing installation to fail.
    • Network security restrictions: Interception by internal security components in your organization causes MCP service initialization to fail.
  • Troubleshooting steps:
1. Click Copy full command to obtain the complete command.
2. Run the command in a terminal to view detailed error information.
3. Analyze the error information and fix it accordingly.Common issue 1: Configuration error In the example above, the error information shows that the connection failed because of an incorrect Redis connection URL. Edit the MCP service and correct the URL configuration. Common issue 2: Resource fetch failure If the command fails because resources cannot be fetched, run one of the following commands to add a mirror source, then restart the Qoder CN process and try again.

## Windows

plaintext
npm config set registry https://registry.npmmirror.com

## macOS

plaintext
export UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
Common issue 3: Node.js execution is blocked by security components Authorize or whitelist the Node.js process or related executables according to the prompts from the security component.

Tool usage issues

For issues with services from the MCP marketplace, contact the ModelScope community for technical support.
ModelScope developer group (DingTalk group ID: 44837352)

1. Tool execution fails due to incorrect environment variables or parameters

  • Troubleshooting steps:
If an MCP tool call fails or returns unexpected results, expand the tool call details to view the error information and troubleshoot accordingly.
Important Some MCP services (such as Mastergo and Figma) include critical authentication information such as API_KEY or TOKEN in the "arguments (args)". These parameters must be configured manually after installation from the MCP marketplace.
  • Solution:
  1. Go to the My Servers page.
  2. Find the corresponding MCP service and click Edit.
  3. In the service configuration, review the arguments (args) section.
  4. Replace the variables that need to be updated or filled in, ensure the values are correct, reconnect the service, and try again.

2. The model cannot invoke MCP tools

  • Ensure the current mode is Agent mode.
If no project directory is open, the system enters Chat mode only and cannot invoke MCP tools. Load the corresponding project directory and switch to Agent mode first.
  • Ensure the MCP service is in the Connected state:
If the service connection is interrupted, click on the right side of the interface. The system will automatically attempt to restart the MCP service.
  • Recommendations: Avoid similar naming for MCP services and their tools (for example, TextAnalyzer-Pro and TextAnalyzer-Plus both include a tool named fetchText with similar functionality). Similar names may cause ambiguity when the model invokes tools.

3. Your Settings and MCP tools pages cannot be opened, and the chat panel is blank

When the page is blank and the idea.log contains the following error: "WARN - #c.i.u.j.JBCefApp - JCefAppConfig.class is not from a JBR module". Cause: Android Studio does not support JCEF by default, so the Your Settings and MCP pages cannot be loaded. Solution:
  1. Configure JCEF: In the IDE, select Help > Find Action.., enter "Registry" in the pop-up, and open it.
    • Enable ide.browser.jcef.enabled
    • Disable ide.browser.jcef.sandbox.enable
  1. Configure IDE Runtime: Select Help > Find Action.. again, enter "Choose Boot Runtime for the IDE" in the pop-up, open it, select a newer JCEF Runtime version, and confirm.
  2. Restart the IDE.

4. The MCP service list fails to load

The service list keeps showing a loading state.
  • Restart the IDE.
  • If the issue persists, try manually starting the Qoder CN service:

    Windows


    Go to the directory: .qoder/bin/x.x.x/CPU_architecture_64_system/ Run the command:
    codeblock
    
Qoder CN.exe start

## macOS
---------

Click the Apple icon in the top-left corner of your computer, select "About This Mac" to view the processor model, then go to the corresponding directory:
* M1 chip: `/.qoder/bin/x.x.x/aarch64_darwin/Qoder CN`

* Intel chip: `/.qoder/bin/x.x.x/x86_64_darwin/Qoder CN`

Run the command:

codeblock Qoder CN start

Wait for the startup to complete, then click the login button again.

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />