Skip to content

Commit 611cbb3

Browse files
committed
feat: add cargo (crates.io) as a package registry type
modelcontextprotocol#1055 noted that crates.io has ~1,800 MCP-related packages with no direct path into the registry, only the MCPB binary-packaging workaround. This commit adds the schema-side wiring for `registryType: cargo`: - `pkg/model/constants.go`: `RegistryTypeCargo` + `RegistryURLCrates` - `server.json` schema and `openapi.yaml`: `cargo` in the example enum for `registryType`; `https://crates.io` in `registryBaseUrl` - `generic-server-json.md`: new minimal Cargo example, with a runtime-model note. `cargo install` puts the binary on PATH at `~/.cargo/bin` and the MCP client invokes it by name. `npx` (npm), `uvx` (PyPI), and `dnx` (NuGet, .NET 10 SDK) were the cross-ecosystem precedents considered; cargo has no single-shot analog, so `runtimeHint` is omitted. Validator and `publish-cargo.md` follow on this branch once the schema-side direction is settled. Refs modelcontextprotocol#1055
1 parent 7722031 commit 611cbb3

4 files changed

Lines changed: 37 additions & 2 deletions

File tree

‎docs/reference/api/openapi.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,11 @@ components:
659659
properties:
660660
registryType:
661661
type: string
662-
description: Registry type indicating how to download packages (e.g., 'npm', 'pypi', 'oci', 'nuget', 'mcpb')
662+
description: Registry type indicating how to download packages (e.g., 'npm', 'pypi', 'cargo', 'oci', 'nuget', 'mcpb')
663663
examples:
664664
- "npm"
665665
- "pypi"
666+
- "cargo"
666667
- "oci"
667668
- "nuget"
668669
- "mcpb"
@@ -673,6 +674,7 @@ components:
673674
examples:
674675
- "https://registry.npmjs.org"
675676
- "https://pypi.org"
677+
- "https://crates.io"
676678
- "https://docker.io"
677679
- "https://api.nuget.org/v3/index.json"
678680
- "https://github.com"

‎docs/reference/server-json/draft/server.schema.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"examples": [
240240
"https://registry.npmjs.org",
241241
"https://pypi.org",
242+
"https://crates.io",
242243
"https://docker.io",
243244
"https://api.nuget.org/v3/index.json",
244245
"https://github.com",
@@ -248,10 +249,11 @@
248249
"type": "string"
249250
},
250251
"registryType": {
251-
"description": "Registry type indicating how to download packages (e.g., 'npm', 'pypi', 'oci', 'nuget', 'mcpb')",
252+
"description": "Registry type indicating how to download packages (e.g., 'npm', 'pypi', 'cargo', 'oci', 'nuget', 'mcpb')",
252253
"examples": [
253254
"npm",
254255
"pypi",
256+
"cargo",
255257
"oci",
256258
"nuget",
257259
"mcpb"

‎docs/reference/server-json/generic-server-json.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,35 @@ The same `registryType` / `identifier` pattern works for other supported OCI hos
372372
}
373373
```
374374

375+
### Cargo (Rust) Package Example
376+
377+
`cargo install <crate>` places the binary on PATH (via `~/.cargo/bin`); MCP clients invoke it directly by name. There is no single-shot equivalent of `npx` (npm), `uvx` (PyPI), or `dnx` (NuGet, .NET 10 SDK) for cargo — install once, run by name.
378+
379+
```json
380+
{
381+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
382+
"name": "io.github.example/widget-mcp",
383+
"description": "Rust-native MCP server",
384+
"title": "Widget",
385+
"repository": {
386+
"url": "https://github.com/example/widget-mcp",
387+
"source": "github"
388+
},
389+
"version": "0.3.0",
390+
"packages": [
391+
{
392+
"registryType": "cargo",
393+
"registryBaseUrl": "https://crates.io",
394+
"identifier": "widget-mcp",
395+
"version": "0.3.0",
396+
"transport": {
397+
"type": "stdio"
398+
}
399+
}
400+
]
401+
}
402+
```
403+
375404
### NuGet (.NET) Package Example
376405

377406
The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.

‎pkg/model/constants.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ const (
77
RegistryTypeOCI = "oci"
88
RegistryTypeNuGet = "nuget"
99
RegistryTypeMCPB = "mcpb"
10+
RegistryTypeCargo = "cargo"
1011
)
1112

1213
// Registry Base URLs - supported package registry base URLs
1314
const (
15+
RegistryURLCrates = "https://crates.io"
1416
RegistryURLGitHub = "https://github.com"
1517
RegistryURLGitLab = "https://gitlab.com"
1618
RegistryURLNPM = "https://registry.npmjs.org"

0 commit comments

Comments
 (0)