mcp-json-yaml-toml
A structured data reader and writer like 'jq' and 'yq' for AI Agents
Install / Use
claude mcp add bitflight-devops -- npx -y github:bitflight-devops/mcp-json-yaml-tomlIf the server publishes to npm under a different name, use that package instead ā check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of mcp-json-yaml-toml
mcp-json-yaml-toml scores 80/100 on our quality scale, 1616th of 2,166 Automation skills we index.
Its MCP Server is 9.8 KB long, well organised into 27 sections with 11 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated yesterday, so mcp-json-yaml-toml is actively maintained.
- Our last check on 2026-09-20 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
mcp-json-yaml-toml compared with similar skills
All 4 of these similar skills score higher than mcp-json-yaml-toml; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| mcp-json-yaml-toml (this skill)by bitflight-devops | 80 | 10 | 1d ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 86.1k | 13d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.1k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 73.5k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install mcp-json-yaml-toml?
- Run
claude mcp add bitflight-devops -- npx -y github:bitflight-devops/mcp-json-yaml-toml. The install tabs above show the steps for each supported agent. - Which AI agents does mcp-json-yaml-toml work with?
- It is written for Claude Code, Claude Desktop and Gemini CLI, as a MCP Server file. Other agents that read the same format can often use it too.
- Is mcp-json-yaml-toml safe to use?
- It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is mcp-json-yaml-toml still maintained?
- The repository was last updated yesterday, so mcp-json-yaml-toml is actively maintained.
Skill content
View source on GitHubStop 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$schemakeys 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
yqif missing and fetches missing schemas from SchemaStore.org for local caching.
[!NOTE]
JSONC Support: Files with
.jsoncextension (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.
- An MCP-compatible client (Claude Code, Cursor, Windsurf, Gemini 2.0, n8n, etc.).
Installation
The server uses uvx for automatic dependency management and zero-config execution.
AI Agents & CLI Tools
uvx mcp-json-yaml-toml
Claude Code (CLI)
claude mcp add --scope user mcp-json-yaml-toml -- uvx mcp-json-yaml-toml
Other MCP Clients
Add this to your client's MCP configuration:
{
"mcpServers": {
"json-yaml-toml": {
"command": "uvx",
"args": ["mcp-json-yaml-toml"]
}
}
}
[!TIP] See docs/clients.md for detailed setup guides for Cursor, VS Code, and more.
Schema Discovery & Recognition
The server automatically identifies the correct JSON schema for your files using multiple strategies:
- Directives: Recognizes
# yaml-language-server: $schema=...and#:schema ...directives. - In-File Keys: Detects
$schemakeys in JSON and YAML (also supports quoted"$schema"in TOML). - Local IDE Config: Discovers schemas from VS Code/Cursor extension settings and caches.
- SchemaStore.org: Performs glob-based auto-detection against thousands of known formats.
- Manual Association: Use the
data_schematool to bind a file to a specific schema URL or name.
LMQL & Guided Generation
This server provides native support for LMQL (Language Model Query Language) to enable Guided Generation. This allows AI agents to validate partial inputs (e.g., path expressions) incrementally before execution.
- Incremental Validation: Check partial inputs (e.g.,
.data.us) and get the remaining pattern needed. - Improved Reliability: Eliminate syntax errors by guiding the LLM toward valid tool inputs.
- Rich Feedback: Get suggestions and detailed error messages for common mistakes.
[!TIP] See the Deep Dive: LMQL Constraints for detailed usage examples.
Available Tools
| Tool | Description |
| --------------------- | ---------------------------------------------- |
| data | Get, set, or delete values at specific paths |
| data_query | Advanced yq/jq expressions for transformations |
| data_schema | Manage schemas and validate files |
| data_convert | Convert between JSON, YAML, and TOML |
| data_merge | Deep merge structured data files |
| constraint_validate | Validate inputs against LMQL constraints |
| constraint_list | List available generation constraints |
[!NOTE] Conversion TO TOML is not supported due to yq's internal encoder limitations for complex structures.
Development
Setup
git clone https://github.com/bitflight-devops/mcp-json-yaml-toml.git
cd mcp-json-yaml-toml
uv sync
Testing
ash
Run all tests (coverage included)
uv run pytest
### Code Quality
The project uses `prek` (a Rust-based pre-commit tool) for unified linting and formatting. AI Agents MUST use the scoped verification command:
```bash
# Recommended: Verify only touched files
uv run prek run --files <file edited>
[!IMPORTANT] Avoid
--all-filesduring feature development to keep PR diffs clean and preserve git history.
Project Structure
mcp-json-yaml-toml/
āāā packages/mcp_json_yaml_toml/ # Core logic
ā āāā server.py # MCP implementation
ā āāā yq_wrapper.py # Binary management
ā āāā schemas.py # Schema validation
āāā .github/ # CI/CD and assets
āāā docs/ # Documentation
āāā pyproject.toml # Project config
# Run all tests (coverage included)
uv run pytest
Code Quality
The project uses prek (a Rust-based pre-commit tool) for unified linting and formatting. AI Agents MUST use the scoped verification command:
# Recommended: Verify only touched files
uv run prek run --files <file edited>
[!IMPORTANT] Avoid
--all-filesduring feature development to keep PR diffs clean and preserve git history.
Project Structure
graph TD
Repo[mcp-json-yaml-toml]
Repo --> Packages[packages/mcp_json_yaml_toml]
Repo --> Github[.github]
Repo --> Docs[docs]
Repo --> Config[pyproject.toml]
subgraph "Core Logic"
Packages --> Server[server.py<br/>MCP Server & Tools]
Packages --> Schemas[schemas.py<br/>Schema Validation]
Packages --> Constraints[lmql_constraints.py<br/>LMQL Constraints]
Packages --> YQ[yq_wrapper.py<br/>Binary Manager]
Packages --> YAML[yaml_optimizer.py<br/>YAML Anchors]
Packages --> TOML[toml_utils.py<br/>TOML Utils]
Packages --> Conf[config.py<br/>Config Manager]
end
style Packages fill:#f9f,stroke:#333,stroke-width:2px
style Repo fill:#eee,stroke:#333,stroke-width:4px
Token Efficiency Experiment
Two identical Claude Code sub-agents were given the same task: read ~/.claude.json and report every MCP server listed, including command, args, and env vars.
Setup
- Agent A ā standard prompt, used the built-in
Readtool - Agent B ā same prompt with one line appended:
You must use the mcp__json-yaml-toml for all file interactions.
Both agents used the sonnet model.
Prompts
Agent A prompt:
Read the file ~/.claude.json and report back:
1. Every MCP server listed in the mcpServers section
2. For each server: the command, args, and any env vars configured
Just report the raw findings. Do not summarize or interpret.
Agent B prompt:
Read the file ~/.claude.json and report back:
1. Every MCP server listed in the mcpServers section
2. For each server: the command, args, and any env vars configured
You must use the mcp__json-yaml-toml for all file interactions.
Just report the raw findings. Do not summarize or interpret.
Results
Both agents returned identical findings (8 MCP servers with correct configs).
| Metric | Agent A (Read tool) | Agent B (mcp-json-yaml-toml) | | ---------------- | ------------------- | ---------------------------- | | Total tokens | 37,119 | 28,734 | | Tool uses | 4 | 2 | | Duration | 29.3s | 12.7s |
Agent B used 22.6% fewer tokens and completed in 43% of the time with half the tool calls.
Why
The Read tool loads the entire file into context. ~/.claude.json is a large file ā the agent had to consume all of it to find the mcpServers section. The MCP server's data_query tool extracted just the mcpServers section directly, keeping the context window small.
<p align="center"> Built with <a href="https://github.com/jlowin/fastmcp">FastMCP</a>, <a href="https://github.com/mikefarah/yq">yq</a>, and <a href="https://github.com/eth-sri/lmql">LMQL</a> </p>
Related Skills
Agent-Reach
86.1kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
headroom
74.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ruflo
73.5kš The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
CowAgent
47.2kOpen-source super AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
