docbot-mcp 1.0.0 → 1.0.1

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 ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.1] - 2026-03-07
6
+ ### Changed
7
+ - Migrate from stdio to HTTP transport
8
+
9
+ ## [1.0.0] - 2026-03-05
10
+ ### Added
11
+ - Initial release
12
+ - `csvToJson` — converts CSV string to JSON array
13
+ - `jsonToCsv` — converts JSON array to CSV string
14
+ - `jsonToMarkdown` — converts JSON array to Markdown table
15
+ - `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,85 @@
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);
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.0'
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: [{ type: 'text', text: JSON.stringify(csvToJson(csv)) }]
28
+ })
29
+ );
30
+
31
+ server.registerTool(
32
+ 'jsonToCsv',
33
+ {
34
+ title: 'Convert JSON to CSV',
35
+ description: 'Converts a JSON string to CSV',
36
+ inputSchema: { json: z.string() }
37
+ },
38
+ async ({ json }) => ({
39
+ content: [{ type: 'text', text: jsonToCsv(JSON.parse(json)) }]
40
+ })
41
+ );
42
+
43
+ server.registerTool(
44
+ 'csvToMarkdown',
45
+ {
46
+ title: 'Convert CSV to Markdown',
47
+ description: 'Converts a CSV string to Markdown',
48
+ inputSchema: { csv: z.string() }
49
+ },
50
+ async ({ csv }) => ({
51
+ content: [{ type: 'text', text: csvToMarkdown(csv) }]
52
+ })
53
+ );
54
+
55
+ server.registerTool(
56
+ 'jsonToMarkdown',
57
+ {
58
+ title: 'Convert JSON to Markdown',
59
+ description: 'Converts a JSON string to Markdown',
60
+ inputSchema: { json: z.string() }
61
+ },
62
+ async ({ json }) => ({
63
+ content: [{ type: 'text', text: jsonToMarkdown(JSON.parse(json)) }]
64
+ })
65
+ );
66
+
67
+ return server;
68
+ }
69
+
70
+ app.get('/health', (req, res) => {
71
+ res.status(200).send('OK');
72
+ });
73
+
74
+ app.post('/docbot-mcp', async (req, res) => {
75
+ const server = createServer();
76
+ const transport = new StreamableHTTPServerTransport({
77
+ sessionIdGenerator: undefined,
78
+ });
79
+ await server.connect(transport);
80
+ await transport.handleRequest(req, res, req.body);
81
+ });
82
+
83
+ app.listen(process.env.PORT || 3000, () => {
84
+ console.log('docbot-mcp running on http://localhost:3000/docbot-mcp');
85
+ });
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "docbot-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Bidirectional CSV <> JSON <> Markdown transformer",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "docbot-mcp": "./index.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
10
+ "test": "echo \"Error: no test specified\" && exit 1",
11
+ "start": "node index.js"
11
12
  },
12
13
  "author": "",
13
14
  "license": "MIT",
14
15
  "dependencies": {
15
16
  "@modelcontextprotocol/sdk": "^1.27.1",
16
- "@rflukerii/docbot": "^1.0.1"
17
+ "@rflukerii/docbot": "^1.0.1",
18
+ "express": "^5.2.1",
19
+ "zod": "^4.3.6"
17
20
  },
18
21
  "type": "module"
19
22
  }