GitHub - rust-mcp-stack/mcp-discovery: A command-line tool written in Rust for discovering and documenting MCP Server capabilities. (original) (raw)

MCP Discovery Logo

MCP Discovery

A command-line tool written in Rust for discovering and documenting MCP Server capabilities.

mcp-discovery launches an MCP Server using provided commands, queries its capabilities, tools, resources etc. It supports outputting the results in the terminal or saving them to files in Markdown, HTML, or plain text formats.

🌐 Check out the rust-mcp-filesystem capabilities page for sample output.

This project is open-source and leverages the rust-mcp-schema and rust-mcp-sdk crates for seamless interaction with MCP Servers.

Check the project documentation for instructions and command examples.

Features 💡

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

👉 Note: If no subcommand is provided, the print subcommand will be used by default.

Options ⚙️

👉 Note: If no template is provided, mcp-discovery will automatically select the most suitable built-in template based on the file extension.

Built-in Templates 🧬

The CLI supports the following built-in output templates:

Custom Templates 🧩

You can provide custom Handlebars templates in different ways:

  1. Use the --template-file flag to provide a custom template file.
  2. Use the --template-string flag to provide a raw Handlebars template directly as a string.
  3. To use an inline template, define it in a file for the update command only — this will not function with print or create.

Inline templates must be enclosed within designated marker annotations.

Examples

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

👉 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:

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

Server Capabilities will be placed here...

Sample Markdown file, annotated with render block and template name:

Server Info and Capabilities

Server Capabilities will be placed here...

Sample Markdown file, annotated with render block and custom template file:

Server Info and Capabilities

Server Capabilities will be placed here...

Sample HTML file with annotations :

My MCP Server

MCP Server Details

  <!-- mcp-discovery-render-end -->
</div>

Sample HTML file with inline template :

MCP Server Details

Below is a screenshot showing the resulting HTML after the mcp-discovery update command is executed:

MCP Discovery HTML Inline Template

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.