
Types2docs
io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 3, 2026
根据调用方提供的 TypeScript 类型声明渲染 Markdown API 参考文档。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
Render a markdown API reference from caller-supplied TypeScript type declarations.
概览
Types2docs 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 Types2docs,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
types2docs
Documenting a TypeScript API usually means keeping a markdown reference in step with the types by hand, and the two drift apart. types2docs takes the other route: you supply the declaration facts you already have — each declaration's name, whether it is an interface, a type alias, an enum, or a function, its doc comment, and the kind-specific payload (the members, the alias's right-hand side, or the function signature) — and it renders the reference from those facts alone, in one pinned layout. Nothing is invented and nothing is reworded: every string in the document comes from your input, verbatim.
The layout never varies. The document opens with a
# title line — "API Reference" unless you supply a
title — followed by one section per declaration, in
the order you supplied them. Each section is a
## heading with the declared name, the doc text as
its own paragraph when one is present, a
Kind: <kind> line, and then the kind body. An
interface renders as a table with one row per member —
member name, type text, and whether the member is
required (yes when optional is absent or false,
no when it is true) — followed by one line per
documented member collecting its doc comment. An enum
renders one line per member, with = <value> when a
value is present and the member's doc comment appended
when it has one. An interface or enum with no members
renders the single line (no members). A type alias
and a function each render as a fenced ts block: for
an alias, type <name> = <definition>; for a function,
the signature exactly as supplied. Paragraphs and
sections are separated by exactly one blank line, and
the document ends with exactly one trailing newline.
Alongside the markdown, the result carries counts: how
many declarations were supplied, one tally per kind,
and how many members the interfaces and enums hold in
total.
The kind rules are structural, and breaking one is a
validation error, not a rendering choice. members is
required for interfaces and enums and forbidden for
type aliases and functions. definition is required
for a type alias and forbidden for every other kind;
signature is required for a function and forbidden
for every other kind. Inside members, type is
required for interface members and forbidden for enum
members, value belongs to enum members only, and
optional is forbidden on enum members. Two
declarations with the same name, or two members with
the same name inside one declaration, are errors too.
Every validation error names the offending path — for
example types[1].members[0].type is required for interface members — and no partial document is
produced. Unknown extra fields are ignored, including
inside declarations and members.
CLI
args.json contains the full arguments object:
The render is printed as JSON:
Exit codes: 0 on success, 1 on a runtime error
(including an unreadable or invalid input file, or
invalid input), 2 on a usage error.
MCP server
MCP client config:
Tools
-
render_api_reference— Render a markdown API reference from caller-supplied TypeScript type declarations: interfaces, type aliases, enums, and functions, in a pinned deterministic layout. Nothing is invented; every string comes from the input.types(array, required, at least 1 item) — the type declarations to document, in document order; each item:name(string, required, non-empty) — declared namekind(string, required) — one of "interface", "type", "enum", or "function"doc(string, optional) — doc comment text for the declarationmembers(array) — required for interface and enum, forbidden for type and function; each item:name(string, required, non-empty) — member nametype(string) — member type text; required for interface members, forbidden for enum membersvalue(string, optional) — enum member value text (enum members only)optional(boolean, optional) — whether the member is optional (interface members only); absent means falsedoc(string, optional) — doc comment text for the member
definition(string) — the alias's right-hand side, verbatim; required for kind "type", forbidden otherwisesignature(string) — the function signature, verbatim; required for kind "function", forbidden otherwise
title(string, optional) — document title; defaults to "API Reference"; an empty string is allowed and renders as#
Returns
{markdown, counts}, wheremarkdownis the rendered document andcountsis{types, interfaces, type_aliases, enums, functions, members}in that key order.
Docker
Development
License
MIT — Copyright (c) 2026 Rene Turcios
来源:README.md,提交 7128866
工具
0版本历史
1- v0.1.0最新Nov 3, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分