GitHub Copilot

Overview

GitHub Copilot in Visual Studio Code and Visual Studio can connect to Leapwork Play through MCP. After connecting, you can ask Copilot to perform work in Leapwork Play while it also works with your local files, repository, and other IDE tools.

For example, you can ask Copilot:

  • Create a test case in Leapwork Play for this bug.

  • Search Leapwork Play for test cases mentioning admin.

  • Open the failing test case in Leapwork Play and start a browser session.

Copilot will use your normal Leapwork Play account, so it has the same access and permissions that you have in the product.

Before You Start

You need:

  • Visual Studio Code 1.101 or later, or Visual Studio 2022 version 17.14 or later.

  • GitHub Copilot with Agent mode available in chat.

  • Access to Leapwork Play.

The MCP server URL looks like this:

https://mcp.leapwork.ai/mcp

If your organization manages Copilot, an administrator may need to allow MCP servers in Copilot policy settings.

Setup

Add Leapwork Play as a remote MCP server in your IDE.

Visual Studio Code

Create or edit .vscode/mcp.json in your project:

JSON
{
  "servers": {
    "play": {
      "type": "http",
      "url": "https://mcp.leapwork.ai/mcp"
    }
  }
}

To use Leapwork Play from any workspace, run MCP: Open User Configuration and add the same play entry to your user mcp.json file.

If the same server name appears in both places, the workspace configuration takes priority.

Visual Studio

Create or edit one of these files:

  • [SolutionDir]\.mcp.json to share the configuration with your team

  • %USERPROFILE%\.mcp.json for a personal configuration across all solutions

JSON
{
  "servers": {
    "play": {
      "url": "https://mcp.leapwork.ai/mcp"
    }
  }
}

Connect and authenticate

  1. Save mcp.json.

  2. Open Copilot Chat and select Agent from the mode dropdown.

  3. Click Auth or Authenticate from the CodeLens above the play server entry in mcp.json.

  4. Complete the browser sign-in flow for your Leapwork Play account.

After sign-in, Copilot should list the Leapwork Play tools in Agent chat:

  • play_get_skill

  • play_list_capabilities

  • play_call_capability

  • play_call_workflow

  • play_get_pending

  • play_respond

  • play_cancel_workflow

Using Leapwork Play

Once connected, ask Copilot for what you want done in Leapwork Play:

Create a test case in Leapwork Play named after a famous musician.

If Leapwork Play needs approval or clarification, Copilot will show that response and can continue the operation after you answer.

For long-running work, Copilot may receive a running status first. In that case, ask Copilot to call play_get_pending with the returned pendingId, or to continue the operation with play_respond when approval or clarification is required.

Leapwork Play uses MCP Streamable HTTP for Copilot. When the stream stays connected, Copilot receives progress updates and the final result, approval prompt, or clarification prompt on the same request.

Troubleshooting

If Copilot says the server failed to connect:

  • Make sure the MCP URL ends with /mcp.

  • Make sure Leapwork Play is reachable from your machine.

  • Confirm Copilot Chat is in Agent mode.

  • Reconnect or re-authenticate the play server from the CodeLens in mcp.json.

If tools appear invalid or missing:

  • Reconnect the MCP server after Leapwork Play is updated. Copilot requires tool names such as play_call_workflow; older server versions that advertised dotted names such as play.execute are not accepted by Copilot.

  • Restart the MCP server connection if Copilot cached an older tool list.

To inspect connection issues in Visual Studio Code:

  1. Open the Output panel.

  2. Select MCP Logs from the dropdown.

  3. Check for connection, authentication, timeout, or tool validation errors for play.

If authentication succeeds but the server still fails to connect, ask your Leapwork Play administrator to check that external MCP authentication is enabled for your Leapwork Play environment.

Current limitations

  • Copilot must use Agent mode for MCP tool calls.

  • If a connection drops, ask Copilot to check the pending Leapwork Play request with play_get_pending and continue from there.

  • Organization policy may restrict which MCP servers can be used with Copilot.