diff --git a/config.example.toml b/config.example.toml index 2c5aaeb59..aac21d906 100644 --- a/config.example.toml +++ b/config.example.toml @@ -1,6 +1,8 @@ # MCP Gateway Configuration Example # This file demonstrates all available configuration options for the MCP Gateway. # Copy this file to config.toml and customize for your needs. +# TOML files are parsed as TOML 1.1 via BurntSushi/toml v1.6.0+, so external +# validators/editors should also support TOML 1.1 syntax. # ============================================================================ # Gateway Configuration (Optional) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index b20735308..9d8635763 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -17,6 +17,8 @@ Repository examples you can copy and adapt: ### TOML Format (`config.toml`) +TOML files are parsed as **TOML 1.1** using `github.com/BurntSushi/toml` v1.6.0+. If you validate or edit `config.toml` outside the gateway, use a TOML 1.1-compatible tool. This also means TOML 1.1 features such as multi-line inline tables are accepted. + TOML configuration requires `command = "docker"` for stdio-based MCP servers to ensure containerization: ```toml diff --git a/internal/config/config_core_test.go b/internal/config/config_core_test.go index c744b0355..5ec8a28d5 100644 --- a/internal/config/config_core_test.go +++ b/internal/config/config_core_test.go @@ -71,6 +71,11 @@ func TestFormatConfigError(t *testing.T) { _, err := LoadFromFile(path) require.Error(t, err, "expected error from invalid TOML") + var perr toml.ParseError + require.ErrorAs(t, err, &perr, "expected wrapped toml.ParseError") + assert.Greater(t, perr.Position.Line, 0, "parse error should include line number") + assert.Greater(t, perr.Position.Col, 0, "parse error should include column number") + msg := FormatConfigError(err) // ErrorWithUsage output contains the file source snippet (|) and a