Skip to content

Commit fb64e7d

Browse files
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](#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 <adamj@anthropic.com> Co-authored-by: adam jones <adamj+git@anthropic.com>
1 parent 0ffcd36 commit fb64e7d

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

docs/server-json/examples.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,43 @@ This example shows an MCPB (MCP Bundle) package that:
621621
- Includes a SHA-256 hash for integrity verification
622622
- Can be downloaded and executed directly by MCP clients that support MCPB
623623

624+
## Embedded MCP inside a CLI tool
625+
626+
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.
627+
628+
```json
629+
{
630+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
631+
"name": "io.snyk/cli-mcp",
632+
"description": "MCP server provided by the Snyk CLI",
633+
"status": "active",
634+
"version_detail": {
635+
"version": "1.1298.0"
636+
},
637+
"packages": [
638+
{
639+
"registry_type": "npm",
640+
"registry_base_url": "https://registry.npmjs.org",
641+
"identifier": "snyk",
642+
"version": "1.1298.0",
643+
"transport": {
644+
"type": "stdio"
645+
},
646+
"package_arguments": [
647+
{ "type": "positional", "value": "mcp" },
648+
{
649+
"type": "named",
650+
"name": "-t",
651+
"description": "Transport type for MCP server",
652+
"default": "stdio",
653+
"choices": ["stdio", "sse"]
654+
}
655+
]
656+
}
657+
]
658+
}
659+
```
660+
624661
## Deprecated Server Example
625662

626663
```json

tools/validate-examples/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
// IMPORTANT: Only change this count if you have intentionally added or removed examples
2525
// from the examples.md file. This check prevents accidental formatting changes from
2626
// causing examples to be skipped during validation.
27-
expectedExampleCount = 11
27+
expectedExampleCount = 12
2828
)
2929

3030
func main() {

0 commit comments

Comments
 (0)