Skip to content

Commit aec98c5

Browse files
committed
update readme
1 parent 6c44dc2 commit aec98c5

File tree

1 file changed

+126
-2
lines changed

1 file changed

+126
-2
lines changed

README.md

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,126 @@
1-
# excel-to-json-mcp
2-
MCP Server converting Excel and CSV data into JSON
1+
# Excel to JSON MCP by WTSolutions Documentation
2+
3+
## Introduction
4+
5+
The Excel to JSON MCP (Model Context Protocol) provides a standardized interface for converting Excel and CSV data into JSON format using the Model Context Protocol. This MCP implementation offers two specific tools for data conversion:
6+
7+
- **excel_to_json_mcp_from_data**: Converts tab-separated or comma-separated text data
8+
- **excel_to_json_mcp_from_url**: Converts Excel from a provided URL
9+
10+
## Endpoints
11+
12+
**`SSE`** https://mcp.wtsolutions.cn/excel-to-json-mcp-sse 📋
13+
14+
## MCP Tools
15+
16+
### excel_to_json_mcp_from_data
17+
18+
Converts tab-separated or comma-separated text data into JSON format.
19+
20+
#### Parameters
21+
22+
| Parameter | Type | Required | Description |
23+
|-----------|--------|----------|-----------------------------------------------------------------------------|
24+
| data | string | Yes | Tab-separated or comma-separated text data with at least two rows (header row + data row) |
25+
26+
#### Example Request
27+
28+
```json
29+
{
30+
"tool": "excel_to_json_mcp_from_data",
31+
"parameters": {
32+
"data": "Name\tAge\tIsStudent\nJohn Doe\t25\tfalse\nJane Smith\t30\ttrue"
33+
}
34+
}
35+
```
36+
37+
### excel_to_json_mcp_from_url
38+
39+
Converts an Excel or CSV file from a provided URL into JSON format.
40+
41+
#### Parameters
42+
43+
| Parameter | Type | Required | Description |
44+
|-----------|--------|----------|--------------------------------------------------|
45+
| url | string | Yes | URL pointing to an Excel (.xlsx) or CSV file |
46+
47+
#### Example Request
48+
49+
```json
50+
{
51+
"tool": "excel_to_json_mcp_from_url",
52+
"parameters": {
53+
"url": "https://example.com/path/to/your/file.xlsx"
54+
}
55+
}
56+
```
57+
58+
## Response Format
59+
60+
The MCP tools return a JSON object with the following structure:
61+
62+
| Field | Type | Description |
63+
|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------|
64+
| isError | boolean | Indicates if there was an error processing the request |
65+
| msg | string | 'success' or error description |
66+
| data | string | Converted data as array of sheet objects if using URL, string if using direct data, '' if there was an error. Each sheet object contains 'sheetName' (string) and 'data' (array of objects) if using URL |
67+
68+
### Example Success Response
69+
70+
```json
71+
{
72+
"content": [{
73+
"type": "text",
74+
"text": "{\"isError\":false,\"msg\":\"success\",\"data\":\"[{\"Name\":\"John Doe\",\"Age\":25,\"IsStudent\":false},{\"Name\":\"Jane Smith\",\"Age\":30,\"IsStudent\":true}]\"}"
75+
}]
76+
}
77+
```
78+
79+
## Data Type Handling
80+
81+
The API automatically detects and converts different data types:
82+
83+
- **Numbers**: Converted to numeric values
84+
- **Booleans**: Recognizes 'true'/'false' (case-insensitive) and converts to boolean values
85+
- **Dates**: Detects various date formats and converts them appropriately
86+
- **Strings**: Treated as string values
87+
- **Empty values**: Represented as empty strings
88+
89+
## Requirements on data and url
90+
91+
### excel_to_json_mcp_from_data
92+
93+
- Input data must be tab-separated or comma-separated text with at least two rows (header row + data row).
94+
1. The first row will be considered as "header" row, and this API will use it as column names, subsequently JSON keys.
95+
2. The following rows will be considered as "data" rows, and this API will use them as JSON values.
96+
97+
### excel_to_json_mcp_from_url
98+
99+
- Each sheet of the Excel file should contain at least two rows (header row + data row).
100+
1. The first row will be considered as "header" row, and this API will use it as column names, subsequently JSON keys.
101+
2. The following rows will be considered as "data" rows, and this API will use them as JSON values.
102+
- This Excel file should be in '.xlsx' format.
103+
- Each sheet of the Excel file will be converted to a JSON object.
104+
- Each JSON object will have 'sheetName' (string) and 'data' (array of objects) properties.
105+
- Each JSON object in 'data' array will have properties corresponding to column names.
106+
- Each JSON object in 'data' array will have values corresponding to cell values.
107+
108+
## Error Handling
109+
110+
The API returns descriptive error messages for common issues:
111+
112+
- `Excel Data Format Invalid`: When input data is not tab-separated or comma-separated
113+
- `At least 2 rows are required`: When input data has fewer than 2 rows
114+
- `Both data and url received`: When both 'data' and 'url' parameters are provided
115+
- `Network Error when fetching file`: When there's an error downloading the file from the provided URL
116+
- `File not found`: When the file at the provided URL cannot be found
117+
- `Blank/Null/Empty cells in the first row not allowed`: When header row contains empty cells
118+
- `Server Internal Error`: When an unexpected error occurs
119+
120+
## Pricing
121+
122+
Free for now.
123+
124+
## Donation
125+
126+
[https://buymeacoffee.com/wtsolutions](https://buymeacoffee.com/wtsolutions)

0 commit comments

Comments
 (0)