Model Context Protocol

更新时间:
复制 MD 格式

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

Before you start

Update the IDE plugin to the required version:

  • JetBrains: version 2.5.0 or later.

  • VS Code: version 2.5.0 or later.

See Install Qoder CN 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 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 marketplaces

Common 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.

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

Important
  • 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.

莫3@1x (46)

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 image (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 MCP FAQ for more help.

莫3@1x (52)

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 image (connected). Expand to view available tools.

莫3

Use MCP tools

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.

页面 10@1x (3)

2. Execute tool

prompts for confirmation before calling an MCP tool.

Press Ctrl+Enter to execute.

页面 10@1x (4)

3. Check execution results

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

页面 10@1x (5)

4. Review code and accept changes

页面 10@1x (13)

Example scenarios

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.

莫3@1x (71)

2. Add MCP service

In MCP Services, configure the MCP server:

  • Name:fetch

  • Type:SSE

  • Service endpoint: Paste the URL you copied. For example:

    https://mcp-****.modelscope.cn/sse

莫3@1x (36)

3. Complete configuration

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

image

4. Use MCP in

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

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

页面 10@1x (14)

Enter the next prompt to generate code:

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

页面 10@1x (15)

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 to verify:

Please help me check my local environment to ensure Node.js is installed

页面 10@1x (8)

2. Add MCP service

In MCP Services, configure the MCP server with the following parameters:

  • Name: weather

  • Type: STDIO

  • Command: npx

  • Arguments:

-y @h1deya/mcp-server-weather

MCP service configuration information

  • Service configuration information

    {
      "mcpServers": {
        "weather": {
          "command": "npx",
            "args": [
                "-y",
                "@h1deya/mcp-server-weather"
            ],
        }
      }
    }
  • Source code: weather MCP service

页面 10@1x (9)

3. Complete configuration

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

页面 10@1x (10)

4. Use MCP in

Switch to Agent mode and enter a prompt to check the weather:

Help me check the weather in San Francisco, USA

页面 10@1x (16)

Enter the next prompt to check weather alerts:

Are there any weather alerts in the US tomorrow?

页面 10@1x (17)

Related links