# Cursor MCP Setup Guide

> Add the desplega.ai Playwright MCP server to Cursor with an mcp.json configuration, then run Playwright-powered QA checks directly from your editor.

[View on desplega.ai](https://www.desplega.ai/how-to/mcp/cursor)

## Prerequisites

- Cursor IDE installed on your machine
- Node.js v18 or higher and npm installed
- A desplega.ai API key from the MCP server registration flow or the desplega.ai app

## Quick Answer: How to Add an MCP Server to Cursor

To add the desplega.ai Playwright MCP server to Cursor, create a new MCP server entry,
paste the `mcp.json` configuration below, set `QA_USE_API_KEY` to your desplega.ai key,
restart Cursor, and verify the server from Cursor chat with a simple QA test prompt.

## Open Cursor Settings

Navigate to **Cursor Settings -> MCP -> New MCP Server**.

## Add MCP Server Configuration

Add this configuration to your Cursor `mcp.json` file:

```json
{
  "mcpServers": {
    "desplega-qa": {
      "command": "npx",
      "args": ["-y", "@desplega.ai/qa-use-mcp@latest"],
      "env": {
        "QA_USE_API_KEY": "your-desplega-ai-api-key"
      }
    }
  }
}
```

Replace `your-desplega-ai-api-key` with your real API key.

## Restart Cursor

Restart Cursor after saving the MCP configuration so the editor can load the server.

## Verify Installation

Open Cursor's AI chat and run:

```text
Initialize desplega QA mcp and test ...
```

The MCP server should initialize, install Playwright browsers if needed, and start a browser automation test.

## Troubleshooting

### Why is the MCP server not appearing in Cursor?

Restart Cursor after editing `mcp.json`, then check that the JSON has no trailing commas or missing braces.

### Why am I seeing authentication errors?

Verify that `QA_USE_API_KEY` matches your desplega.ai API key and has not expired.

### Why does browser launch fail?

The MCP server installs Playwright browsers on first use. Make sure your machine has enough disk space and permission to install browser binaries.

### What Cursor MCP tools help with QA testing?

The desplega.ai MCP server gives Cursor access to browser-based QA actions: initialize a test session, inspect a page, generate Playwright-style checks from natural language, and run exploratory flows without leaving the editor.

### How do I troubleshoot Playwright MCP connection errors in Cursor IDE?

Check that the server is inside the top-level `mcpServers` object, confirm the JSON has no trailing commas, verify `QA_USE_API_KEY`, and fully quit and reopen Cursor so it reloads the MCP process.

## Next Steps

- [Running your first tests](https://www.desplega.ai/how-to/mcp/first-tests)
- [Testing workflows](https://www.desplega.ai/how-to/mcp/workflows)
