Skip to content

feat: expose product docs through MCP - #60

Merged
Kikobeats merged 3 commits into
masterfrom
feat/mcp-product-docs
Sep 17, 2026
Merged

Kikobeats merged 3 commits into
masterfrom
feat/mcp-product-docs

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Sep 16, 2026

Copy link
Copy Markdown
Member

Goal

Add a microlink_docs MCP tool so agents can fetch the complete parameter documentation for a Microlink product before calling a product tool they do not know well.

Design

  • Expose the existing core docs loader through the microlink.io/cli entry point.
  • Register microlink_docs({ product }) in @microlink/mcp.
  • Constrain product to the 20 products supported by the CLI.
  • Return an actionable validation error for unknown products, including the valid product list.
  • Keep existing product tool descriptions unchanged.

One source of truth

The new tool does not copy or generate product documentation. It calls the same loader used by microlink <product> docs, which fetches https://microlink.io/docs/sdk/methods/<product>.md. This keeps microlink.io as the canonical documentation source and prevents the MCP package from drifting.

Tool contract

microlink_docs({ product }) -> markdown string

Valid products: metadata, logo, markdown, html, text, video, audio, emails, links, images, videos, audios, extract, screenshot, pdf, embed, technologies, lighthouse, search, function.

The tool is read-only and declares a string output schema.

How to verify

pnpm run lint
pnpm --filter microlink.io test
pnpm --filter @microlink/mcp test
pnpm test

The MCP tests mock fetch and cover the happy path, unknown products, and fetch failures.


Note

Low Risk
Read-only documentation fetch with no API-key or billing path; main risk is runtime dependency on microlink.io doc URLs staying available.

Overview
Adds microlink_docs to the MCP server so agents can pull canonical parameter documentation for a Microlink product before calling other product tools.

Core (microlink.io): Publishes a new microlink.io/docs export with the existing docs loader, a fixed products list (20 names), and a test that products stays aligned with library method keys.

MCP: Registers microlink_docs({ product }), which fetches the same markdown as microlink <product> docs from https://microlink.io/docs/sdk/methods/<product>.md. product is validated via the shared products enum (unknown values get an error listing valid choices). Output is a markdown string; default server instructions and README document the tool. Tests cover success, validation, and fetch failures.

Reviewed by Cursor Bugbot for commit f4f14d1. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added the microlink_docs tool for retrieving canonical Markdown documentation for supported products.
    • Added product validation with clear feedback when an unsupported product is requested.
    • Added a public documentation export listing available SDK products.
    • The tool now appears as Product docs and returns a defined Markdown response.
  • Documentation

    • Updated MCP guidance and README content with usage details, supported products, parameters, and response behavior.
    • Added guidance to consult product documentation when tool parameters are unclear.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 94641bf3-ab8d-4da7-9635-bfa0e5127b44

📥 Commits

Reviewing files that changed from the base of the PR and between d20517d and f4f14d1.

📒 Files selected for processing (13)
  • packages/core/bin/docs.js
  • packages/core/package.json
  • packages/core/test/docs.mjs
  • packages/mcp/README.md
  • packages/mcp/src/index.js
  • packages/mcp/src/output-schemas.js
  • packages/mcp/src/schemas.js
  • packages/mcp/src/tools/docs.js
  • packages/mcp/src/tools/index.js
  • packages/mcp/src/tools/register.js
  • packages/mcp/test/docs.test.js
  • packages/mcp/test/stdio-server.test.js
  • packages/mcp/test/tools.test.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Product documentation access

Layer / File(s) Summary
Core documentation export
packages/core/bin/docs.js, packages/core/package.json, packages/core/test/docs.mjs
The core package exports the SDK product list through ./docs. A test verifies that the list matches the SDK method catalog.
MCP documentation contract and loader
packages/mcp/src/schemas.js, packages/mcp/src/output-schemas.js, packages/mcp/src/tools/docs.js
The MCP package validates the required product, declares a string output, and loads product markdown through productDocs.load(product).
MCP registration and guidance
packages/mcp/src/tools/index.js, packages/mcp/src/tools/register.js, packages/mcp/src/index.js, packages/mcp/README.md
The microlink_docs tool is registered with the title Product docs. Instructions and README content describe when and how to call it.
MCP validation coverage
packages/mcp/test/docs.test.js, packages/mcp/test/stdio-server.test.js, packages/mcp/test/tools.test.js
Tests cover successful retrieval, invalid products, fetch errors, HTTP errors, default instructions, and aggregate tool title registration.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant microlink_docs
  participant docsInputSchema
  participant productDocs
  participant microlink.io
  MCPClient->>microlink_docs: submit product
  microlink_docs->>docsInputSchema: validate product
  docsInputSchema-->>microlink_docs: return validated product
  microlink_docs->>productDocs: load product markdown
  productDocs->>microlink.io: fetch documentation
  microlink.io-->>productDocs: return markdown
  productDocs-->>microlink_docs: return markdown
  microlink_docs-->>MCPClient: return docs output
Loading

Merge Risk: ⚪ Minimal · up to f4f14

The new documentation tool’s validated product catalog and README are consistent, with no identified merge-blocking issue.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 13 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing product documentation through MCP.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 13 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mcp-product-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Sep 16, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 35202926339

Warning

No base build found for commit 4cac14f on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 80.79%

Details

  • Patch coverage: 67 of 67 lines across 7 files are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 5682
Covered Lines: 4611
Line Coverage: 81.15%
Relevant Branches: 955
Covered Branches: 751
Branch Coverage: 78.64%
Branches in Coverage %: Yes
Coverage Strength: 27.82 hits per line

💛 - Coveralls

Kikobeats and others added 2 commits September 17, 2026 10:14
MCP was importing the CLI runner just to fetch markdown.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Kikobeats
Kikobeats merged commit cb414bb into master Sep 17, 2026
8 of 9 checks passed
@Kikobeats
Kikobeats deleted the feat/mcp-product-docs branch September 17, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants