Expand description
Resolving MCP servers from the official MCP registry.
The built-in catalog (catalog.rs) is twelve entries compiled into the
binary. This module reaches the community registry at
https://registry.modelcontextprotocol.io, which holds thousands, and
turns one of its entries into the same CapabilityManifest the catalog
produces, so installation, drift, update and mcp doctor all work on a
registry server without knowing where it came from.
§Turning a registry entry into a launch command
A registry entry does not carry a command line. It describes a package (npm, PyPI, OCI, NuGet) plus the arguments and environment variables that package needs, and leaves assembling the invocation to the client. The rules used here, in order:
- Prefer a package whose transport is
stdio; that is what Tuff can launch and whattuff mcp doctorcan probe. - The command is the entry’s
runtimeHintwhen it sets one, otherwise it is derived fromregistryType:npmruns undernpx,pypiunderuvx,ociunderdocker,nugetunderdnx. - Arguments are
runtimeArguments, then the package reference itself, thenpackageArguments.npxalso gets-yso a first run does not stop on a prompt, anddockergetsrun -i --rmplus one-eper environment variable, because a container sees nothing otherwise. - Environment variables contribute their names only, as
{ from_env = "NAME" }references. A registry entry can carry a default value for a variable; Tuff never copies one into a manifest, because a manifest is committed and a value there would be a leaked secret waiting to happen.
§What is refused, and why refusing is the right answer
An entry that cannot be expressed exactly is refused with the reason rather than installed approximately: a wrong launch command wastes more of someone’s time than a clear “no”.
- Unresolved
{placeholders}. The registry lets an argument or URL carry variables for the client to fill in. Tuff has nowhere to ask, and guessing a value would produce a command that looks right and fails. - Literal header values. A manifest has no field a literal can
occupy, by design, so a header the registry documents as a constant
(
Accept: application/json) cannot be represented. - The superseded
ssetransport. A different handshake from Streamable HTTP; installing one as the other would write a config no harness could use. - Package kinds with no launcher, such as
mcpbbundles.
§Remote servers and their headers
A remote entry’s required headers become [server.headers] references
(RFC-106). Where the publisher documents the shape of the value, as
Bearer {api_key}, that becomes the header’s format and the
placeholder’s name becomes the variable. Where they document only the
header, the variable holds the entire value, prefix included: Tuff does
not guess a Bearer that nobody wrote down. Optional headers are left
out and named at install time, since requiring a variable the server
does not require would report a working server as broken.
Structs§
- Registry
Argument - Registry
Package - Registry
Remote - Registry
Server - One server as the registry describes it. Only the fields Tuff reads.
- Registry
Transport - Registry
Variable
Constants§
- DEFAULT_
REGISTRY - The official registry. Overridable so a team can point at their own.
Functions§
- default_
capability_ id - The capability id Tuff installs a registry server under.
- fetch
- Look one server up by its exact registry name, at its current version.
- search
- Search the registry for the current release of each matching server.
- skipped_
optional_ headers - Headers a registry entry declares but Tuff leaves out of the manifest, because the server does not require them. Named at install time so the omission is visible and can be added by hand.
- to_
manifest - Build an installable manifest from a registry entry.