mcp-config-check

Crystal command line tool and library. Give it an MCP client config file (a JSON object with an mcpServers object) and it checks each server. A server needs exactly one of command (a non-empty string, transport stdio) or url (transport http). Errors: neither or both of command and url, command not a non-empty string, args not an array of strings, env not an object of strings, a url that is not a string, has no host, or uses a scheme other than https:// (http:// is accepted only for localhost and 127.0.0.1). Warnings: an http:// url on any other host, an env value that is empty or blank, and an empty mcpServers object. The output names servers and environment variable NAMES only: it never prints an env value, an argument or a url. Exit code 1 when any server has an error, otherwise 0. Not checked: whether the command exists or the url answers, because the tool makes no network calls and starts no process.

Part of the OneGTMLab free GTM tools. Background on the idea: Model Context Protocol.

Install

shards build   # then ./bin/mcp-config-check

Use

Input: a JSON file with an mcpServers object. The sample uses made-up values only. Output: one row per server with transport and status (ok, warning or error), the messages under it, then the totals. A file that is not valid JSON, has no mcpServers object, or cannot be read stops the run with an error message and exit 1.

$ bin/mcp-config-check sample.json
server        transport  status
files-a       stdio      ok
remote-a      http       ok
local-dev     http       ok
remote-plain  http       warning
  warning: http:// url on a non-localhost host (traffic is not encrypted)
empty-env     stdio      warning
  warning: env EXAMPLE_VAR is empty

servers: 5
ok: 3
warning: 2
error: 0

Test

crystal spec

Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.