module

Smith::MCP::ServerConfig

Discovery and parsing of mcp.json.

Deliberately its own file rather than a section in config.toml: the format below is the one every other MCP client reads, and keeping it verbatim is what lets an existing configuration be copied across unchanged.

{"mcpServers": {"fs": {"command": "npx", "args": [...], "env": {...}}}}

Constants

FILE_NAME = "mcp.json"

Class methods

discover(start_dir : String = Dir.current, warn_io : IO = STDERR) : Array(ServerSpec)

Global first, then project — a project entry of the same name replaces the global one outright, the way every other config tier behaves.

Source
global_path
Source
parse(text : String, source : String = "mcp.json", warn_io : IO = STDERR) : Array(ServerSpec)

A malformed file yields a warning and no servers. Never an exception: a typo in mcp.json must not stop smith from starting.

Source
parse_file(path : String, warn_io : IO = STDERR) : Array(ServerSpec)
Source
project_path(start_dir : String = Dir.current) : String | Nil

Walks up from start_dir looking for .smith/mcp.json, stopping at the git root — the same boundary Config.project_path uses, so running smith from a subdirectory still finds the project's servers.

Source