ExMCP.Discovery (ex_mcp v0.1.0)

View Source

MCP server discovery functionality.

Provides mechanisms to discover available MCP servers through:

  • Environment variables
  • Configuration files
  • Well-known locations
  • Service registration

Summary

Functions

Discovers servers from configuration files.

Discovers servers from environment variables.

Discovers servers from well-known locations.

Discovers available MCP servers from various sources.

Registers a server for discovery.

Functions

discover_from_config(servers \\ [])

@spec discover_from_config(list()) :: [map()]

Discovers servers from configuration files.

Looks for mcp.json or .mcp/config.json in:

  • Current directory
  • Home directory
  • XDG config directory

discover_from_env(servers \\ [])

@spec discover_from_env(list()) :: [map()]

Discovers servers from environment variables.

Looks for MCP_SERVERS environment variable containing a JSON array of server configurations.

discover_from_well_known(servers \\ [])

@spec discover_from_well_known(list()) :: [map()]

Discovers servers from well-known locations.

Checks standard locations where MCP servers might be installed:

  • System paths
  • User local directories
  • Application bundles

discover_servers()

@spec discover_servers() :: [map()]

Discovers available MCP servers from various sources.

Returns a list of server configurations that can be used to establish connections.

register_server(server_config)

@spec register_server(map()) :: :ok

Registers a server for discovery.

This allows programmatic registration of servers that may not be discoverable through other means.