Skip to main content

Module config

Module config 

Source
Expand description

Server profiles: a config file of named servers, so a remote MCP server can be reached as mcp-repl <name> instead of a URL plus repeated --bearer/--header flags.

On Unix the file lives at $XDG_CONFIG_HOME/mcp-repl/config.toml, falling back to ~/.config/mcp-repl/config.toml. On Windows it lives below %APPDATA%\mcp-repl. --config <path> overrides either default:

[servers.cratesio]
transport = "http"
url = "https://cratesio-mcp.fly.dev/"
bearer_env = "CRATESIO_TOKEN"
headers = { "X-Api-Key" = "..." }

[oauth.work]
url = "https://mcp.example.com/mcp"
scopes = ["openid", "offline_access"]

[servers.work]
transport = "http"
oauth = "work"

[servers.local]
transport = "stdio"
command = ["cargo", "run", "--example", "getting_started"]

[aliases]
t = "tools"

Command aliases live in the same file: [aliases] for every server, and [servers.<name>.aliases] for one profile. The interactive alias and unalias commands write them back.

Tokens are read from the environment via bearer_env rather than stored in the file; an inline bearer literal works but warns.

Structs§

Config
The whole config file: named profiles under [servers.<name>], plus the command aliases every server sees under [aliases].
OAuthProfile
Non-secret OAuth metadata stored under [oauth.<name>].
Profile
One [servers.<name>] table.
Repl
The [repl] table: knobs that are not about a connection.

Enums§

Connection
A profile resolved into everything needed to connect. Produced after the CLI flags have had their say.
Transport
The transports a profile can name. ws and stateless HTTP are not profile-addressable yet, so an unknown value is a config error rather than a silent fallback.

Functions§

config_path
The config file location: --config if given, else the platform-native mcp-repl config directory. The bool is true when the path was explicitly requested, which makes a missing file an error.