Parse, format, and convert configs across TOML, YAML, and JSON via @mukundakatta/toml-yaml-json-mcp (npx) — 3 tools, round-trip safe
Config file format conversion is a common agent task — reading a pyproject.toml and emitting JSON, converting a Kubernetes YAML to TOML for a different tool, or generating a TOML config from structured data an LLM produced as JSON. LLMs tend to mangle TOML syntax (bare keys, inline tables, array-of-tables) when generating it as raw text. This server handles the serialization correctly.
@mukundakatta/toml-yaml-json-mcp — three-format config converter
Install: npm install @mukundakatta/toml-yaml-json-mcp Launch: node node_modules/@mukundakatta/toml-yaml-json-mcp/src/index.js (stdio) Tools: 3 — parse, format, convert
Tool schemas
- parse
{text: string, format: "toml"|"yaml"|"json"}→{value: any}— parse config text into JSON-serializable value - format
{value: any, format: "toml"|"yaml"|"json"}→{text: string}— serialize a value into config text - convert
{text: string, from: "toml"|"yaml"|"json", to: "toml"|"yaml"|"json"}→{text: string}— direct format conversion
Traces
1. TOML → YAML (Cargo.toml-style config)
// request
{"name": "convert", "arguments": {"text": "[package]\nname = \"my-app\"\nversion = \"1.2.3\"\n\n[dependencies]\nserde = { version = \"1.0\", features = [\"derive\"] }\ntokio = { version = \"1\", features = [\"full\"] }\n\n[profile.release]\nopt-level = 3\nlto = true", "from": "toml", "to": "yaml"}}
// response (3ms)
{"text": "package:\n name: my-app\n version: 1.2.3\ndependencies:\n serde:\n version: '1.0'\n features:\n - derive\n tokio:\n version: '1'\n features:\n - full\nprofile:\n release:\n opt-level: 3\n lto: true\n"}TOML inline tables { version = "1.0", features = ["derive"] } correctly expanded to YAML nested structure.
2. YAML → TOML (server config)
// request
{"name": "convert", "arguments": {"text": "server:\n host: 0.0.0.0\n port: 8080\n ssl:\n enabled: true\n cert: /etc/ssl/cert.pem\n key: /etc/ssl/key.pem\ndatabase:\n url: postgres://user:pass@db:5432/app\n pool_size: 20\n timeout_ms: 5000\nlogging:\n level: info\n format: json\n outputs:\n - stdout\n - file:///var/log/app.log", "from": "yaml", "to": "toml"}}
// response (2ms)
{"text": "[server]\nhost = \"0.0.0.0\"\nport = 8_080\n\n [server.ssl]\n enabled = true\n cert = \"/etc/ssl/cert.pem\"\n key = \"/etc/ssl/key.pem\"\n\n[database]\nurl = \"postgres://user:pass@db:5432/app\"\npool_size = 20\ntimeout_ms = 5_000\n\n[logging]\nlevel = \"info\"\nformat = \"json\"\noutputs = [ \"stdout\", \"file:///var/log/app.log\" ]\n"}Numbers with underscores (TOML's 8_080) for readability. YAML arrays → TOML inline arrays.
3. Parse TOML (pyproject.toml pytest section)
// request
{"name": "parse", "arguments": {"text": "[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = [\"-ra\", \"--strict-markers\"]\ntestpaths = [\"tests\"]\nmarkers = [\"slow: marks tests as slow\", \"integration: integration tests\"]", "format": "toml"}}
// response (2ms)
{"value": {"tool": {"pytest": {"ini_options": {"minversion": "6.0", "addopts": ["-ra", "--strict-markers"], "testpaths": ["tests"], "markers": ["slow: marks tests as slow", "integration: integration tests"]}}}}}Difference from yaml-mcp and toml-mcp
This package handles all three formats in one server — TOML↔YAML↔JSON with direct conversion (not via intermediate). The standalone yaml-mcp only does YAML↔JSON and toml-mcp only does TOML↔JSON. This package covers the missing TOML↔YAML leg directly.
{ "server": "@mukundakatta/toml-yaml-json-mcp", "version": "0.1.0", "transport": "stdio", "launch": "node node_modules/@mukundakatta/toml-yaml-json-mcp/src/index.js", "tools_count": 3, "tools": ["parse", "format", "convert"], "trace_1": { "tool": "convert", "input": { "text": "[package] name = "my-app" version = "1.2.3" [dependencies] serde = { version = "1.0", features = ["derive"] } tokio = { version = "1", features = ["full"] } [profile.release] opt-level = 3 lto = true", "from": "toml", "to": "yaml" }, "output_preview": "package: name: my-app version: 1.2.3 dependencies: ...", "latency_ms": 3 }, "trace_2": { "tool": "convert", "input": { "text": "server: host: 0.0.0.0 port: 8080 ...", "from": "yaml", "to": "toml" }, "output_preview": "[server] host = "0.0.0.0" port = 8_080 ...", "latency_ms": 2 }, "trace_3": { "tool": "parse", "input": { "text": "[tool.pytest.ini_options] minversion = "6.0" addopts = ["-ra", "--strict-markers"] testpaths = ["tests"]", "format": "toml" }, "output": { "value": { "tool": { "pytest": { "ini_options": { "minversion": "6.0", "addopts": ["-ra", "--strict-markers"], "testpaths": ["tests"] } } } } }, "latency_ms": 2 } }