Skip to content

Latest commit

 

History

History
181 lines (114 loc) · 5.83 KB

File metadata and controls

181 lines (114 loc) · 5.83 KB

Command Examples

Below is a list of sample commands showcasing various options available in the mcp-discovery CLI.

These examples use the @modelcontextprotocol/server-everything example server for demonstration.

Print

▪️ Print MCP Server capabilities to the terminal:

mcp-discovery -- npx -y @modelcontextprotocol/server-everything

📎 view the output


▪️ Print MCP Server capabilities to the terminal, with a custom template:

mcp-discovery --template-file sample_txt_template.txt -- npx -y @modelcontextprotocol/server-everything

📎 view the output | 📎 sample_txt_template.txt


▪️ Print MCP Server capabilities to the terminal, with a template string:

mcp-discovery --template-string "Server Name: {{name}}, Server Version: {{version}}" -- npx -y @modelcontextprotocol/server-everything

Output:

Server Name: example-servers/everything, Server Version: 1.0.0

▪️ Print MCP Server capabilities to the terminal as JSON:

We use the json helper function in a template string. It accepts an object and optional second parameter with value of 'pretty' for a formatted output:

  • Print the Full MCP Server Capabilities to the Terminal in JSON Format:
mcp-discovery --template-string "{{{json this}}}" -- npx -y @modelcontextprotocol/server-everything

📎 printed json

  • Print MCP Server tools to the Terminal in pretty-formatted JSON :
mcp-discovery --template-string "{{{json this.tools}}}" -- npx -y @modelcontextprotocol/server-everything

Create

Create a Markdown file (*.md) describing MCP Server capabilities:

mcp-discovery create -f create-md.md -- npx -y @modelcontextprotocol/server-everything

📎 view generated file


Create a Markdown file (*.md) using md-plain template:

md-plain generates plain markdown using text lists rather than tables.

mcp-discovery create -f create-md-plain.md --template md-plain -- npx -y @modelcontextprotocol/server-everything

📎 view generated file


Create a HTML file (*.html) describing MCP Server capabilities:

mcp-discovery create -f server-info.html -- npx -y @modelcontextprotocol/server-everything

📎 view generated file

Create a TEXT file (*.txt) describing MCP Server capabilities:

mcp-discovery create -f capabilities.txt -- npx -y @modelcontextprotocol/server-everything

📎 view generated file

Update

To update files, you need to annotate a render block within the target file where the MCP server capabilities should be inserted. Refer to the "Update Regions with Markers" page for details on how to define render blocks and optional inline template sections.

Update a Markdown file with MCP Server capabilities:

mcp-discovery update -f update-md.md -- npx -y @modelcontextprotocol/server-everything

Below is a typical md file containing a render block marked with <!-- mcp-discovery-render --> and <!-- mcp-discovery-render-end -->. MCP Discovery will overwrite the content between these markers with the latest generated output.

# Server Info and Capabilities

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

📎 view updated file


Update a Markdown file using md-plain template:

We can either pass the --template md-plain argument to the CLI or specify md-plain as a property on the line.

mcp-discovery update -f update-md-plain.md -- npx -y @modelcontextprotocol/server-everything

Below is a md file containing a render block with template property set to md-plain:

# Server Info and Capabilities

<!-- mcp-discovery-render template=md-plain -->
<!-- mcp-discovery-render-end -->

📎 view updated file


Update a Markdown file with an inline template:

Inline templates should appear between a render block. Refer to the "Update Regions with Markers" page for details on how to define render blocks and optional inline template sections.

mcp-discovery update -f update-md-inline.md -- npx -y @modelcontextprotocol/server-everything

Below is an md file with a render block and an inline template. The inline template will be used and preserved when the mcp-discovery CLI updates the file.

# Server Info and Capabilities

<!-- 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 -->

---

A Footer

📎 view updated file