๐ชจ why use many token when few token do trick โ Claude Code skill that cuts 65% of tokens by talking like caveman
CLI for MCP server discovery and documentation
MCP Discovery connects to an MCP server, reads tools, resources, and capabilities, and renders the result in a few output formats. It can print to the terminal, create new files, or update existing files between marker comments, using built-in templates or your own Handlebars template.
Builders who want to turn MCP server capabilities into docs, changelog snippets, or README sections from a command line.
You can keep MCP server documentation current without manually copying capability lists into files.
What it does
Print server capabilities
The `print` command shows MCP server information in the terminal.
Create documentation files
The `create` command writes capabilities to `.md`, `.html`, or `.txt` files, with JSON also mentioned in the README.
Update existing docs
The `update` command inserts rendered output between `mcp-discovery-render` markers in an existing file.
Use built-in or custom templates
You can choose `md`, `md-plain`, `html`, or `txt`, or supply a Handlebars template file, string, or remote URL.
Connect to remote servers
The CLI supports `--url`, custom headers, and OAuth options for Streamable HTTP MCP servers.
GitHub Action support
The project includes a GitHub Action path for automating capability docs updates in repositories.
How to get it
- 1Inline templates must be enclosed within designated marker annotations.
mcp-discovery -- npx -y @modelcontextprotocol/server-everything
- 2Run
mcp-discovery create -f capabilities.html -- npx -y @modelcontextprotocol/server-everything
- 3Click here to view generated html file
mcp-discovery create -f capabilities.md -- npx -y @modelcontextprotocol/server-everything
- 4Run
mcp-discovery create -f capabilities.md --template-file=custom_template.hbs -- npx -y @modelcontextprotocol/server-everything
README
MCP Discovery
A command-line tool written in Rust for discovering and documenting MCP Server capabilities.
It supports outputting the results in the terminal or saving them to files in Markdown, HTML, plain text, JSON, or a custom template defined by you.
Check the project documentation for instructions and command examples.
Features ๐ก
- Display MCP Details: Output MCP Server information, including tools, resources, and capabilities, directly to the terminal.
- Generate Files: Create files in Markdown (
.md), HTML (.html), or plain text (.txt) formats with MCP Server details and capabilities. - Update Files: Modify existing Markdown, HTML, or text files by adding MCP Server capabilities within specified markers, enabling MCP Server developers to automatically maintain up-to-date documentation and repository README files.
- Flexible Output Customization: Choose from built-in templates (
md,md-plain,html,txt) or supply custom Handlebars templates for personalized output. - MCP Discovery GitHub Action: Integrate the mcp-discovery CLI as a GitHub Action to automate and maintain up-to-date MCP Server documentation in your development workflow.
This open-source project leverages the rust-mcp-sdk for seamless interaction with MCP Servers.
๐ Check out the rust-mcp-filesystem capabilities page for a sample output.
Installation โฌ๏ธ
Running as CLI
Check the project documentation for instructions on installing the tool on different platforms.
GitHub Action
The easiest way to automate and maintain up-to-date MCP Server documentation , is to use mcp-discovery as a GitHub action. Please see rust-mcp-stack/mcp-discovery-action for installation and configuration instructions.
Subcommands
print: Displays MCP Server capabilities in the terminal.create: Creates a new file with MCP Server capability details.update: Updates an existing file by inserting MCP Server capabilities between specified markers.
๐ Note: If no subcommand is provided, the print subcommand will be used by default.
Options โ๏ธ
-f, --filename <FILENAME>: Used withcreateandupdatecommands to specify the output file to generate or modify.-t, --template <TEMPLATE>: Choose a built-in output template. Options:md,md-plain,html,txt.-p, --template-file <TEMPLATE_FILE>: Path to a custom Handlebars template file, or a folder containingtemplate.hbswith an optional siblingpartials/directory.-s, --template-string <TEMPLATE_STRING>: Inline Handlebars template provided as a string.--template-url <URL>: Fetch and render a Handlebars template from anhttps://URL (.hbs,.zip, or.tar.gz). Supports fragment directives:#sha256=<hex>(integrity pin) and#entry=<subpath>(select a file inside an archive).--cache-dir <PATH>: Cache directory for templates fetched with--template-url(created if missing; defaults to the OS cache dir).-l, --log-level <LOG_LEVEL>: Specifies the logging level (default:info). Options:error,warn,info,debug,trace.--template-file/archive templates can use their own partials from apartials/folder โ see the Custom Templates guide.--url <URL>: Connect to a remote MCP server over the Streamable HTTP transport.--header "Name: Value": Static HTTP header for the Streamable HTTP transport (repeatable).--grant <GRANT>: OAuth grant for protected servers:client-credentials(default) orauthorization-code.--client-id <ID>: Pre-registered OAuth client id (omit to use Dynamic Client Registration).--client-secret <SECRET>: Pre-registered OAuth client secret.--scope <SCOPE>: OAuth scope(s) to request.--redirect-uri <URI>: Redirect URI for theauthorization-codegrant.-h, --help: Display help information.-V, --version: Display the version ofmcp-discovery.
๐ Note: If no template is provided, mcp-discovery will automatically select the most suitable built-in template based on the file extension.
๐ Note: Authentication flags require --url. See the Authentication guide for examples of connecting to open, token-protected, and OAuth-protected MCP servers.
Built-in Templates ๐งฌ
The CLI supports the following built-in output templates:
md: Formatted Markdown that presents MCP Server capabilities in a table format.md-plain: Minimalist Markdown for straightforward output, using plain text instead of tables.html: Structured HTML with basic styling.txt: Plain text for raw, unformatted output.
Custom Templates ๐งฉ
You can provide custom Handlebars templates in different ways:
- Use the
--template-fileflag to provide a custom template file, or a folder containingtemplate.hbswith an optional siblingpartials/directory. - Use the
--template-stringflag to provide a raw Handlebars template directly as a string. - Use the
--template-urlflag to fetch a Handlebars template (.hbs,.zip, or.tar.gz) from anhttps://URL. Supports fragment directives:#sha256=<hex>(integrity pin) and#entry=<subpath>(select a file inside an archive). See the Remote templates guide for details. - To use an inline template, define it in a file for the
updatecommand only โ this will not function with print or create.
Inline templates must be enclosed within designated marker annotations.
Examples
Print MCP Server capabilities to the terminal:
mcp-discovery -- npx -y @modelcontextprotocol/server-everything
Create a HTML file with MCP Server capabilities:
mcp-discovery create -f capabilities.html -- npx -y @modelcontextprotocol/server-everything
๐ Click here to view generated html file
Create a MD file with MCP Server capabilities:
mcp-discovery create -f capabilities.md -- npx -y @modelcontextprotocol/server-everything
Use a custom Handlebars template:
mcp-discovery create -f capabilities.md --template-file=custom_template.hbs -- npx -y @modelcontextprotocol/server-everything
๐ก See the Command Examples section in the project documentation for additional CLI usage examples.
Defining Update Regions with Markers
When using the update subcommand, mcp-discovery places capabilities between designated markers in the target file, which vary by file format and are typically comment lines.
The update command simplifies the process for developers and maintainers to keep documentation current effortlessly.
Run the mcp-discovery update command anytime to refresh the file with the latest MCP Server capabilities.
Marker Annotations
- Render Block Start :
mcp-discovery-render - Render Block End :
mcp-discovery-render-end
๐ The mcp-discovery-render marker supports template and template-file properties as well. Check the examples below for details.
You can optionally include an inline template identifier within the render block, enclosed by:
- Template Block Start:
mcp-discovery-template - Template Block End:
mcp-discovery-template-end
If a template annotation is detected within a render block, mcp-discovery will use it to render the output. This allows for customized templates without depending on built-in or external template files. Check the examples below for details:
Sample Markdown file annotated with render block:
# Server Info and Capabilities
<!-- mcp-discovery-render -->
Server Capabilities will be placed here...
<!-- mcp-discovery-render-end -->
Sample Markdown file, annotated with render block and template name:
# Server Info and Capabilities
<!-- mcp-discovery-render template=md-plain -->
Server Capabilities will be placed here...
<!-- mcp-discovery-render-end -->
Sample Markdown file, annotated with render block and custom template file:
# Server Info and Capabilities
<!-- mcp-discovery-render template=my-custom-template.hbs -->
Server Capabilities will be placed here...
<!-- mcp-discovery-render-end -->
Sample HTML file with annotations :
<!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>
Sample HTML file with inline template :
<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>
Below is a screenshot showing the resulting HTML after the mcp-discovery update command is executed:
You can execute the mcp-discovery update command whenever you need to refresh the file with the latest MCP Server capabilities.
Contributing
We welcome everyone who wishes to contribute! Please refer to the contributing guidelines for more details.
All contributions, including issues and pull requests, must follow Rust's Code of Conduct.
Unless explicitly stated otherwise, any contribution you submit for inclusion in mcp-discovery is provided under the terms of the MIT License, without any additional conditions or restrictions.
License
This project is licensed under the MIT License. see the LICENSE file for details.
Files in the repo
- .cargo
- .github
- docs
- src
- templates
- tests
- wix
- .gitignore
- .release-config.json
- .release-manifest.json
- Cargo.lock
- Cargo.toml
- CHANGELOG.md
- CONTRIBUTING.md
- dist-workspace.toml
- LICENSE
- Makefile.toml
- README.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.