> This page is for Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Agent setup

> Copy-paste commands to connect a coding agent to the Fern CLI, the fern-docs agent skill, and Fern's MCP server.

If you're an agent reading this page, run these commands yourself rather than asking the user to run them. The only step that needs a human is the browser login that `fern login` opens.

## Claude Code

```bash
npm install -g fern-api
fern login
npx skills add fern-api/skills --skill fern-docs -a claude-code
fern mcp install --client claude
```

## Cursor

```bash
npm install -g fern-api
fern login
npx skills add fern-api/skills --skill fern-docs -a cursor
fern mcp install --client cursor
```

## Codex

```bash
npm install -g fern-api
fern login
npx skills add fern-api/skills --skill fern-docs -a codex
fern mcp install --client codex
```

## GitHub Copilot

```bash
npm install -g fern-api
fern login
npx skills add fern-api/skills --skill fern-docs -a github-copilot
```

[`fern mcp install`](/learn/cli-api-reference/cli-reference/commands) supports Claude Code, Cursor, and Codex only, so register the server in `.vscode/mcp.json` and complete the browser login it prompts for on first use:

```json
{
  "servers": {
    "fern-org": { "url": "https://fai.buildwithfern.com/organizations/YOUR_ORGANIZATION/mcp" }
  }
}
```

`YOUR_ORGANIZATION` is the `organization` field in `fern/fern.config.json`.

## Other MCP clients

Claude Desktop, Windsurf, VS Code, and any other client take the server URL directly: `https://fai.buildwithfern.com/organizations/YOUR_ORGANIZATION/mcp`, with a browser login on first use.

Install the skill with `npx skills add fern-api/skills --skill fern-docs -g`, which writes it to the shared `.agents/skills/` location instead of a single agent's directory.