home / mcp / json mcp server

JSON MCP Server

Node.js MCP server that queries, validates, and transforms JSON data with optional S3 sync.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "berrydev-ai-json-mcp-server": {
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_ID",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY"
      }
    }
  }
}

You can run a JSON MCP Server to perform powerful JSON file operations from a client. It lets you query JSON with jq notation, generate and validate JSON schemas, and optionally synchronize with S3. It supports both stdio and HTTP transports, making it versatile for local development and remote access.

How to use

You connect to the JSON MCP Server from your MCP client to perform operations on JSON data. You can run in stdio mode for local development or expose an HTTP endpoint for remote access. Typical workflows include querying data with jq, generating schemas from your JSON, validating those schemas, and optionally keeping a local file in sync with an S3 bucket.

Key capabilities you will use include: querying JSON files with jq expressions, generating complete JSON schemas from your data, validating schemas with AJV, and optional S3 synchronization for remote JSON data. Ensure you pass an absolute file path when targeting your JSON file and install the required jq binary on your system before starting the server.

How to install

Prerequisites you must have before starting:

  • jq binary installed on your system (required)

Install jq on your platform if you have not already done so.

Then install and run the JSON MCP Server using one of the common methods shown here.

# Install the MCP server package globally (recommended for quick start)
npm install -g @berrydev-ai/json-mcp-server
```
```bash
# Local development workflow: clone, install, then run
git clone https://github.com/berrydev-ai/json-mcp-server.git
cd json-mcp-server
npm install
```
```bash
# Start the server in stdio (default) using npx
npx -y @berrydev-ai/json-mcp-server --verbose=true --file-path=/absolute/path/to/your/data.json
```
```bash
# Start the server with HTTP transport
npx -y @berrydev-ai/json-mcp-server --transport=http --port=3000 --verbose=true --file-path=/absolute/path/to/your/data.json
```
```bash
# Start local development (stdio) with explicit node command
node index.js --verbose=true --file-path=/absolute/path/to/your/data.json
```
```bash
# Start HTTP transport locally via Node (explicit script path)
node index.js --transport=http --port=3000 --host=localhost --verbose=true --file-path=/absolute/path/to/your/data.json
`

Additional configuration notes

Absolute paths are required for file access. The server needs the jq binary installed on the host system to perform JSON querying and transformations.

If you want remote access via HTTP, you can run the HTTP transport on a chosen port and host. For local development, stdio is the simplest path to start testing your queries and schemas.

Configuration examples and security

{
  "mcpServers": {
    "json_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@berrydev-ai/json-mcp-server",
        "--verbose=true",
        "--file-path=/absolute/path/to/your/data.json"
      ]
    }
  },
  "env": {
    "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_ID",
    "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY"
  }
}

Notes and troubleshooting

If you see issues starting the server, ensure jq is installed and the provided file path is absolute. For HTTP transport, verify that the port you chose is not in use and that firewall settings allow inbound connections.

Tools and capabilities overview

The JSON MCP Server exposes the following core tools to manipulate JSON data: query_json to execute jq queries on JSON files, generate_json_schema to create JSON schemas from data, and validate_json_schema to check the validity of JSON schemas. It also provides S3 sync support for keeping local JSON files in sync with remote data when configured.

Supported MCP server configurations

The following MCP server configurations are available from the usage examples for this server. Each configuration is intended to be used in your MCP client setup.

Available tools

query_json

Execute jq queries on JSON files with complex filters and transformations. Inputs include filePath and query expressions.

generate_json_schema

Generate a complete JSON schema from existing JSON data using genson-js. Requires an absolute file path to JSON data.

validate_json_schema

Validate JSON schemas using AJV. Accepts a schema object or a path to a schema file and returns validation results.