docbot-mcp 1.0.0

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.
Files changed (2) hide show
  1. package/index.js +63 -0
  2. package/package.json +19 -0
package/index.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/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "docbot-mcp",
3
+ "version": "1.0.0",
4
+ "description": "Bidirectional CSV <> JSON <> Markdown transformer",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "docbot-mcp": "./index.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "author": "",
13
+ "license": "MIT",
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.27.1",
16
+ "@rflukerii/docbot": "^1.0.1"
17
+ },
18
+ "type": "module"
19
+ }