BD

bitflight-devops/mcp-json-yaml-toml

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 3 forks 质量 78 趋势 38MIT

A structured data reader and writer like 'jq' and 'yq' for AI Agents

概览

A token-efficient, schema-aware MCP server for safely reading and modifying JSON, YAML, and TOML files Getting Started • CLI Usage • Available Tools • Development Stop AI coding tools from breaking your data files. No more grep guesswork, hallucinated fields, or non-schema-compliant data added to files. This MCP server gives AI assistants a strict, round-trip safe interface for working with structured data. AI coding tools often destroy structured data files: - They through huge json, yaml, and toml files (like json logs, or AI transcript files) and guess at keys. - They fields that never existed. - They use that leave files in invalid states. - They break and . - They can't changes before writing. provides AI assistants with proper tools for structured data: - : Extract exactly what you need without loading entire files. - : Enforce correctness using SchemaStore.org or custom schemas. - : ; preserve comments and formatting. - : JSON, YAML, and TOML through a unified interface.

README

以下为原文 README 节选,完整内容请查看原文。

mcp-json-yaml-toml

A token-efficient, schema-aware MCP server for safely reading and modifying JSON, YAML, and TOML files

Getting Started • CLI Usage • Available Tools • Development


Stop AI coding tools from breaking your data files. No more grep guesswork, hallucinated fields, or non-schema-compliant data added to files. This MCP server gives AI assistants a strict, round-trip safe interface for working with structured data.

The Problem

AI coding tools often destroy structured data files:

  • They grep through huge json, yaml, and toml files (like json logs, or AI transcript files) and guess at keys.
  • They hallucinate fields that never existed.
  • They use sed and regex that leave files in invalid states.
  • They break YAML indentation and TOML syntax.
  • They can’t validate changes before writing.

The Solution

mcp-json-yaml-toml provides AI assistants with proper tools for structured data:

  • Token-efficient: Extract exactly what you need without loading entire files.
  • Schema validation: Enforce correctness using SchemaStore.org or custom schemas.
  • Safe modifications: Enforced validation on write; preserve comments and formatting.
  • Multi-format: JSON, YAML, and TOML through a unified interface.
  • Directive-based detection: Support for # yaml-language-server, #:schema, and $schema keys in all formats.
  • Constraint-based guided generation: Native LMQL support for proactive validation of partial inputs.
  • Local-First: All processing happens locally. No data ever leaves your machine.
  • Transparent JIT Assets: The server auto-downloads yq if missing and fetches missing schemas from SchemaStore.org for local caching.

[!NOTE]

JSONC Support: Files with .jsonc extension (JSON with Comments) are fully supported for reading, querying, and schema validation. However, write operations will strip comments due to library limitations.


Getting Started

Prerequisites

  • Python ≥ 3.11 installed.
在 GitHub 查看完整 README

安装

uvx mcp-json-yaml-toml
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "json-yaml-toml": { "command": "uvx", "args": ["mcp-json-yaml-toml"] } } }