howto-mcp

howto-mcp

A Model Context Protocol server for querying and reading articles from a how-to documentation portal, with search and retrieval tools scoped to the token's user permissions.

Category
访问服务器

README

@stonedogcode/howto-mcp

A Model Context Protocol server for a how-to documentation portal. Ask what has been written, and read it, without leaving your editor.

> What articles exist about authentication?

3 articles match "authentication".

## Signing in with a passkey
repository: Alpha · slug: signing-in-with-a-passkey
written for: Support (as labelled by its source)
matched headings: Registering a device
…

It contains no documentation of its own, and no permission model. It asks a portal, and the portal answers as the user whose token it holds.

Install

npm install -g @stonedogcode/howto-mcp

Or run it without installing, which is what most MCP clients do:

npx @stonedogcode/howto-mcp

Before you configure it

The portal has to be running and reachable from this machine. This server is a client and holds nothing of its own, so a portal that is down looks exactly like a server that is broken.

Check it first, so a later failure has one fewer possible cause:

curl -s https://howto.example.com/api/health
# {"status":"ok", … ,"database":"ok"}

status: degraded means the portal is up but its database is not. Fix that before going further — search will fail and the error will point here.

And you need a token. Your portal issues them; how depends on the portal. Whatever the mechanism, the token is shown once and stored hashed, so keep it when it is printed. See "The token is an identity, not a key" below before choosing whose it is.

Configure

Two environment variables, both required. The server refuses to start without them rather than failing every request afterwards — a server that starts and then refuses everything looks like a broken portal.

HOWTO_PORTAL_URL Base URL of your portal, e.g. https://howto.example.com
HOWTO_API_TOKEN A token issued by that portal

Claude Code

claude mcp add howto --scope user \
  --env HOWTO_PORTAL_URL=https://howto.example.com \
  --env HOWTO_API_TOKEN=… \
  -- npx -y @stonedogcode/howto-mcp

--scope user registers it for every project rather than the directory you happen to be in. Documentation is not project-specific, and a server registered in one checkout is invisible from the next one — which reads as the server having stopped working.

Then confirm it, rather than assuming:

claude mcp list
# howto: npx -y @stonedogcode/howto-mcp - ✔ Connected

✔ Connected means the server started and answered. It does not mean the token is good — that is not checked until the first search, by design, because the portal is the thing that decides.

Restart Claude Code before expecting the tools in a session that was already open. Then ask it something:

What articles exist about authentication?

Any client that takes a JSON config

{
  "mcpServers": {
    "howto": {
      "command": "npx",
      "args": ["-y", "@stonedogcode/howto-mcp"],
      "env": {
        "HOWTO_PORTAL_URL": "https://howto.example.com",
        "HOWTO_API_TOKEN": "…"
      }
    }
  }
}

When it does not work

The failures are deliberately hard to tell apart from the outside — that is the access model working, not a bad error message — so here is what each one means.

What you see What it is
HOWTO_PORTAL_URL is not set The variable did not reach the process. Client configs vary in whether they inherit your shell; set it in the config, not your profile.
The portal could not be reached. Wrong URL, portal down, or a network path that does not exist from here. Try the curl above from the same machine.
The portal did not accept the configured token. The token is wrong, revoked, or belongs to a deleted user. Issue a new one; the old value cannot be recovered.
No articles match "…" The search ran and its user may read nothing that matches. This is also what you get when the token's user has no grants at all — see below.
There are no repositories available to this token. The token is valid and its user has been granted nothing. Someone with admin rights on the portal grants repositories.

The last two are worth reading twice: a working setup with no access looks almost exactly like a working setup with nothing to find. If list_repos is empty, the problem is grants, not configuration.

The token is an identity, not a key

This server reads exactly what its token's user reads — no more. It performs no access check of its own, deliberately: a second permission model beside the portal's would be a second answer to the same question, and the two drift. A client-side check that says yes when the server would say no is how a tool ends up showing somebody something.

So the way to scope this server is to choose whose token it is. Issue it to a user with the narrowest access that still makes the archive useful to you, and revoke it when that person's access changes.

The token is long-lived and sits in a config file on disk. Treat it as you would any credential in one.

Tools

search_articles

Search across every repository the token may read. Ranked by relevance — titles outrank summaries, which outrank headings, which outrank prose — and every word in the query must appear, so adding a word narrows the results.

Argument
query required What to look for
limit optional Default 10, maximum 50
repo optional Restrict to one repository by name

get_article

Read one article in full, by the repository and slug that search returned.

list_repos

The repositories this token may read, and how many articles each holds.

What it will not tell you

Three things, on purpose, because a documentation tool that is careless here is worse than none:

  • It never reports what it could not see. No "3 of 40 match" — that would disclose that 37 exist. The portal declines to mention them; repeating a total would undo that.
  • A missing article and a forbidden one give the same answer. Two different answers let a caller map what exists by guessing.
  • Errors carry no internals. Not the URL, not the token, not the portal's own error text, not a stack. Error messages are where internal detail escapes most easily, because whoever writes one is debugging at the time.

Each of those has a test asserting it, including one that fails if an error message ever repeats the token or the host.

Requirements

Node 20 or newer, and a portal exposing /api/search, /api/articles/… and /api/repos with bearer-token authentication.

Licence

Apache-2.0. See LICENSE and NOTICE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选