# VS Code

Use pdf-mcp from an agent chat in VS Code. You need VS Code with MCP support, access to Copilot chat, and a [pdf-mcp account](https://app.pdf-mcp.io).

## Connect

[Add to VS Code](vscode:mcp/install?%7B%22name%22%3A%22pdf-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.pdf-mcp.io%2Fmcp%22%7D)

1. Open the link above and allow your browser to launch VS Code.
2. Review and install the `pdf-mcp` server. Allow it to start when prompted.
3. Complete the browser sign-in to pdf-mcp, select your workspace, and approve access.
4. Open an agent chat and use **Configure Tools** to enable the pdf-mcp tools.

The link passes the server configuration to VS Code; you authorize access separately through OAuth. Microsoft documents the link format in its [MCP developer guide](https://code.visualstudio.com/api/extension-guides/ai/mcp#_create-an-mcp-installation-url).

## Manual configuration

Run **MCP: Add Server** from the Command Palette, choose **HTTP**, and enter:

```text
https://api.pdf-mcp.io/mcp
```

Or add this configuration to `.vscode/mcp.json` in your project. To use it across projects, run **MCP: Open User Configuration** and add the server there.

```json
{
  "servers": {
    "pdf-mcp": {
      "type": "http",
      "url": "https://api.pdf-mcp.io/mcp"
    }
  }
}
```

Keep any existing servers. This VS Code configuration uses the top-level key `servers`. Start the server from **MCP: List Servers** and complete the browser sign-in. See Microsoft's [server setup guide](https://code.visualstudio.com/docs/agent-customization/mcp-servers).

## Try it

In an agent chat with pdf-mcp tools enabled, ask:

> Use pdf-mcp to create a one-page PDF titled “Hello from VS Code”. Store it and return the browser view link.

Confirm the tool call if requested. PDF generation uses the connected workspace's [credits](https://pdf-mcp.io/credits).

## Troubleshooting

- **Installation link does nothing:** Use **MCP: Add Server** or the JSON configuration above.
- **Server requires authentication:** Open **MCP: List Servers**, select `pdf-mcp`, and follow its authentication prompt.
- **Connected but no tools in chat:** Enable the server's tools in **Configure Tools** and check your organization's MCP policy.

See [MCP troubleshooting](https://pdf-mcp.io/docs/mcp-server#troubleshooting) for credit and permission errors.
