docbot-mcp 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +177 -0
- package/index-stdio.js +63 -0
- package/index.js +121 -63
- package/package.json +7 -3
- package/server.json +28 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.2] - 2026-03-09
|
|
6
|
+
### Added
|
|
7
|
+
- Add `mcpName` to package.json for MCP registry registration
|
|
8
|
+
- Add `server.json` for MCP registry metadata
|
|
9
|
+
|
|
10
|
+
## [1.0.1] - 2026-03-07
|
|
11
|
+
### Changed
|
|
12
|
+
- Migrate from stdio to HTTP transport
|
|
13
|
+
|
|
14
|
+
## [1.0.0] - 2026-03-05
|
|
15
|
+
### Added
|
|
16
|
+
- Initial release
|
|
17
|
+
- `csvToJson` — converts CSV string to JSON array
|
|
18
|
+
- `jsonToCsv` — converts JSON array to CSV string
|
|
19
|
+
- `jsonToMarkdown` — converts JSON array to Markdown table
|
|
20
|
+
- `csvToMarkdown` — converts CSV string to Markdown table
|
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# docbot-mcp
|
|
2
|
+
|
|
3
|
+
Bidirectional CSV ↔️ JSON ↔️ Markdown transformer exposed as an MCP (Model Context Protocol) server with HTTP transport.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
**docbot-mcp** is a Model Context Protocol server that provides tools for converting between CSV, JSON, and Markdown formats. It's built on the [Model Context Protocol](https://modelcontextprotocol.io/) and designed for deployment on serverless platforms like AWS App Runner.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- ✅ **CSV to JSON** — Parse CSV strings into JSON arrays
|
|
12
|
+
- ✅ **JSON to CSV** — Serialize JSON arrays to CSV format
|
|
13
|
+
- ✅ **CSV to Markdown** — Convert CSV to formatted Markdown tables
|
|
14
|
+
- ✅ **JSON to Markdown** — Convert JSON arrays to Markdown tables
|
|
15
|
+
- ✅ **HTTP-based** — REST API endpoint for easy integration
|
|
16
|
+
- ✅ **Containerized** — Ready for deployment on AWS App Runner, Docker, etc.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Requirements
|
|
25
|
+
|
|
26
|
+
- Node.js 16+ (ES modules support)
|
|
27
|
+
- Dependencies:
|
|
28
|
+
- `@modelcontextprotocol/sdk` — MCP protocol implementation
|
|
29
|
+
- `@rflukerii/docbot` — Document conversion utilities
|
|
30
|
+
- `express` — HTTP server framework
|
|
31
|
+
- `zod` — Input validation
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Starting the Server
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm start
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The server starts on `http://localhost:3000` with the MCP endpoint at `/docbot-mcp`.
|
|
42
|
+
|
|
43
|
+
### Available Tools
|
|
44
|
+
|
|
45
|
+
All tools accept input as text parameters and return formatted text responses.
|
|
46
|
+
|
|
47
|
+
#### csvToJson
|
|
48
|
+
Converts a CSV string to JSON format.
|
|
49
|
+
|
|
50
|
+
**Input:** `csv` (string)
|
|
51
|
+
**Output:** JSON array as string
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl -X POST http://localhost:3000/docbot-mcp \
|
|
55
|
+
-H "Content-Type: application/json" \
|
|
56
|
+
-d '{"tool": "csvToJson", "input": {"csv": "name,age\nAlice,30"}}'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### jsonToCsv
|
|
60
|
+
Converts a JSON array to CSV format.
|
|
61
|
+
|
|
62
|
+
**Input:** `json` (string)
|
|
63
|
+
**Output:** CSV string
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
curl -X POST http://localhost:3000/docbot-mcp \
|
|
67
|
+
-H "Content-Type: application/json" \
|
|
68
|
+
-d '{"tool": "jsonToCsv", "input": {"json": "[{\"name\":\"Alice\",\"age\":30}]"}}'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### csvToMarkdown
|
|
72
|
+
Converts a CSV string to a Markdown table.
|
|
73
|
+
|
|
74
|
+
**Input:** `csv` (string)
|
|
75
|
+
**Output:** Markdown table string
|
|
76
|
+
|
|
77
|
+
#### jsonToMarkdown
|
|
78
|
+
Converts a JSON array to a Markdown table.
|
|
79
|
+
|
|
80
|
+
**Input:** `json` (string)
|
|
81
|
+
**Output:** Markdown table string
|
|
82
|
+
|
|
83
|
+
## Architecture
|
|
84
|
+
|
|
85
|
+
### HTTP Transport
|
|
86
|
+
|
|
87
|
+
The server uses `StreamableHTTPServerTransport` instead of stdio for better compatibility with containerized environments. Each request to `/docbot-mcp` creates a new server instance, processes the MCP request, and returns the result.
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Express Server (port 3000)
|
|
91
|
+
↓
|
|
92
|
+
POST /docbot-mcp endpoint
|
|
93
|
+
↓
|
|
94
|
+
MCP Server instance (createServer)
|
|
95
|
+
↓
|
|
96
|
+
StreamableHTTPServerTransport
|
|
97
|
+
↓
|
|
98
|
+
Tool execution (csvToJson, jsonToCsv, etc.)
|
|
99
|
+
↓
|
|
100
|
+
Response back to client
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### File Structure
|
|
104
|
+
|
|
105
|
+
- `index.js` — Main HTTP server entry point (AWS App Runner compatible)
|
|
106
|
+
- `index-stdio.js` — Stdio transport version (for local/stdio-based clients)
|
|
107
|
+
- `package.json` — Dependencies and scripts
|
|
108
|
+
|
|
109
|
+
## Deployment
|
|
110
|
+
|
|
111
|
+
### AWS App Runner
|
|
112
|
+
|
|
113
|
+
The server includes a `start` script configured for AWS App Runner:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"scripts": {
|
|
118
|
+
"start": "node index.js"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Steps to deploy:**
|
|
124
|
+
|
|
125
|
+
1. Push code to AWS CodeCommit, GitHub, or BitBucket
|
|
126
|
+
2. Create AWS App Runner service
|
|
127
|
+
3. Configure source as your repository
|
|
128
|
+
4. Set build command: `npm install`
|
|
129
|
+
5. Set start command: `npm start`
|
|
130
|
+
6. App Runner will automatically run the server on port 3000
|
|
131
|
+
|
|
132
|
+
### Docker
|
|
133
|
+
|
|
134
|
+
Example Dockerfile:
|
|
135
|
+
|
|
136
|
+
```dockerfile
|
|
137
|
+
FROM node:18-alpine
|
|
138
|
+
WORKDIR /app
|
|
139
|
+
COPY package*.json ./
|
|
140
|
+
RUN npm install --production
|
|
141
|
+
COPY . .
|
|
142
|
+
EXPOSE 3000
|
|
143
|
+
CMD ["npm", "start"]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Development
|
|
147
|
+
|
|
148
|
+
### Switching Between Transports
|
|
149
|
+
|
|
150
|
+
- **HTTP (default)**: `node index.js` — For containerized environments
|
|
151
|
+
- **Stdio**: `node index-stdio.js` — For direct CLI/stdio clients
|
|
152
|
+
|
|
153
|
+
### Adding New Tools
|
|
154
|
+
|
|
155
|
+
Edit `index.js` and use the `server.registerTool()` pattern:
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
server.registerTool(
|
|
159
|
+
'toolName',
|
|
160
|
+
{
|
|
161
|
+
title: 'Display Title',
|
|
162
|
+
description: 'What it does',
|
|
163
|
+
inputSchema: { paramName: z.type() }
|
|
164
|
+
},
|
|
165
|
+
async ({ paramName }) => ({
|
|
166
|
+
content: [{ type: 'text', text: 'result' }]
|
|
167
|
+
})
|
|
168
|
+
);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
MIT
|
|
174
|
+
|
|
175
|
+
## Changelog
|
|
176
|
+
|
|
177
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
|
package/index-stdio.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// External imports
|
|
4
|
+
import { csvToJson, jsonToCsv, jsonToMarkdown, csvToMarkdown } from '@rflukerii/docbot'
|
|
5
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
const server = new McpServer({
|
|
10
|
+
name: 'docbot-mcp',
|
|
11
|
+
version: '1.0.0'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
server.registerTool(
|
|
15
|
+
'csvToJson',
|
|
16
|
+
{
|
|
17
|
+
title: 'Convert CSV to JSON',
|
|
18
|
+
description: 'Converts a CSV string to JSON',
|
|
19
|
+
inputSchema: { csv: z.string() }
|
|
20
|
+
},
|
|
21
|
+
async ({ csv }) => ({
|
|
22
|
+
content: [{ type: 'text', text: JSON.stringify(csvToJson(csv)) }]
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
server.registerTool(
|
|
27
|
+
'jsonToCsv',
|
|
28
|
+
{
|
|
29
|
+
title: 'Convert JSON to CSV',
|
|
30
|
+
description: 'Converts a JSON string to CSV',
|
|
31
|
+
inputSchema: { json: z.string() }
|
|
32
|
+
},
|
|
33
|
+
async ({ json }) => ({
|
|
34
|
+
content: [{ type: 'text', text: jsonToCsv(JSON.parse(json)) }]
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
server.registerTool(
|
|
39
|
+
'csvToMarkdown',
|
|
40
|
+
{
|
|
41
|
+
title: 'Convert CSV to Markdown',
|
|
42
|
+
description: 'Converts a CSV string to Markdown',
|
|
43
|
+
inputSchema: { csv: z.string() }
|
|
44
|
+
},
|
|
45
|
+
async ({ csv }) => ({
|
|
46
|
+
content: [{ type: 'text', text: csvToMarkdown(csv) }]
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
server.registerTool(
|
|
51
|
+
'jsonToMarkdown',
|
|
52
|
+
{
|
|
53
|
+
title: 'Convert JSON to Markdown',
|
|
54
|
+
description: 'Converts a JSON string to Markdown',
|
|
55
|
+
inputSchema: { json: z.string() }
|
|
56
|
+
},
|
|
57
|
+
async ({ json }) => ({
|
|
58
|
+
content: [{ type: 'text', text: jsonToMarkdown(JSON.parse(json)) }]
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const transport = new StdioServerTransport();
|
|
63
|
+
await server.connect(transport);
|
package/index.js
CHANGED
|
@@ -1,63 +1,121 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// External imports
|
|
4
|
-
import { csvToJson, jsonToCsv, jsonToMarkdown, csvToMarkdown } from '@rflukerii/docbot'
|
|
5
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
-
import {
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
server
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// External imports
|
|
4
|
+
import { csvToJson, jsonToCsv, jsonToMarkdown, csvToMarkdown } from '@rflukerii/docbot'
|
|
5
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import express from 'express';
|
|
9
|
+
|
|
10
|
+
const app = express();
|
|
11
|
+
app.use(express.json());
|
|
12
|
+
|
|
13
|
+
function createServer() {
|
|
14
|
+
const server = new McpServer({
|
|
15
|
+
name: 'docbot-mcp',
|
|
16
|
+
version: '1.0.2'
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
server.registerTool(
|
|
20
|
+
'csvToJson',
|
|
21
|
+
{
|
|
22
|
+
title: 'Convert CSV to JSON',
|
|
23
|
+
description: 'Converts a CSV string to JSON',
|
|
24
|
+
inputSchema: { csv: z.string() }
|
|
25
|
+
},
|
|
26
|
+
async ({ csv }) => ({
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: JSON.stringify(csvToJson(csv)) + '\n\n@rflukerii/docubot'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: '@rflukerii/docubot'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
server.registerTool(
|
|
41
|
+
'jsonToCsv',
|
|
42
|
+
{
|
|
43
|
+
title: 'Convert JSON to CSV',
|
|
44
|
+
description: 'Converts a JSON string to CSV',
|
|
45
|
+
inputSchema: { json: z.string() }
|
|
46
|
+
},
|
|
47
|
+
async ({ json }) => ({
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: jsonToCsv(JSON.parse(json)) + '\n\n@rflukerii/docubot'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: '@rflukerii/docubot'
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
server.registerTool(
|
|
62
|
+
'csvToMarkdown',
|
|
63
|
+
{
|
|
64
|
+
title: 'Convert CSV to Markdown',
|
|
65
|
+
description: 'Converts a CSV string to Markdown',
|
|
66
|
+
inputSchema: { csv: z.string() }
|
|
67
|
+
},
|
|
68
|
+
async ({ csv }) => ({
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: 'text',
|
|
72
|
+
text: csvToMarkdown(csv) + '\n\n@rflukerii/docubot'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'text',
|
|
76
|
+
text: '@rflukerii/docubot'
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
server.registerTool(
|
|
83
|
+
'jsonToMarkdown',
|
|
84
|
+
{
|
|
85
|
+
title: 'Convert JSON to Markdown',
|
|
86
|
+
description: 'Converts a JSON string to Markdown',
|
|
87
|
+
inputSchema: { json: z.string() }
|
|
88
|
+
},
|
|
89
|
+
async ({ json }) => ({
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: jsonToMarkdown(JSON.parse(json)) + '\n\n@rflukerii/docubot'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: 'text',
|
|
97
|
+
text: '@rflukerii/docubot'
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
return server;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
app.get('/health', (req, res) => {
|
|
107
|
+
res.status(200).send('OK');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
app.post('/mcp', async (req, res) => {
|
|
111
|
+
const server = createServer();
|
|
112
|
+
const transport = new StreamableHTTPServerTransport({
|
|
113
|
+
sessionIdGenerator: undefined,
|
|
114
|
+
});
|
|
115
|
+
await server.connect(transport);
|
|
116
|
+
await transport.handleRequest(req, res, req.body);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
app.listen(process.env.PORT || 3000, () => {
|
|
120
|
+
console.log('docbot-mcp running on http://localhost:3000/mcp');
|
|
121
|
+
});
|
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docbot-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"mcpName": "io.github.rflukerii-dev/docbot-mcp",
|
|
4
5
|
"description": "Bidirectional CSV <> JSON <> Markdown transformer",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"bin": {
|
|
7
8
|
"docbot-mcp": "./index.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"start": "node index.js"
|
|
11
13
|
},
|
|
12
14
|
"author": "",
|
|
13
15
|
"license": "MIT",
|
|
14
16
|
"dependencies": {
|
|
15
17
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
16
|
-
"@rflukerii/docbot": "^1.0.1"
|
|
18
|
+
"@rflukerii/docbot": "^1.0.1",
|
|
19
|
+
"express": "^5.2.1",
|
|
20
|
+
"zod": "^4.3.6"
|
|
17
21
|
},
|
|
18
22
|
"type": "module"
|
|
19
23
|
}
|
package/server.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
|
|
3
|
+
"name": "io.github.rflukerii-dev/docbot-mcp",
|
|
4
|
+
"description": "Bidirectional CSV <> JSON <> Markdown transformer",
|
|
5
|
+
"status": "active",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/rflukerii-dev/docbot-mcp",
|
|
8
|
+
"source": "github"
|
|
9
|
+
},
|
|
10
|
+
"version": "1.0.2",
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registry_type": "npm",
|
|
14
|
+
"registry_base_url": "https://registry.npmjs.org",
|
|
15
|
+
"identifier": "docbot-mcp",
|
|
16
|
+
"version": "1.0.2",
|
|
17
|
+
"transport": {
|
|
18
|
+
"type": "httpStream"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"remotes": [
|
|
23
|
+
{
|
|
24
|
+
"type": "httpStream",
|
|
25
|
+
"url": "https://spdeyfjpfv.us-east-1.awsapprunner.com/mcp"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|