moonbitlang/openseek/mcp/config does not have a README file

    ConfigError

    pub suberror ConfigError {
    Invalid(String)
    }

    A malformed MCP configuration.

    AuthorizationCodeConfig

    pub struct AuthorizationCodeConfig {
    issuer : String
    scopes : String
    } derive(Eq,
    Debug
    )

    Pinned issuer and scopes for a public client registered through discovery.

    DeviceOAuthConfig

    pub(all) struct DeviceOAuthConfig {
    client_id : String
    device_authorization_endpoint : String
    token_endpoint : String
    scopes : String
    } derive(Eq,
    Debug
    )

    Public client and explicit endpoints for the Device Authorization Grant.

    HeadersHelperCommand

    pub(all) struct HeadersHelperCommand {
    command : String
    arguments : Array[String]
    } derive(Eq,
    Debug
    )

    A headers helper executable and arguments after configuration variable expansion.

    McpServer

    pub(all) enum McpServer {
    Stdio(name~ : String, command~ : String, args~ : Array[String], env~ : Map[String, String])
    Http(name~ : String, url~ : String, headers~ : Map[String, String], headers_helper~ : HeadersHelperCommand?, oauth~ : OAuthConfig?)
    } derive(Eq,
    Debug
    )

    A configured MCP server: launched as a subprocess (stdio) or reached at a Streamable HTTP endpoint.

    McpServer::name

    fn McpServer::name(self : McpServer) -> String

    The configured server's name (the key under mcpServers).

    McpServer::target

    fn McpServer::target(self : McpServer) -> String

    What identifies the server to a person without echoing a secret: its command (stdio), or its URL without userinfo and query (http). Arguments, environment, and headers are left out because that is where tokens live.

    OAuthConfig

    pub(all) enum OAuthConfig {
    DeviceCode(DeviceOAuthConfig)
    AuthorizationCode(AuthorizationCodeConfig)
    } derive(Eq,
    Debug
    )

    Public client configuration for device authorization or browser authorization.

    decode

    fn decode(json :
    Json
    , env? : Map[String, String]) -> Array[McpServer] raise

    Decode the parsed configuration into the list of configured servers. Raises ConfigError when the shape is wrong. An empty mcpServers is allowed — the caller decides whether zero servers is expected. A stdio server's command, arguments, and environment values, and an HTTP server's URL and header values, may reference ${VAR} in the supplied environment. Values are expanded once; missing variables are errors.

    merge

    fn merge(configs : Array[Array[McpServer]]) -> Array[McpServer]

    Merge decoded configurations in order. A later entry replaces the whole server with the same name, retaining its original position in the list. Merge before connecting so overridden servers are never started.