Skip to main content

fastmcp.cli.discovery

Discover MCP servers configured in editor config files. Scans filesystem-readable config files from editors like Claude Desktop, Claude Code, Cursor, Gemini CLI, and Goose, as well as project-level mcp.json files. Each discovered server can be resolved by name (or source:name) so the CLI can connect without requiring a URL or file path.

Functions

discover_servers

Run all scanners and return the combined results. Duplicate names across sources are preserved — callers can use :pyattr:DiscoveredServer.qualified_name to disambiguate.

resolve_name

Resolve a server name (or source:name) to a transport. Raises :class:ValueError when the name is not found or is ambiguous.

Classes

DiscoveredServer

A single MCP server found in an editor or project config. Methods:

qualified_name

Fully qualified source:name identifier.

transport_summary

Human-readable one-liner describing the transport.