# MCP

## Table of Contents

- [Install](#install)
- [Add it to your MCP client](#add-it-to-your-mcp-client)
- [Usage](#usage)
- [Tools](#tools)
- [Response format](#response-format)
- [Prompt examples](#prompt-examples)
  - [Extract metadata + screenshot in one request](#extract-metadata--screenshot-in-one-request)
  - [Screenshot with overlay](#screenshot-with-overlay)
  - [Generate a PDF](#generate-a-pdf)
  - [Get page insights](#get-page-insights)
  - [Convert a page to Markdown](#convert-a-page-to-markdown)

---

Microlink MCP exposes [Microlink API](https://microlink.io/docs/api/getting-started/overview) as MCP tools for assistants like Claude, Codex, Cursor, and VS Code.

## Install

No global install is required. Run with `npx` (or `pnpm dlx` if you use pnpm):

npx -y @microlink/mcp

pnpm dlx @microlink/mcp

## Add it to your MCP client

Use this `mcpServers` entry:

```json
{

"mcpServers":{

"microlink":{

"command":"npx",

"args":["-y","@microlink/mcp"],

"env":{

"MICROLINK_API_KEY":"YOUR_MICROLINK_API_KEY"

}

}

}

}
```

Sign up for a free API key at [dashboard.microlink.io](https://dashboard.microlink.io/signup?from=/docs/api/getting-started/mcp&cta=docs:content): 25 requests per day with every Pro feature. Paid plans at [microlink.io/pricing](https://microlink.io/pricing) add volume.

## Usage

Once you've added the MCP to your favorite LLM client, try asking it to take a screenshot of a specific webpage, generate a PDF, or fetch metadata. Just use plain language to describe what you want — the agent will know which **tool** to call and with what parameters.

## Tools

- **microlink_extract**: General extractor. Metadata + custom `data` scraping + optional screenshot/pdf/video/audio/insights/palette in one call.
- **microlink_screenshot**: Capture screenshots (`fullPage`, `element`, `overlay`, `type`, etc.).
- **microlink_pdf**: Generate PDFs (`format`, `margin`, `scale`, `pageRanges`, etc.).
- **microlink_video**: Extract playable video source (`data.video`).
- **microlink_audio**: Extract playable audio source (`data.audio`).
- **microlink_insights**: Lighthouse + technology detection.
- **microlink_meta**: Normalized metadata only (`title`, `description`, `image`, `logo`, etc.).
- **microlink_palette**: Extract color palette from detected images.
- **microlink_markdown**: Convert URL content to Markdown (`microlink.data.markdown`).
- **microlink_text**: Convert URL content to plain text (`microlink.data.text`).

Notes:

- **screenshot**, **pdf**, and **insights** accept `true` or `{ ...options }`.
- Empty objects like `{}` are treated as `true`.
- Boolean strings (`"true"`, `"false"`) and JSON-stringified objects are normalized for compatibility with some MCP clients.

## Response format

- All tools return `structuredContent` with:
  - `endpoint`, `requestUrl`, `finalUrl`, `statusCode`, `responseHeaders`, `microlink`
- For markdown/text specifically:
  - Markdown content is in `microlink.data.markdown`
  - Plain text content is in `microlink.data.text`

## Prompt examples

### Extract metadata + screenshot in one request

*"Get a full page screenshot of microlink.io and include the metadata"*

```json
{

"tool":"microlink_extract",

"arguments":{

"url":"https://microlink.io",

"screenshot":{

"fullPage":true

},

"meta":true

}

}
```

### Screenshot with overlay

*"Get a screenshot of microlink.io with a dark browser overlay"*

```json
{

"tool":"microlink_screenshot",

"arguments":{

"url":"https://microlink.io",

"screenshot":{

"overlay":{"browser":"dark"},

"type":"png"

}

}

}
```

### Generate a PDF

*"Download a pdf of example.com"*

```json
{

"tool":"microlink_pdf",

"arguments":{

"url":"https://example.com",

"pdf":{

"format":"A4",

"margin":"0.35cm"

}

}

}
```

### Get page insights

*"Check the performance of microlink.io"*

```json
{

"tool":"microlink_insights",

"arguments":{

"url":"https://microlink.io",

"insights":{

"lighthouse":{"preset":"perf"},

"technologies":true

}

}

}
```

### Convert a page to Markdown

*"Read <https://microlink.io/blog/antibot-detection-at-scale> as markdown and give the key points of the article"*

```json
{

"tool":"microlink_markdown",

"arguments":{

"url":"https://microlink.io/blog/antibot-detection-at-scale"

}

}
```