@modudraft/mcp 0.5.1 → 0.7.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.
- package/README.md +66 -9
- package/dist/index.js +1 -26052
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Model Context Protocol (MCP) server for [Modudraft](https://modudraft.com) — the system-design diagramming tool.
|
|
4
4
|
|
|
5
|
-
Connect your AI assistant (Claude, Cursor, Copilot, etc.) to your Modudraft diagrams and let it build and edit architecture, sequence, DB schema, and
|
|
5
|
+
Connect your AI assistant (Claude, Cursor, Copilot, etc.) to your Modudraft diagrams and let it build and edit architecture, sequence, DB schema, API, cloud, network, and data-flow diagrams for you.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -127,7 +127,7 @@ Copy the key — you'll only see it once.
|
|
|
127
127
|
### Cloud diagram
|
|
128
128
|
| Tool | Description |
|
|
129
129
|
|---|---|
|
|
130
|
-
| `add_cloud_resource` | Add a cloud resource (cluster, VPC, service, etc.) |
|
|
130
|
+
| `add_cloud_resource` | Add a cloud resource (cluster, VPC, service, database, queue, etc.) |
|
|
131
131
|
| `update_cloud_resource` | Rename or change the type of a cloud resource |
|
|
132
132
|
| `delete_cloud_resource` | Remove a cloud resource |
|
|
133
133
|
|
|
@@ -146,6 +146,44 @@ Copy the key — you'll only see it once.
|
|
|
146
146
|
| `delete_data_flow_stage` | Remove a data flow stage |
|
|
147
147
|
| `reorder_data_flow_stages` | Set the order of all stages in a data flow diagram |
|
|
148
148
|
|
|
149
|
+
### File import
|
|
150
|
+
| Tool | Description |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `scan_project` | Scan a directory and list all importable files (docker-compose, K8s, Terraform, SQL, Prisma, OpenAPI, etc.) |
|
|
153
|
+
| `read_file` | Read any file from the filesystem |
|
|
154
|
+
| `import_file` | Import a file into a diagram — auto-detects format |
|
|
155
|
+
|
|
156
|
+
**Supported import formats:**
|
|
157
|
+
- **Architecture:** `docker-compose.yml` → nodes + edges
|
|
158
|
+
- **Cloud:** Kubernetes YAML, Terraform `.tf`, AWS CloudFormation YAML/JSON
|
|
159
|
+
- **DB schema:** SQL DDL, `schema.prisma`, DBML, `schema.rb` (Rails), TypeORM entities, SQLAlchemy models, dbt `schema.yml`
|
|
160
|
+
- **API:** OpenAPI 2.x/3.x, GraphQL SDL, Protocol Buffers `.proto`, Postman collection, Insomnia export v4, AsyncAPI
|
|
161
|
+
- **Context (no diagram change):** `.env` files (sensitive values always redacted), `package.json`, `go.mod`, `requirements.txt`, `Gemfile`, `pom.xml`, `Cargo.toml`
|
|
162
|
+
|
|
163
|
+
### Export
|
|
164
|
+
| Tool | Description |
|
|
165
|
+
|---|---|
|
|
166
|
+
| `export_mermaid` | Export as Mermaid flowchart or ER diagram (paste into GitHub Markdown) |
|
|
167
|
+
| `export_plantuml` | Export as PlantUML component diagram |
|
|
168
|
+
| `export_drawio` | Export as draw.io / diagrams.net XML |
|
|
169
|
+
| `export_terraform` | Generate Terraform resource stubs from the cloud tab |
|
|
170
|
+
| `export_k8s_yaml` | Generate Kubernetes YAML manifests from the cloud tab |
|
|
171
|
+
| `export_to_file` | Write any export format directly to a local file |
|
|
172
|
+
|
|
173
|
+
### Validation & diff
|
|
174
|
+
| Tool | Description |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `validate_diagram` | Check a diagram for issues: dangling edges, orphaned nodes, FK integrity, missing PKs, duplicate routes, etc. |
|
|
177
|
+
| `diff_diagram` | Compare two diagrams and return a structured list of what changed (added/removed/modified) |
|
|
178
|
+
|
|
179
|
+
### Cross-diagram intelligence
|
|
180
|
+
| Tool | Description |
|
|
181
|
+
|---|---|
|
|
182
|
+
| `find_shared_services` | Find nodes that appear in multiple diagrams — useful for shared infrastructure audits |
|
|
183
|
+
| `suggest_connections` | Detect likely missing edges based on archetype pairs |
|
|
184
|
+
| `suggest_architecture` | Generate a suggested node/edge structure from a text description |
|
|
185
|
+
| `clone_diagram` | Deep-copy a diagram as a starting template |
|
|
186
|
+
|
|
149
187
|
### Discovery (static, no API call)
|
|
150
188
|
| Tool | Description |
|
|
151
189
|
|---|---|
|
|
@@ -153,10 +191,34 @@ Copy the key — you'll only see it once.
|
|
|
153
191
|
| `list_tools` | Available tech tools per archetype (postgresql, redis, kafka, etc.) |
|
|
154
192
|
| `list_protocols` | Valid edge protocol values |
|
|
155
193
|
|
|
194
|
+
### Org context
|
|
195
|
+
| Tool | Description |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `get_org_context` | Get cached org context — existing tools, protocols, naming patterns |
|
|
198
|
+
| `refresh_org_context` | Force a refresh of the org context cache |
|
|
199
|
+
|
|
156
200
|
---
|
|
157
201
|
|
|
158
202
|
## Example prompts
|
|
159
203
|
|
|
204
|
+
> "Scan my project at ~/code/myapp and import everything you find into diagram X."
|
|
205
|
+
|
|
206
|
+
> "Import our docker-compose.yml and create an architecture diagram."
|
|
207
|
+
|
|
208
|
+
> "Import schema.prisma and generate the DB schema tab."
|
|
209
|
+
|
|
210
|
+
> "Export the architecture as a Mermaid diagram and save it to ./docs/architecture.md."
|
|
211
|
+
|
|
212
|
+
> "Generate Terraform stubs for everything in the cloud tab and save to ./infra/main.tf."
|
|
213
|
+
|
|
214
|
+
> "Validate diagram X — are there any issues with the schema or missing connections?"
|
|
215
|
+
|
|
216
|
+
> "Compare diagram A and diagram B — what changed between the two designs?"
|
|
217
|
+
|
|
218
|
+
> "What services appear in more than one of our diagrams?"
|
|
219
|
+
|
|
220
|
+
> "Suggest an architecture for a checkout service with Stripe, Postgres, Redis, and an event queue."
|
|
221
|
+
|
|
160
222
|
> "Create a diagram of a typical e-commerce backend with a React frontend, API gateway, user service, product service, order service, PostgreSQL databases, Redis cache, and Kafka queue. Connect them and layout the diagram."
|
|
161
223
|
|
|
162
224
|
> "Add the DB schema for the order service — orders, order_items, and payments tables."
|
|
@@ -165,17 +227,11 @@ Copy the key — you'll only see it once.
|
|
|
165
227
|
|
|
166
228
|
> "What metadata is missing from the diagram nodes? Fill in the hosts and ports based on our .env file."
|
|
167
229
|
|
|
168
|
-
> "Add a data flow diagram showing how events move from our Kafka topics through a Flink transform into the data warehouse."
|
|
169
|
-
|
|
170
|
-
> "Draw the network topology — edge router, core switch, two firewalls, and the DMZ segment."
|
|
171
|
-
|
|
172
|
-
> "Wrap the retry loop in the checkout sequence in an alt fragment with condition 'payment fails'."
|
|
173
|
-
|
|
174
230
|
---
|
|
175
231
|
|
|
176
232
|
## How it works
|
|
177
233
|
|
|
178
|
-
Each tool call requires a `diagram_id`. The server reads the current diagram from the Modudraft API, applies the change in memory, and writes it back. Changes appear instantly in the Modudraft web app.
|
|
234
|
+
Each tool call requires a `diagram_id`. The server reads the current diagram from the Modudraft API, applies the change in memory, and writes it back — with a 150ms debounce batch so rapid sequential edits (add 10 nodes, add edges) result in a single API round trip. Changes appear instantly in the Modudraft web app.
|
|
179
235
|
|
|
180
236
|
The `get_diagram` response includes a `hints` array listing nodes with empty metadata fields so your AI assistant knows what context to ask you for.
|
|
181
237
|
|
|
@@ -186,6 +242,7 @@ The `get_diagram` response includes a `hints` array listing nodes with empty met
|
|
|
186
242
|
- API keys are hashed (SHA-256) server-side and never stored in plain text
|
|
187
243
|
- Keys can be revoked at any time from the dashboard
|
|
188
244
|
- All requests use HTTPS
|
|
245
|
+
- `.env` file imports redact all secrets — only topology metadata (host, port, database name, region) is ever extracted; passwords, tokens, and API keys are always replaced with `[REDACTED]`
|
|
189
246
|
|
|
190
247
|
---
|
|
191
248
|
|