> ## Documentation Index
> Fetch the complete documentation index at: https://developer.pdf.co/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Install PDF.co MCP in VS Code with an installation link, or edit your user configuration on Windows.

Install VS Code, sign in to GitHub Copilot with access to MCP tools, and complete the [PDF.co MCP prerequisites](/api/mcp/overview#before-you-start).

Both methods below add PDF.co to your user configuration, keeping your API key outside project files that could be committed or shared. Start with the installation link, or use the manual method to edit the same user configuration.

## Install with one click (recommended)

<a href="vscode:mcp/install?%7B%22name%22%3A%22pdfco%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22pdfco-mcp%22%5D%2C%22env%22%3A%7B%22X_API_KEY%22%3A%22YOUR_PDFCO_API_KEY%22%7D%7D">Install PDF.co in VS Code</a>

1. Open the installation link above and allow your browser to open Visual Studio Code. It opens the **MCP Server: pdfco** details page.
2. Review the name `pdfco`, type `stdio`, command `uvx`, argument `pdfco-mcp`, and environment variable `X_API_KEY`. These fields are read-only on this page.
3. Select **Install** to add the server to your user configuration. Use this option for the setup in this guide.

<Frame caption="Select Install to add PDF.co to your user configuration.">
  <img src="https://mintcdn.com/pdfco/DLM-b6_1sPFWRMay/images/mcp/vs-code/install-server.png?fit=max&auto=format&n=DLM-b6_1sPFWRMay&q=85&s=8d51fa88f12eea98d9315bdb1d46b898" alt="VS Code PDF.co MCP details page showing Install and Install in Workspace buttons and the placeholder server configuration" width="1253" height="808" data-path="images/mcp/vs-code/install-server.png" />
</Frame>

4. After installation, select the **gear icon > Show Configuration (JSON)**.

<Frame caption="Open Show Configuration (JSON) after installation to edit the API key.">
  <img src="https://mintcdn.com/pdfco/DLM-b6_1sPFWRMay/images/mcp/vs-code/show-configuration.png?fit=max&auto=format&n=DLM-b6_1sPFWRMay&q=85&s=e7bcf585ce91a8dd680aab74fade759f" alt="Installed PDF.co MCP server in VS Code with the gear menu open and Show Configuration (JSON) highlighted" width="1257" height="811" data-path="images/mcp/vs-code/show-configuration.png" />
</Frame>

<Warning>
  Enter your API key only in your user configuration, typically `%APPDATA%\Code\User\mcp.json`. Do not put it in a project's `.vscode/mcp.json` or `.mcp.json`; those files can be committed or shared. If you selected **Install in Workspace**, remove only the workspace's `pdfco` entry and follow [Manual setup](#manual-setup) to add it to your user configuration.
</Warning>

5. Confirm that **Show Configuration (JSON)** opened your user configuration. Find `pdfco` and replace `YOUR_PDFCO_API_KEY` under `env.X_API_KEY` with your key from the [PDF.co dashboard](https://app.pdf.co/). Preserve the other settings and save.

<Frame caption="Replace the placeholder value for X_API_KEY in your user configuration.">
  <img src="https://mintcdn.com/pdfco/DLM-b6_1sPFWRMay/images/mcp/vs-code/configuration-api-key.png?fit=max&auto=format&n=DLM-b6_1sPFWRMay&q=85&s=0bff5ab54270de517e3fd31ae1b52f9e" alt="VS Code user mcp.json showing the pdfco server under servers and its X_API_KEY placeholder selected for replacement" width="1255" height="817" data-path="images/mcp/vs-code/configuration-api-key.png" />
</Frame>

6. Continue with [Start PDF.co](#start-pdf-co) to start or restart the server after saving your key.

<Note>
  VS Code does not let you edit the API key on the installation details page. Install first, then replace the placeholder through **Show Configuration (JSON)** before running a conversion. The server can show **Running** and list tools while it still contains the placeholder.
</Note>

The user installation shown above saves to `%APPDATA%\Code\User\mcp.json` and uses the `servers` property. Profile locations can differ; **MCP: Open User Configuration** opens the file for your current profile. The manual method below uses this same user-profile format. The key is stored locally in that file; keep it and screenshots containing it private.

If `pdfco` is already configured in your user profile, reuse that entry and continue with the startup check.

<Accordion title="If the installation link does not open VS Code">
  Copy this URL into Chrome or Edge's address bar, press Enter, and select **Open Visual Studio Code** when prompted:

  ```text theme={null}
  vscode:mcp/install?%7B%22name%22%3A%22pdfco%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22pdfco-mcp%22%5D%2C%22env%22%3A%7B%22X_API_KEY%22%3A%22YOUR_PDFCO_API_KEY%22%7D%7D
  ```
</Accordion>

The link uses `uvx` from your PATH. If VS Code cannot find it, replace the command with the full executable path from the prerequisites. The key placeholder must be replaced locally before processing.

## Manual setup

1. Press **Ctrl+Shift+P** and run **MCP: Open User Configuration**. This opens your user-profile `mcp.json`, outside the project.
2. Add the `pdfco` entry inside the existing `servers` object, preserving other entries and settings. For an empty file, use the complete example below:

```json theme={null}
{
  "servers": {
    "pdfco": {
      "type": "stdio",
      "command": "C:\\Users\\YOUR_WINDOWS_USER\\.local\\bin\\uvx.exe",
      "args": ["pdfco-mcp"],
      "env": {
        "X_API_KEY": "YOUR_PDFCO_API_KEY"
      }
    }
  }
}
```

3. Replace `command` with the full path returned by `(Get-Command uvx -ErrorAction Stop).Source`, using doubled backslashes in JSON. Replace `YOUR_PDFCO_API_KEY` in this user configuration with your key from the [PDF.co dashboard](https://app.pdf.co/).
4. Save, then continue with [Start PDF.co](#start-pdf-co). This configuration passes the key through `env`; it does not show a separate key-input prompt.

## Start PDF.co

1. Save the configuration.
2. Open the Command Palette with **Ctrl+Shift+P** and run **MCP: List Servers**.
3. Select `pdfco` and choose **Start**, or **Restart** if it is already running. Review and accept the server trust prompt if shown.

## Run a sample conversion

Send this prompt in your Copilot chat:

```text theme={null}
Use the PDF.co MCP server (pdfco) and its pdf_to_text tool to convert this PDF:
https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf
If a job ID is returned, use wait_job_completion to wait for completion.
Give me the resulting text-file link.
```

Approve the PDF.co tool calls when requested. Open the final text file after the job completes. See [Verify your connection](/api/mcp/overview#verify-your-connection).

## Troubleshooting

* If the server is missing, run **MCP: Open User Configuration** and check that `pdfco` is inside `servers` in your current user profile.
* If PDF.co appears more than once, keep the entry in your user configuration and remove only the duplicate `pdfco` entries from the project's `.vscode/mcp.json` or `.mcp.json`. Preserve other servers and settings.
* If the server cannot start, inspect its output through **MCP: List Servers** and check the executable path.
* If tools load but processing fails, inspect the PDF.co error response, check `env.X_API_KEY`, and confirm that you replaced the placeholder with your actual key.

For configuration locations and connection controls, see [Add and manage MCP servers in VS Code](https://code.visualstudio.com/docs/agent-customization/mcp-servers).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.