@microlink/mcp 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -118,10 +118,10 @@ Once the server is configured, talk to your assistant in plain language. It pick
118
118
 
119
119
  - *"Take a full-page screenshot of https://example.com in dark mode."* → `microlink_screenshot`
120
120
  - *"Generate a Letter-size PDF of https://example.com."* → `microlink_pdf`
121
- - *"Get the title, description, and image for https://example.com."* → `microlink_meta`
121
+ - *"Get the title, description, and image for https://example.com."* → `microlink_metadata`
122
122
  - *"Convert https://news.ycombinator.com to Markdown."* → `microlink_markdown`
123
123
  - *"Find the playable video in this YouTube link."* → `microlink_video`
124
- - *"Run a Lighthouse performance audit on https://example.com."* → `microlink_insights`
124
+ - *"Run a Lighthouse performance audit on https://example.com."* → `microlink_lighthouse`
125
125
  - *"Scrape every article title from this page using the `.title` selector."* → `microlink_extract` with `data`
126
126
 
127
127
  Tools can also be invoked directly. Every tool takes a `url` and returns `structuredContent` (see [Response shape](#response-shape)):
@@ -141,25 +141,27 @@ Tools can also be invoked directly. Every tool takes a `url` and returns `struct
141
141
 
142
142
  ### Capabilities at a glance
143
143
 
144
- - `microlink_extract`: metadata extraction + custom scraping rules (`data`) + multi-capability composition in one call.
145
- - `microlink_screenshot`: screenshot generation with element/full-page modes and browser controls.
144
+ Each tool is a thin wrapper over a [`microlink.io`](https://github.com/microlinkhq/microlink/tree/master/packages/core) library method same inputs, same result, one source of truth.
145
+
146
+ - `microlink_metadata`: normalized metadata extraction with include/exclude config.
147
+ - `microlink_logo`: brand logo extraction.
148
+ - `microlink_markdown` / `microlink_html` / `microlink_text`: URL to Markdown / HTML / plain text.
149
+ - `microlink_screenshot`: screenshot generation with element/full-page/animated modes and browser controls.
146
150
  - `microlink_pdf`: PDF generation with page/layout controls.
147
- - `microlink_video`: playable video source extraction.
148
- - `microlink_audio`: playable audio source extraction.
149
- - `microlink_insights`: Lighthouse + technology detection.
150
- - `microlink_meta`: normalized metadata extraction with include/exclude config.
151
- - `microlink_palette`: image palette and contrast color extraction.
152
- - `microlink_markdown`: URL to Markdown conversion.
153
- - `microlink_text`: URL to plain text conversion.
151
+ - `microlink_embed`: oEmbed-style embeddable iframe (`{ html, scripts }`).
152
+ - `microlink_video` / `microlink_audio`: primary playable video / audio source.
153
+ - `microlink_links` / `microlink_images` / `microlink_videos` / `microlink_audios` / `microlink_emails`: collect every link / image / video / audio / email on the page.
154
+ - `microlink_technologies`: technology-stack detection (Wappalyzer).
155
+ - `microlink_lighthouse`: Google Lighthouse audit.
156
+ - `microlink_search`: Google as structured data (requires an API key).
157
+ - `microlink_function`: run a JavaScript function in Microlink's server-side browser sandbox.
158
+ - `microlink_extract`: custom scraping rules (`data`) + multi-capability composition in one call.
154
159
  - Cross-cutting request capabilities: device/viewport emulation, click/scroll actions, JS/CSS injection, modules, wait conditions, cache controls (`ttl`, `staleTtl`, `force`), retries/timeouts, media mode, headers/proxy, and endpoint/auth routing.
155
160
 
156
161
  ### Response shape
157
162
 
158
- - All tools (`microlink_extract`, `microlink_screenshot`, `microlink_pdf`, `microlink_video`, `microlink_audio`, `microlink_insights`, `microlink_meta`, `microlink_palette`, `microlink_markdown`, `microlink_text`) return `structuredContent` with:
159
- - `endpoint`, `requestUrl`, `finalUrl`, `statusCode`, `responseHeaders`, `microlink`
160
- - `microlink` preserves Microlink API JSend payload (`status`, `data`, and error fields like `code`, `id`, `message`, `more`, `report`).
161
- - `responseHeaders` includes key cache/rate headers (such as `x-cache-status`, `cf-cache-status`, `cache-control`, `x-rate-limit-*`) when present.
162
- - MCP `isError` is set when transport fails or when `microlink.status !== "success"`.
163
+ - Each tool returns the library's **direct result** under `structuredContent.data` (and the same value as pretty-printed JSON text). For example `microlink_markdown` `{ data: "# Title\n..." }`, `microlink_screenshot` `{ data: { url, type, width, height, size } }`, `microlink_links` `{ data: ["https://...", ...] }`.
164
+ - On failure the tool sets MCP `isError` and returns `{ error: { message, code?, status?, statusCode?, url?, more? } }`. A `429` also includes a free-quota `hint`.
163
165
 
164
166
  Parameters labeled `PRO` in the official Microlink docs require a paid plan.
165
167
  For compatibility with some MCP clients:
@@ -221,7 +223,7 @@ For `screenshot`, `pdf`, and `insights`, use `true` for defaults or an object fo
221
223
 
222
224
  ### `microlink_screenshot`
223
225
 
224
- Capture a screenshot of any public URL and receive a permanent CDN asset URL (`data.screenshot.url`).
226
+ Capture a screenshot of any public URL and return the screenshot asset object (`url`, `type`, `width`, `height`, `size`).
225
227
  Set `screenshot` to `true` for defaults, or pass `screenshot: { ... }` for options. `screenshot: {}` is treated as `true`.
226
228
 
227
229
  **Key parameters:**
@@ -266,7 +268,7 @@ Set `screenshot` to `true` for defaults, or pass `screenshot: { ... }` for optio
266
268
 
267
269
  ### `microlink_pdf`
268
270
 
269
- Generate a PDF of any public URL and receive a permanent CDN asset URL (`data.pdf.url`).
271
+ Generate a PDF of any public URL and return the PDF asset object (`url`, `type`, `size`).
270
272
  Set `pdf` to `true` for defaults, or pass `pdf: { ... }` for options. `pdf: {}` is treated as `true`.
271
273
 
272
274
  **Key parameters:**
@@ -308,7 +310,7 @@ Set `pdf` to `true` for defaults, or pass `pdf: { ... }` for options. `pdf: {}`
308
310
 
309
311
  ### `microlink_video`
310
312
 
311
- Detect and extract a playable video source from any URL. Returns the video URL in `data.video.url` along with `type`, `duration`, `size`, `width`, `height`, `duration_pretty`, and `size_pretty`.
313
+ Detect and extract a playable video source from any URL. Returns the video asset object: `url`, `type`, `duration`, `size`, `width`, `height`, `duration_pretty`, and `size_pretty`.
312
314
 
313
315
  Supports YouTube, Vimeo, Twitter/X, TikTok, Instagram, Dailymotion, and hundreds of other platforms.
314
316
 
@@ -324,7 +326,7 @@ Supports YouTube, Vimeo, Twitter/X, TikTok, Instagram, Dailymotion, and hundreds
324
326
 
325
327
  ### `microlink_audio`
326
328
 
327
- Detect and extract a playable audio source from any URL. Returns the audio URL in `data.audio.url` along with `type`, `duration`, `size`, `duration_pretty`, and `size_pretty`.
329
+ Detect and extract a playable audio source from any URL. Returns the audio asset object: `url`, `type`, `duration`, `size`, `duration_pretty`, and `size_pretty`.
328
330
 
329
331
  Supports SoundCloud, Spotify, Mixcloud, and other audio platforms.
330
332
 
@@ -338,29 +340,42 @@ Supports SoundCloud, Spotify, Mixcloud, and other audio platforms.
338
340
 
339
341
  ---
340
342
 
341
- ### `microlink_insights`
343
+ ### `microlink_technologies`
344
+
345
+ Detect the technology stack behind any URL (frameworks, CDNs, analytics, e-commerce, ...) via Wappalyzer. Returns the array of detected technologies.
346
+
347
+ Mirrors the `microlink.technologies(url)` library method.
348
+
349
+ **Key parameters:**
350
+
351
+ | Parameter | Type | Description |
352
+ |-----------|------|-------------|
353
+ | `url` | `string` | The URL to analyze *(required)* |
354
+ | `apiKey` | `string` | Microlink API key *(optional)* |
355
+
356
+ ---
357
+
358
+ ### `microlink_lighthouse`
359
+
360
+ Run a Google Lighthouse audit (performance, accessibility, best-practices, SEO) for any URL. Returns the Lighthouse report.
342
361
 
343
- Get web performance and technology-stack insights for any URL.
344
- Set `insights` to `true` for defaults, or pass `insights: { ... }` for options. `insights: {}` is treated as `true`.
362
+ Mirrors the `microlink.lighthouse(url)` library method.
345
363
 
346
364
  **Key parameters:**
347
365
 
348
366
  | Parameter | Type | Description |
349
367
  |-----------|------|-------------|
350
368
  | `url` | `string` | The URL to analyze *(required)* |
351
- | `insights` | `boolean \| object` | Enable default insights (`true`) or provide insights options (`{...}`); `{}` behaves as `true` |
352
- | `insights.lighthouse` | `boolean \| object` | Run a Lighthouse audit |
353
- | `insights.lighthouse.output` | `"json" \| "html" \| "csv"` | Report format (default: `"json"`) |
354
- | `insights.lighthouse.preset` | `string` | Audit preset: `"default"`, `"desktop"`, `"perf"`, `"experimental"`, `"full"`, `"lr-desktop"`, `"lr-mobile"` |
355
- | `insights.lighthouse.onlyCategories` | `string \| string[]` | Lighthouse category IDs (e.g. `["performance", "accessibility"]`) |
356
- | `insights.technologies` | `boolean` | Detect tech stack via Wappalyzer |
369
+ | `apiKey` | `string` | Microlink API key *(optional)* |
357
370
 
358
371
  ---
359
372
 
360
- ### `microlink_meta`
373
+ ### `microlink_metadata`
361
374
 
362
375
  Extract normalized metadata from any public URL. Returns: `title`, `description`, `lang`, `author`, `publisher`, `date`, `url`, `image` (with dimensions and file info), and `logo` (publisher favicon).
363
376
 
377
+ Mirrors the `microlink.metadata(url)` library method.
378
+
364
379
  **Key parameters:**
365
380
 
366
381
  | Parameter | Type | Description |
@@ -370,25 +385,39 @@ Extract normalized metadata from any public URL. Returns: `title`, `description`
370
385
 
371
386
  ---
372
387
 
373
- ### `microlink_palette`
388
+ ### `microlink_logo`
374
389
 
375
- Extract a color palette from images detected on any public URL. For each image returns: `palette` (hex colors from most to least dominant), `background_color` (optimal WCAG-contrast background), `color` (best overlay color), and `alternative_color`.
390
+ Extract the brand logo of any public URL. Returns the logo asset in `data.logo`: `url`, `type`, `width`, `height`, `size`, and `size_pretty`.
376
391
 
377
- Color data is nested under each image field (e.g. `data.image.palette`). Useful for generating design tokens, theming, or accessibility checks.
392
+ Mirrors the `microlink.logo(url, { square })` library method. Useful for building link previews, favicons, or brand cards.
378
393
 
379
394
  **Key parameters:**
380
395
 
381
396
  | Parameter | Type | Description |
382
397
  |-----------|------|-------------|
383
398
  | `url` | `string` | The URL to analyze *(required)* |
384
- | `meta` | `boolean \| object` | Control metadata fields returned |
385
- | `palette` | `boolean` | Enable palette extraction (default: `true`) |
399
+ | `square` | `boolean` | Prefer a square (icon-shaped) logo variant |
386
400
 
387
401
  ---
388
402
 
389
403
  ### `microlink_markdown`
390
404
 
391
- Convert any public URL to Markdown. Returns JSON output with Markdown content in `microlink.data.markdown`, useful for extracting readable content from web pages, articles, and documentation.
405
+ Convert any public URL to Markdown. Returns the page content as a Markdown string, useful for extracting readable content from web pages, articles, and documentation.
406
+
407
+ **Key parameters:**
408
+
409
+ | Parameter | Type | Description |
410
+ |-----------|------|-------------|
411
+ | `url` | `string` | The URL to convert *(required)* |
412
+ | `apiKey` | `string` | Microlink API key *(optional)* |
413
+
414
+ ---
415
+
416
+ ### `microlink_html`
417
+
418
+ Extract the HTML content of any public URL. Returns the page HTML as a string.
419
+
420
+ Mirrors the `microlink.html(url)` library method.
392
421
 
393
422
  **Key parameters:**
394
423
 
@@ -401,7 +430,7 @@ Convert any public URL to Markdown. Returns JSON output with Markdown content in
401
430
 
402
431
  ### `microlink_text`
403
432
 
404
- Extract plain text from any public URL. Returns JSON output with plain text content in `microlink.data.text`.
433
+ Extract plain text from any public URL. Returns the readable page text as a string.
405
434
 
406
435
  **Key parameters:**
407
436
 
@@ -412,6 +441,71 @@ Extract plain text from any public URL. Returns JSON output with plain text cont
412
441
 
413
442
  ---
414
443
 
444
+ ### `microlink_embed`
445
+
446
+ Get the oEmbed-style embeddable iframe for any URL (YouTube, Tweet, CodePen, ...). Returns `{ html, scripts }` — the markup plus the script URLs it needs.
447
+
448
+ Mirrors the `microlink.embed(url)` library method.
449
+
450
+ **Key parameters:**
451
+
452
+ | Parameter | Type | Description |
453
+ |-----------|------|-------------|
454
+ | `url` | `string` | The URL to embed *(required)* |
455
+ | `apiKey` | `string` | Microlink API key *(optional)* |
456
+
457
+ ---
458
+
459
+ ### `microlink_links` / `microlink_images` / `microlink_videos` / `microlink_audios` / `microlink_emails`
460
+
461
+ Collect every link, image, video source, audio source, or email address on a page. Each returns a clean, absolute, deduped array under `data.links` / `data.images` / `data.videos` / `data.audios` / `data.emails`.
462
+
463
+ Mirror the `microlink.links(url)` / `.images(url)` / `.videos(url)` / `.audios(url)` / `.emails(url)` library methods. For the single primary playable media, use `microlink_video` / `microlink_audio`.
464
+
465
+ **Key parameters:**
466
+
467
+ | Parameter | Type | Description |
468
+ |-----------|------|-------------|
469
+ | `url` | `string` | The URL to scan *(required)* |
470
+ | `apiKey` | `string` | Microlink API key *(optional)* |
471
+
472
+ ---
473
+
474
+ ### `microlink_search`
475
+
476
+ Search Google and get structured results (requires an API key). Returns `results` (title, url, description) plus `knowledgeGraph`, `peopleAlsoAsk`, and `relatedSearches` when Google surfaces them.
477
+
478
+ Mirrors the `microlink.search(query)` library method. Google search operators (`site:`, `filetype:`, quotes, ...) work as-is.
479
+
480
+ **Key parameters:**
481
+
482
+ | Parameter | Type | Description |
483
+ |-----------|------|-------------|
484
+ | `query` | `string` | The search query *(required)* |
485
+ | `apiKey` | `string` | Microlink API key *(required for this tool)* |
486
+ | `type` | `string` | Vertical: `search` (default), `news`, `images`, `videos`, `places`, `maps`, `shopping`, `scholar`, `patents`, `autocomplete` |
487
+ | `limit` | `number` | Max results |
488
+ | `location` | `string` | Two-letter country code (e.g. `es`) |
489
+ | `period` | `string` | Recency filter: `hour`, `day`, `week`, `month`, `year` |
490
+
491
+ ---
492
+
493
+ ### `microlink_function`
494
+
495
+ Run a JavaScript function against any public URL inside Microlink's server-side browser sandbox. The function receives `{ page, response, ...args }` and its return value comes back in `value` (plus `isFulfilled`, `profiling`, `logging`).
496
+
497
+ Mirrors the `microlink.function(url, code)` library method.
498
+
499
+ **Key parameters:**
500
+
501
+ | Parameter | Type | Description |
502
+ |-----------|------|-------------|
503
+ | `url` | `string` | The URL to run against *(required)* |
504
+ | `code` | `string` | Function source, e.g. `"async ({ page }) => page.title()"` *(required)* |
505
+ | `apiKey` | `string` | Microlink API key *(optional)* |
506
+
507
+ ---
508
+
415
509
  ## Authentication
416
510
 
417
511
  Every tool accepts an optional `apiKey` parameter. The key is resolved from these sources in order of priority:
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@microlink/mcp",
3
3
  "description": "MCP server for Microlink API",
4
- "homepage": "https://github.com/microlinkhq/mcp",
5
- "version": "1.0.0",
4
+ "homepage": "https://github.com/microlinkhq/microlink",
5
+ "version": "1.1.0",
6
6
  "main": "./src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js"
@@ -10,6 +10,11 @@
10
10
  "bin": {
11
11
  "microlink-mcp": "./bin/microlink-mcp.js"
12
12
  },
13
+ "author": {
14
+ "email": "hello@microlink.io",
15
+ "name": "microlink.io",
16
+ "url": "https://microlink.io"
17
+ },
13
18
  "contributors": [
14
19
  {
15
20
  "name": "Joseba",
@@ -21,11 +26,12 @@
21
26
  }
22
27
  ],
23
28
  "repository": {
29
+ "directory": "packages/mcp",
24
30
  "type": "git",
25
- "url": "git+https://github.com/microlinkhq/mcp.git"
31
+ "url": "git+https://github.com/microlinkhq/microlink.git"
26
32
  },
27
33
  "bugs": {
28
- "url": "https://github.com/microlinkhq/mcp/issues"
34
+ "url": "https://github.com/microlinkhq/microlink/issues"
29
35
  },
30
36
  "keywords": [
31
37
  "api",
@@ -37,25 +43,11 @@
37
43
  "server"
38
44
  ],
39
45
  "dependencies": {
40
- "@microlink/mql": "~0.16.1",
46
+ "@microlink/mql": "0.17.0",
41
47
  "@modelcontextprotocol/sdk": "1.29.0",
48
+ "microlink.io": "0.0.1",
42
49
  "zod": "~4.4.3"
43
50
  },
44
- "devDependencies": {
45
- "@commitlint/cli": "latest",
46
- "@commitlint/config-conventional": "latest",
47
- "ava": "latest",
48
- "c8": "latest",
49
- "ci-publish": "latest",
50
- "conventional-changelog-cli": "latest",
51
- "finepack": "latest",
52
- "git-authors-cli": "latest",
53
- "github-generate-release": "latest",
54
- "nano-staged": "latest",
55
- "simple-git-hooks": "latest",
56
- "standard": "latest",
57
- "standard-version": "latest"
58
- },
59
51
  "engines": {
60
52
  "node": ">=20"
61
53
  },
@@ -64,41 +56,15 @@
64
56
  "scripts",
65
57
  "src"
66
58
  ],
67
- "license": "MIT",
68
- "commitlint": {
69
- "extends": [
70
- "@commitlint/config-conventional"
71
- ]
72
- },
73
- "nano-staged": {
74
- "*.js": [
75
- "npx @kikobeats/prettier-standard",
76
- "standard --fix"
77
- ],
78
- "package.json": [
79
- "finepack"
80
- ]
59
+ "scripts": {
60
+ "postinstall": "node scripts/postinstall.js",
61
+ "start": "node src/index.js",
62
+ "test": "node --test test/*.test.js"
81
63
  },
64
+ "license": "MIT",
82
65
  "publishConfig": {
83
66
  "access": "public"
84
67
  },
85
- "simple-git-hooks": {
86
- "commit-msg": "npx commitlint --edit",
87
- "pre-commit": "npx nano-staged"
88
- },
89
68
  "type": "module",
90
- "scripts": {
91
- "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
92
- "postinstall": "node scripts/postinstall.js",
93
- "postrelease": "pnpm release:tags && pnpm release:github && (ci-publish || pnpm publish --access=public)",
94
- "release": "pnpm release:version && pnpm release:changelog && pnpm release:commit && pnpm release:tag",
95
- "release:changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s",
96
- "release:commit": "git add package.json CHANGELOG.md && git commit -m \"chore(release): $(node -p \"require('./package.json').version\")\"",
97
- "release:github": "github-generate-release",
98
- "release:tag": "git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",
99
- "release:tags": "git push origin HEAD:master --follow-tags",
100
- "release:version": "standard-version --skip.changelog --skip.commit --skip.tag",
101
- "start": "node src/index.js",
102
- "test": "node --test test/*.test.js"
103
- }
104
- }
69
+ "gitHead": "b28aa7d6434ac1bb43b084d7e329efec97dab36a"
70
+ }
@@ -1,5 +1,6 @@
1
1
  const WIDTH = 74
2
2
 
3
+ // eslint-disable-next-line no-control-regex
3
4
  const ANSI_PATTERN = /\u001b\[[0-9;]*m/g
4
5
  const hasColor = process.stdout.isTTY && process.env.NO_COLOR === undefined
5
6
 
@@ -39,10 +40,16 @@ const lines = [
39
40
  borderLine(),
40
41
  contentLine(`${colors.bold}MICROLINK MCP${colors.reset}`),
41
42
  contentLine(),
42
- contentLine(`${colors.bold}Free plan:${colors.reset} 50 requests/day included.`),
43
+ contentLine(
44
+ `${colors.bold}Free plan:${colors.reset} 50 requests/day included.`
45
+ ),
43
46
  contentLine(`${colors.yellow}Need more or unlimited usage?${colors.reset}`),
44
- contentLine(`Get an API key at ${colors.green}https://microlink.io/#pricing${colors.reset}`),
45
- contentLine(`${colors.gray}Tip:${colors.reset} set MICROLINK_API_KEY in your MCP server env.`),
47
+ contentLine(
48
+ `Get an API key at ${colors.green}https://microlink.io/#pricing${colors.reset}`
49
+ ),
50
+ contentLine(
51
+ `${colors.gray}Tip:${colors.reset} set MICROLINK_API_KEY in your MCP server env.`
52
+ ),
46
53
  borderLine()
47
54
  ]
48
55
 
package/src/index.js CHANGED
@@ -8,7 +8,10 @@ import { tools } from './tools/index.js'
8
8
  const require = createRequire(import.meta.url)
9
9
  const { version: pkgVersion } = require('../package.json')
10
10
 
11
- export function createMicrolinkServer ({ name = 'microlink-mcp-server', version = pkgVersion } = {}) {
11
+ export function createMicrolinkServer ({
12
+ name = 'microlink-mcp-server',
13
+ version = pkgVersion
14
+ } = {}) {
12
15
  const server = new McpServer({
13
16
  name,
14
17
  version