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.
mcp-discovery -- npx -y @modelcontextprotocol/server-everythingmcp-discovery --template-file sample_txt_template.txt -- npx -y @modelcontextprotocol/server-everything📎 view the output | 📎 sample_txt_template.txt
mcp-discovery --template-string "Server Name: {{name}}, Server Version: {{version}}" -- npx -y @modelcontextprotocol/server-everythingOutput:
Server Name: example-servers/everything, Server Version: 1.0.0
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- Print MCP Server tools to the Terminal in pretty-formatted JSON :
mcp-discovery --template-string "{{{json this.tools}}}" -- npx -y @modelcontextprotocol/server-everythingmcp-discovery create -f create-md.md -- npx -y @modelcontextprotocol/server-everythingmd-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-everythingmcp-discovery create -f server-info.html -- npx -y @modelcontextprotocol/server-everythingmcp-discovery create -f capabilities.txt -- npx -y @modelcontextprotocol/server-everythingTo 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.
mcp-discovery update -f update-md.md -- npx -y @modelcontextprotocol/server-everythingBelow 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 -->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-everythingBelow 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 -->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-everythingBelow 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