MCP Discovery is a Rust command-line tool that automatically discovers and documents the capabilities of a Model Context Protocol (MCP) server. It can print server tools, resources, and features in a terminal or save them to files in several formats.
One way to think about it: MCP Discovery is to an MCP server what Swagger is to a REST API.
| Comparison | REST API ecosystem | MCP server ecosystem |
|---|---|---|
| Protocol/specification | OpenAPI Specification | Model Context Protocol |
| Documentation generator | Swagger / OpenAPI Generator | MCP Discovery |
| Generated content | API endpoints, parameters, response formats | Tools, resources, capabilities |
| Output formats | HTML (Swagger UI), JSON | Markdown, HTML, TXT, custom templates |
What is MCP (Model Context Protocol)?
MCP is a standardized protocol for interaction between AI models and external tools and resources. An MCP server can expose various capabilities:
- Tools are functions or operations a model can call.
- Resources are data sources a model can read.
- Capabilities describe the features a server supports.
What can MCP Discovery do?
| Feature | Description |
|---|---|
| Terminal output | Print detailed server information directly on the command line |
| File creation | Generate capability documentation in Markdown, HTML, or plain text |
| File updates | Automatically update the MCP server capabilities section of an existing document |
| Custom templates | Customize the output format using the Handlebars template engine |
| CI/CD integration | Automate documentation maintenance using a GitHub Action |
Installation
# 具体安装方式请参考官方文档
# https://github.com/rust-mcp-stack/mcp-discovery
Basic commands
Subcommands
| Command | Description |
|---|---|
print | Display MCP server capabilities in the terminal (default) |
create | Create a new file containing capability information |
update | Refresh the capabilities section of an existing file |
Common options
| Option | Description |
|---|---|
-f, --filename <FILE> | Specify the output file for create/update |
-t, --template <TEMPLATE> | Select a built-in template: md, md-plain, html, txt |
-p, --template-file <FILE> | Use a custom Handlebars template file |
-s, --template-string <STRING> | Supply a Handlebars template string directly |
Usage examples
1. Display MCP server capabilities in the terminal
mcp-discovery -- npx -y @modelcontextprotocol/server-everything
2. Generate HTML documentation
mcp-discovery create -f capabilities.html -- npx -y @modelcontextprotocol/server-everything
3. Generate Markdown documentation
mcp-discovery create -f capabilities.md -- npx -y @modelcontextprotocol/server-everything
4. Use a custom template
mcp-discovery create -f capabilities.md --template-file=custom_template.hbs -- npx -y @modelcontextprotocol/server-everything
Built-in templates
| Template | Description |
|---|---|
md | Tabular Markdown, suitable for a README |
md-plain | Simple plain-text Markdown |
html | HTML with basic styling |
txt | Unformatted plain text |
💡 Tip: If you leave out the template, MCP Discovery chooses a built-in template based on the file extension.
How document markers work
The update command uses marker comments to locate the region to update. After it runs, the content between those markers is replaced with the latest server capability information.
Example Markdown file
# Server Info and Capabilities
<!-- mcp-discovery-render -->
(这里的内容会被自动替换)
<!-- mcp-discovery-render-end -->
Specify a template
<!-- mcp-discovery-render template=md-plain -->
<!-- mcp-discovery-render-end -->
Specify a custom template file
<!-- mcp-discovery-render template-file=my-custom-template.hbs -->
<!-- mcp-discovery-render-end -->
Example HTML file
<!DOCTYPE html>
<html lang="en">
<head>
<title>My MCP Server</title>
</head>
<body>
<h1>MCP Server Details</h1>
<div>
<!-- mcp-discovery-render -->
<!-- mcp-discovery-render-end -->
</div>
</body>
</html>
Inline templates
In an HTML file, you can define an inline template inside the markers:
<h1>MCP Server Details</h1>
<div>
<!-- mcp-discovery-render -->
<!-- mcp-discovery-template
<b>Name: </b>{{name}}
<br/>
<b>Version: </b>{{version}}
<br/>
<b>Number of tools:</b> {{len tools}}
<h2>Summary:</h2>
{{> html-summary }}
mcp-discovery-template-end -->
<!-- mcp-discovery-render-end -->
</div>
GitHub Action integration
MCP Discovery provides an official GitHub Action that can update the documentation automatically in a CI/CD workflow:
# .github/workflows/update-mcp-docs.yml
name: Update MCP Documentation
on:
push:
branches: [main]
workflow_dispatch:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update MCP capabilities
uses: rust-mcp-stack/mcp-discovery-action@v1
with:
file: README.md
command: "npx -y @modelcontextprotocol/server-everything"
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git diff --staged --quiet || git commit -m "docs: update MCP capabilities"
git push
📓 Note: For specific configuration options, see the official mcp-discovery-action documentation.
Use cases
1. Maintain MCP server project documentation
Automatically generate and maintain the capability descriptions in the README for an MCP server you develop:
# 每次发布新版本时运行
mcp-discovery update -f README.md -- node ./dist/server.js
2. Integrate with a developer portal or wiki
Generate HTML documentation and integrate it with an internal documentation system:
mcp-discovery create -f docs/capabilities.html -- npx @your-org/mcp-server
3. Debug agent development
Quickly inspect the tools and resources a server offers:
# 终端快速预览
mcp-discovery -- npx -y @modelcontextprotocol/server-filesystem
# 保存为文件便于分析
mcp-discovery create -f debug-capabilities.json -t txt -- npx -y @modelcontextprotocol/server-filesystem
4. Standardize documentation for multiple MCP servers
Generate documentation in a consistent format for the MCP servers your team uses so agent developers can consult it.
Technology stack
- Language: Rust
- MCP interaction: Based on rust-mcp-sdk
- Template engine: Handlebars
- Open-source license: MIT License
References
- MCP Discovery GitHub Repository. (n.d.). rust-mcp-stack. Retrieved January 26, 2026, from https://github.com/rust-mcp-stack/mcp-discovery
- MCP Discovery GitHub Action. (n.d.). rust-mcp-stack. Retrieved January 26, 2026, from https://github.com/rust-mcp-stack/mcp-discovery-action
- Model Context Protocol. (n.d.). Anthropic. Retrieved January 26, 2026, from https://modelcontextprotocol.io/