From fb64e7da3cd437354c26c374a54739773617f400 Mon Sep 17 00:00:00 2001 From: Kalle Bylin Date: Fri, 5 Sep 2025 22:36:06 +0200 Subject: [PATCH] Add embedded CLI example (#352) Add example for MCP servers embedded inside a CLI tool and update example validator count. ## Motivation and Context Document how to model CLI-embedded MCP servers using existing packages/arguments, per discussion [#274](https://github.com/modelcontextprotocol/registry/discussions/274). No schema changes. ## How Has This Been Tested? - Ran validators: schemas valid; 11/11 examples pass. - Scripts: ./tools/validate-schemas.sh, ./tools/validate-examples.sh ## Breaking Changes None. ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [x] I have added or updated documentation as needed ## Additional context Startup reference: [Agentic integrations - Snyk MCP Server](https://docs.snyk.io/integrations/developer-guardrails-for-agentic-workflows) --------- Co-authored-by: Adam Jones Co-authored-by: adam jones --- docs/server-json/examples.md | 37 +++++++++++++++++++++++++++++++++ tools/validate-examples/main.go | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/server-json/examples.md b/docs/server-json/examples.md index e38d092..4ae7b52 100644 --- a/docs/server-json/examples.md +++ b/docs/server-json/examples.md @@ -621,6 +621,43 @@ This example shows an MCPB (MCP Bundle) package that: - Includes a SHA-256 hash for integrity verification - Can be downloaded and executed directly by MCP clients that support MCPB +## Embedded MCP inside a CLI tool + +Some CLI tools bundle an MCP server, without a standalone MCP package or a public repository. In these cases, reuse the existing `packages` shape by pointing at the host CLI package and supplying the `package_arguments` and `runtime_hint` if needed to start the MCP server. + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.snyk/cli-mcp", + "description": "MCP server provided by the Snyk CLI", + "status": "active", + "version_detail": { + "version": "1.1298.0" + }, + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "snyk", + "version": "1.1298.0", + "transport": { + "type": "stdio" + }, + "package_arguments": [ + { "type": "positional", "value": "mcp" }, + { + "type": "named", + "name": "-t", + "description": "Transport type for MCP server", + "default": "stdio", + "choices": ["stdio", "sse"] + } + ] + } + ] +} +``` + ## Deprecated Server Example ```json diff --git a/tools/validate-examples/main.go b/tools/validate-examples/main.go index a4edd21..23f140c 100644 --- a/tools/validate-examples/main.go +++ b/tools/validate-examples/main.go @@ -24,7 +24,7 @@ const ( // IMPORTANT: Only change this count if you have intentionally added or removed examples // from the examples.md file. This check prevents accidental formatting changes from // causing examples to be skipped during validation. - expectedExampleCount = 11 + expectedExampleCount = 12 ) func main() {