Skip to content

Import server from MCP Registry / server card (server.json) #1435

@cliffhall

Description

@cliffhall

Background

#1348 covers importing server configs from other MCP clients (Claude Desktop, Cursor, Cline) — local { mcpServers: { ... } } files. This issue is the complementary path: importing a server from the official MCP Registry via its server card (server.json) schema.

The InspectorView prop onServerImportJson is currently todoNoop in App.tsx, and the draft state InspectorServerJsonDraft already exists in core/mcp/types.ts (with parsed?: unknown pending the registry schema type). This issue fills in that wiring — paste/look up a registry server card, pick a package, fill required env, and merge it into ~/.mcp-inspector/mcp.json.

Known canonical source

  • MCP Registry API: https://registry.modelcontextprotocol.io (server list + per-server server.json).
  • Server card schema (server.json): describes a server's name, description, packages[] (npm/pypi/oci, with runtimeHint, runtimeArguments, packageArguments, environmentVariables) and/or remotes[] (sse/streamable-http URLs).
  • A registry card may declare multiple packages/transports — the user picks which one to install.

Import semantics

  • Translate a selected registry package (or remote) into a StoredMCPServer (command/args/env for stdio packages; url/transport for remotes).
  • Surface required environmentVariables (and any isSecret/isRequired flags) as fields the user fills before save.
  • Allow a nameOverride and per-var envOverrides (already on InspectorServerJsonDraft).
  • Conflicting id/name: prompt the user — overwrite / skip / rename (same resolution UX as Import server configs from other MCP clients (Claude Desktop, Cursor, Cline) #1348).
  • Each merged entry goes through the existing POST /api/servers so the file ends up with the unioned set.

Sketch

  • Backend: optional GET /api/registry?... (search) and GET /api/registry/:name (fetch one card) proxy so the browser avoids CORS and we can cache. Paste-JSON path needs no backend.
  • Frontend (ImportServerJsonPanel wiring):
    • Paste-server.json textarea → parse into InspectorServerJsonDraft.parsed.
    • (Optional) registry search/browse to fetch a card by name.
    • Package selector (selectedPackageIndex) when a card declares more than one.
    • Env/argument form derived from the selected package, writing envOverrides + nameOverride.
    • Conflict-resolution dialog, then addServer per merged entry.
  • Add the registry server card type to replace parsed?: unknown in InspectorServerJsonDraft.

Out of scope

  • Auto-update / re-sync when the registry card changes.
  • Publishing to the registry (read-only import only).
  • Registry auth / private registries (public registry first).

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions