Using MCP server in Visual Studio Code

Connect to an MCP server in Visual Studio Code to access and use MCP tools.

Before you begin

Make sure that the:

About this task

You can use an MCP server in the following ways. Choose the approach that meets your requirements.

  • Install and start an MCP server to use its tools
  • Configure an MCP endpoint in the MCP settings file

Procedure

  • Install and use an MCP server.
    1. In Visual Studio Code, open the chat panel.
    2. Click the Settings icon in the chat panel title bar.
    3. Click MCP Servers.
      The list of configured MCP servers is displayed.
    4. Verify the server status and start the server if needed.
      • If the status indicator is green, the server is running.
      • If the status indicator is red, right-click the server and click Start Server.
    5. Enter prompts in the chat panel to use the MCP tools that the server exposes.
      Tip: If a Dynamic Client Registration not supported message appears when you start the server, click Cancel and start the server again.
  • Configure an MCP endpoint.
    1. In Visual Studio Code, click File > Preferences > Settings.
    2. Search for MCP server.
    3. Click Edit in settings.json.
    4. Add the following configuration in the settings.json file:
      "mcp": {
          "inputs": [ ],
          "servers": {
              "mcp_server_name": {
                  "url": "mcp_endpoint"
              }
          }
      }
    5. Save the settings file and restart Visual Studio Code.
    6. Open the chat panel and run the /mcp command to verify that the MCP server is available.
    7. Enter prompts in the chat panel to use the MCP tools exposed by the server.

What to do next

For more information, see Visual Studio Code documentation: MCP Servers.