logo
0
0
WeChat Login
feat(references): 添加语义搜索API文档并更新技能说明

mdoc-skills

Claude Code skill for querying, browsing, and reading the M-Doc document system via natural language.

中文文档


Introduction

mdoc-skills adds an mdoc skill to Claude Code. Once installed, you can paste any mdoc.cc URL—or a short orgSlug/docSlug path—directly into your prompt, and Claude will authenticate against the M-Doc OpenAPI, fetch the document manifest or article content, and display it inline.

Triggers when you:

  • Paste an https://mdoc.cc/… URL
  • Type a short path like mliev/mdoc or mliev/mdoc/v1.0.0/32
  • Ask to "list documents", "read article", "fetch manifest", or "call mdoc api"

Features

  • Parse mdoc.cc URLs and short org/doc[/version[/articleId]] paths automatically
  • Check MDOC_TOKEN and prompt you to create one if it's missing
  • Fetch a document's manifest (table of contents) when no article ID is given, rendered as a tree with article IDs
  • Fetch a specific article's Markdown content when an article ID is provided
  • Suggest the next URL to query after each response

Prerequisites

  • Claude Code installed and configured
  • A personal access token (PAT) for M-Doc (MDOC_TOKEN)

Authentication Setup

  1. Open https://mdoc.cc/settings and navigate to Personal Tokens.
  2. Generate a new PAT. It will look like mdoc_pat_xxxxxxxxxxxxxxxx.
  3. Export it in your terminal (add to ~/.zshrc or ~/.bashrc to persist):
export MDOC_TOKEN="mdoc_pat_your_token_here"

If MDOC_TOKEN is not set when the skill runs, it will stop and show you the setup instructions above.


Usage

Pass any of the following input formats as your prompt argument:

FormatExample
Full URLhttps://mdoc.cc/mliev/mdoc
URL with versionhttps://mdoc.cc/mliev/mdoc/v1.0.0
URL with articlehttps://mdoc.cc/mliev/mdoc/v1.0.0/32
Short pathmliev/mdoc
Short path with versionmliev/mdoc/v1.0.0
Short path with articlemliev/mdoc/v1.0.0/32

Examples

List a document's table of contents:

/mdoc mliev/mdoc

Output (example):

📄 mdoc [version: master] [1] Quick Start [3] Installation [4] Configuration [2] API Reference [5] Authentication [6] Endpoint List

Read a specific article:

/mdoc https://mdoc.cc/mliev/mdoc/v1.0.0/32

Output: The article's raw Markdown content is displayed inline.


How It Works

The skill executes four steps:

  1. Parse arguments — extracts orgSlug, docSlug, version (optional), and articleId (optional) from the input URL or short path.
  2. Check token — runs echo $MDOC_TOKEN; stops and prompts for setup if unset.
  3. Call the API
    • With articleIdGET /openapi/organizations/{org}/documents/{doc}/articles/{id}/content.md
    • Without articleIdGET /openapi/organizations/{org}/documents/{doc}/manifest
  4. Display & suggest — renders the manifest as a tree or shows raw Markdown, then suggests the next query.

API Reference

Key endpoints used by this skill (all require Authorization: Bearer <token>):

EndpointDescription
GET /openapi/organizations/:orgSlug/documentsList documents in an org
GET /openapi/organizations/:orgSlug/documents/:docSlug/manifestGet document manifest (TOC)
GET /openapi/organizations/:orgSlug/documents/:docSlug/articles/:articleId/content.mdGet article Markdown

Full endpoint reference: mdoc/references/endpoints.md


Project Structure

mdoc-skills/ ├── mdoc/ │ ├── SKILL.md # Skill definition and step-by-step logic │ └── references/ │ └── endpoints.md # Full OpenAPI endpoint reference ├── README.md # This file (English) └── README.zh-CN.md # Chinese documentation

About

mdoc-skills 为 Claude Code 添加了 mdoc 技能。安装后,你可以直接将任意 mdoc.cc URL 或 orgSlug/docSlug 短路径粘贴到提示词中,Claude 会自动向 M-Doc OpenAPI 发起认证请求,获取文档目录或文章内容并内联展示。