Server Discovery
Relevant source files
The following files were used as context for generating this wiki page:
The Server Discovery module is a core component of the mcpmcp-server project, designed to facilitate the identification, setup, and integration of Model Context Protocol (MCP) servers. Its primary purpose is to act as a bridge between AI clients—such as Claude Desktop—and various MCP-compatible tools, allowing users to expand the capabilities of their AI workflows through a centralized discovery mechanism.
The discovery system allows clients to connect to a remote gateway that provides access to multiple MCP servers. By utilizing a standardized configuration, the system enables dynamic loading and management of server resources without requiring manual installation for every individual tool.
Sources: README.md:1-5
Architecture and Integration
The architecture of the discovery system relies on a proxy-like relationship where the local MCP client (e.g., Claude Desktop) communicates with the mcpmcp-server via a command-line interface (CLI). The mcpmcp-server then interfaces with the remote discovery endpoint to fetch and manage available server instances.
Discovery Workflow
The following diagram illustrates the flow of a discovery request from the local client to the remote server registry:
The diagram shows how the mcpmcp-server acts as an intermediary, using the mcp-remote package to bridge local requests to a remote service.
Sources: README.md:9-18, package.json
Configuration and Setup
Server discovery is initiated by configuring the MCP client to use the mcpmcp server definition. This is typically handled via a JSON configuration file that specifies how the client should spawn the discovery process.
Configuration Parameters
The discovery system requires specific arguments to point the local client to the correct remote registry.
| Parameter | Type | Description |
|---|---|---|
command | string | The command used to execute the server, typically npx. |
args | array | Arguments including the package mcp-remote@latest and the discovery URL. |
remote_url | string | The endpoint for discovery, defaults to https://mcpmcp.io/mcp. |
Sources: README.md:10-18
Client Integration Example
The following snippet demonstrates the standard configuration for integrating the discovery server into a macOS-based MCP client:
{
"mcpServers": {
"mcpmcp": {
"command": "npx",
"args": ["-y", "mcp-remote@latest", "https://mcpmcp.io/mcp"]
}
}
}
Sources: README.md:11-17
Data Interaction
During the discovery process, the system exchanges specific data structures to negotiate capabilities between the client and the discovered servers.
Sequence of Connection
The following sequence diagram detail how the discovery server initializes a session:
This sequence ensures that the local client sees a unified interface regardless of how many remote servers are discovered.
Sources: README.md:3-5, src/index.ts
Key Components
The discovery system is supported by the following software components:
- CLI Wrapper: Uses
npxto ensure the latest version of the discovery agent (mcp-remote) is always used. - Discovery Endpoint: The URL
https://mcpmcp.io/mcpserves as the primary registry for locating available servers. - Client-Side Config: The
mcpServersblock in the client's configuration file that registers the discovery server as a provider.
Sources: README.md:7-18, package.json
Summary
The Server Discovery feature provides a streamlined path for users to integrate a wide array of AI tools into their workflow. By abstracting the complexities of remote server connections into a single npx command and a standard configuration block, mcpmcp-server enables scalable and dynamic tool discovery for the Model Context Protocol ecosystem.