Skip to main content

MCP server to interact with Infrahub

Project description

MCP Discovery Logo

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 with create and update commands 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.
  • -s, --template-string <TEMPLATE_STRING>: Inline Handlebars template provided as a string.
  • -h, --help: Display help information.
  • -V, --version: Display the version of mcp-discovery.

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

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

  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

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:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infrahub_mcp-1.1.1.tar.gz (483.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infrahub_mcp-1.1.1-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file infrahub_mcp-1.1.1.tar.gz.

File metadata

  • Download URL: infrahub_mcp-1.1.1.tar.gz
  • Upload date:
  • Size: 483.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for infrahub_mcp-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7e7352dc352f8ff3d6968eb2c71de6632799be9d266b9c34f524715c717434d5
MD5 1079ebcd4d03bf64cdee08ce64ab9aa5
BLAKE2b-256 d12765a2182d1b557c2026f571b219fb65b4ec8a89c79bc9867637bba97f5820

See more details on using hashes here.

File details

Details for the file infrahub_mcp-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: infrahub_mcp-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for infrahub_mcp-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ebc066611d762f02df297101dc3e1642f06219f27004d48a600fad7a1fb9a83
MD5 1d0a32b2815556fbcabd5912d47c36da
BLAKE2b-256 0015b8fe3bd5b6edc0c579836643bb622c22feaae786c36fa1de6186724e2899

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page