# JSON转Excel CSV by WTSolutions
## 基本信息
- Slug: `wtsolutions-json_to_excel_mcp`
- Source: modelscope
- Publisher: WTSolutions/JSON_to_Excel_MCP
- Categories: developer-tools / communication / file-systems
- Hosted: Yes
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/WTSolutions/JSON_to_Excel_MCP
## 简介
JSON转Excel MCP（模型上下文协议）提供了一个标准化的接口，用于将JSON数据转换为CSV格式字符串。它包括两个工具：json_to_excel_mcp_from_data和json_to_excel_mcp_from_url，可以将JSON数据或来自URL的JSON文件转换为CSV格式。
## 安装提示

```bash
{ "mcpServers": { "json_to_excel": { "args": [ "mcp-remote", "https://mcp2.wtsolutions.cn/sse", "--transport", "sse-only" ], "command": "npx" } } }
```

## MCP Server 详情

# JSON to Excel MCP by WTSolutions


## Introduction

The **JSON to Excel MCP** (Model Context Protocol) provides a standardized interface for converting JSON data into CSV format string using the Model Context Protocol. This MCP implementation offers two specific tools for data conversion:

- **json_to_excel_mcp_from_data**: Converts JSON data string into CSV format.
- **json_to_excel_mcp_from_url**: Converts JSON file from a provided URL (.json format) into CSV format string.

JSON to Excel MCP is part of JSON to Excel toolkit by WTSolutions:
* [JSON to Excel Web App: Convert JSON to Excel directly in Web Browser.](https://json-to-excel.wtsolutions.cn/en/latest/WebApp.html)
* [JSON to Excel Excel Add-in: Convert JSON to Excel in Excel, works with Excel environment seamlessly.](https://json-to-excel.wtsolutions.cn/en/latest/ExcelAddIn.html)
* [JSON to Excel API: Convert JSON to Excel by HTTPS POST request.](https://json-to-excel.wtsolutions.cn/en/latest/API.html)
* <mark>JSON to Excel MCP Service: Convert JSON to Excel by AI Model MCP SSE/StreamableHTTP request.</mark> (<-- You are here.)

## Server Config

Available MCP Servers (SSE and Streamable HTTP):

## Using Stdio (NPX)


Server Config JSON:

```
{
  "mcpServers": {
    "json_to_excel": {
      "args": [
        "mcp-remote",
        "https://mcp2.wtsolutions.cn/sse",
        "--transport",
        "sse-only"
      ],
      "command": "npx"
    }
  }
}
```

### Using SSE

Transport: SSE

URL: https://mcp2.wtsolutions.cn/sse

Server Config JSON:

```
{
  "mcpServers": {
    "json2excelsse": {
      "type": "sse",
      "url": "https://mcp2.wtsolutions.cn/sse"
    }
  }
}

```
### Using Streamable HTTP

Transport: Streamable HTTP

URL: https://mcp2.wtsolutions.cn/mcp

Server Config JSON:

```
{
  "mcpServers": {
    "json2excelmcp": {
      "type": "streamableHttp",
      "url": "https://mcp2.wtsolutions.cn/mcp"
    }
  }
}
```

## MCP Tools

### json_to_excel_mcp_from_data

Converts JSON data string into CSV format string.

#### Parameters

| Parameter | Type   | Required | Description                                                                 |
|-----------|--------|----------|-----------------------------------------------------------------------------|
| data      | string | Yes      | JSON data string to be converted to CSV. Must be a valid JSON array or object. |

> Note:
> - Input data must be a valid JSON string. Validator available at [JSON to Excel Web App](https://s.wtsolutions.cn/json-to-excel.html).
> - If the JSON is an array of objects, each object will be treated as a row in the CSV.
> - If the JSON is a single object, it will be converted into a CSV with key-value pairs.
> - The CSV will include headers based on the keys in the JSON objects.
> - This tool returns CSV-formatted data that can be easily converted/imported to Excel.

#### Example Prompt 1:

Convert the following JSON data into CSV format:

```json
[
  {"Name": "John Doe", "Age": 25, "IsStudent": false},
  {"Name": "Jane Smith", "Age": 30, "IsStudent": true}
]
```

#### Example Prompt 2:

Convert the following JSON object into CSV format:

```json
{
  "Name": "John Doe",
  "Age": 25,
  "IsStudent": false,
  "Courses": ["Math", "Science"]
}
```

### json_to_excel_mcp_from_url

Converts JSON data from a provided URL into Excel data.

#### Parameters

| Parameter | Type   | Required | Description                                      |
|-----------|--------|----------|--------------------------------------------------|
| url       | string | Yes      | URL pointing to a JSON file (.json)              |

> Note:
> - The url should be publicly accessible.
> - The JSON file should be in .json format.
> - The JSON file should contain a valid JSON array or object. Validator available at [JSON to Excel Web App](https://s.wtsolutions.cn/json-to-excel.html).
> - If the JSON is an array of objects, each object will be treated as a row in the CSV.
> - If the JSON is a single object, it will be converted into a CSV with key-value pairs.
> - This tool returns CSV-formatted data that can be easily converted/imported to Excel.

### Example Prompt 1

Convert JSON file to Excel, file URL: https://mcp.wtsolutions.cn/example.json

### Example Prompt 2
(applicable only when you do not have a URL and working with online AI LLM)

I've just uploaded one .json file to you, please extract its URL and send it to MCP tool 'json_to_excel_mcp_from_url', for JSON to Excel conversion.


## Response Format

The MCP tools return a JSON object with the following structure:

| Field    | Type    | Description                                                                                                                               |
|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------|
| isError  | boolean | Indicates if there was an error processing the request                                                                                    |
| msg      | string  | 'success' or error description                                                                                                            |
| data     | string  | Converted CSV data string, '' if there was an error. This CSV data can be easily imported into Excel.                                      |

### Example Success Response

```json
{
  "content": [{
    "type": "text",
    "text": "{\"isError\":false,\"msg\":\"success\",\"data\":\"Name,Age,IsStudent\nJohn Doe,25,false\nJane Smith,30,true\"}"
  }]
}
```

Above is the response from MCP tool, and in most cases your LLM should interpret the response and present you with a JSON object, for example as below.
> Note, different LLM models may have different ways to interpret the JSON object, so please check if the JSON object is correctly interpreted by your LLM model.


```json
{
  "isError": false,
  "msg": "success",
  "data": "Name,Age,IsStudent\nJohn Doe,2…

