dodraw-mcp-server 0.1.0 → 0.1.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/README.md +35 -50
- package/dist/src/tools/diagramTools.js +1 -1
- package/image.png +0 -0
- package/package.json +1 -1
- package/src/tools/diagramTools.ts +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,48 @@
|
|
|
1
1
|
|
|
2
2
|
# DoDraw MCP Server
|
|
3
3
|
|
|
4
|
-
An MCP server implementation for DoDraw
|
|
4
|
+
An MCP server implementation for DoDraw , providing tools to programmatically generate and manipulate 3D UML diagrams.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
DoDraw application - https://dodraw.xyz
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
### Configuring an MCP Client
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
To use the server with an MCP client (like Claude Desktop or an IDE extension), configure it as follows:
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"mcpServers": {
|
|
15
|
+
"dodraw": {
|
|
16
|
+
"command": "npx",
|
|
17
|
+
"args": [
|
|
18
|
+
"-y",
|
|
19
|
+
"dodraw-mcp-server"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
20
24
|
```
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
On Windows, you might need to use `npx.cmd` if `npx` is not in your PATH or if you encounter issues:
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"dodraw": {
|
|
32
|
+
"command": "npx.cmd",
|
|
33
|
+
"args": [
|
|
34
|
+
"-y",
|
|
35
|
+
"dodraw-mcp-server"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
### Example Usage
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
Prompt to my agent:
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm login
|
|
31
|
-
```
|
|
45
|
+
"Using dodraw MCP server generate example of decision diagram of some real life situation"
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
"bin": {
|
|
37
|
-
"dodraw-mcp-server": "dist/src/index.js"
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
3. **Build the Project:**
|
|
42
|
-
Ensure the `dist` folder is up-to-date.
|
|
43
|
-
```bash
|
|
44
|
-
npm run build
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
4. **Publish:**
|
|
48
|
-
```bash
|
|
49
|
-
npm publish --access public
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 2. Via Source Code
|
|
53
|
-
|
|
54
|
-
1. Clone the repository.
|
|
55
|
-
2. Install dependencies: `npm install`.
|
|
56
|
-
3. Build: `npm run build`.
|
|
57
|
-
4. Configure your MCP Client (e.g., Claude Desktop) to point to the built file:
|
|
58
|
-
```json
|
|
59
|
-
"dodraw": {
|
|
60
|
-
"command": "node",
|
|
61
|
-
"args": ["/path/to/repo/mcp-server/dist/src/index.js"]
|
|
62
|
-
}
|
|
63
|
-
```
|
|
47
|
+
Agent response:
|
|
48
|
+

|
|
@@ -326,7 +326,7 @@ async function handleToolCall(name, args) {
|
|
|
326
326
|
state.nodes.push(newNode);
|
|
327
327
|
state.edges.push(newEdge);
|
|
328
328
|
await (0, fileHandler_1.saveDiagramFile)(args.filePath, state);
|
|
329
|
-
return { content: [{ type: "text", text: `Added node '${args.label}' to the ${args.direction} of '${sourceNode.label}' and connected them.` }] };
|
|
329
|
+
return { content: [{ type: "text", text: `Added node '${args.label}' (ID: ${newNodeId}) to the ${args.direction} of '${sourceNode.label}' and connected them.` }] };
|
|
330
330
|
}
|
|
331
331
|
case "add_edge": {
|
|
332
332
|
const state = await (0, fileHandler_1.readDiagramFile)(args.filePath);
|
package/image.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -344,7 +344,7 @@ export async function handleToolCall(name: string, args: any): Promise<any> {
|
|
|
344
344
|
state.edges.push(newEdge);
|
|
345
345
|
|
|
346
346
|
await saveDiagramFile(args.filePath, state);
|
|
347
|
-
return { content: [{ type: "text", text: `Added node '${args.label}' to the ${args.direction} of '${sourceNode.label}' and connected them.` }] };
|
|
347
|
+
return { content: [{ type: "text", text: `Added node '${args.label}' (ID: ${newNodeId}) to the ${args.direction} of '${sourceNode.label}' and connected them.` }] };
|
|
348
348
|
}
|
|
349
349
|
case "add_edge": {
|
|
350
350
|
const state = await readDiagramFile(args.filePath);
|