@markdy/mcp-server 1.0.25 → 1.0.26
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 +139 -19
- package/dist/index.d.ts +14 -2
- package/dist/index.js +3326 -34
- package/package.json +27 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @markdy/mcp-server
|
|
2
2
|
|
|
3
|
-
Official **Model Context Protocol (MCP)** server for Markdy — the animated diagram-as-code DSL.
|
|
3
|
+
> Official **Model Context Protocol (MCP)** server for Markdy — the animated diagram-as-code DSL.
|
|
4
4
|
|
|
5
|
-
Equip Claude Desktop
|
|
5
|
+
Equip **Claude Desktop**, **Cursor**, **Google Antigravity**, **Windsurf**, and autonomous AI agents with tools to parse, validate, transpile, explain, and craft animated Markdy architecture diagrams.
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://markdy.com/agent/">
|
|
@@ -17,26 +17,32 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## ⚡ Key Capabilities
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
| Capability | Description |
|
|
23
|
+
| :--- | :--- |
|
|
24
|
+
| **🛠️ Tools** | Syntax validation with AI self-healing diagnostics, multi-format transpilation (Mermaid, Docker Compose, Kubernetes, Terraform, Draw.io), topology breakdown, and template retrieval. |
|
|
25
|
+
| **📦 Resources** | On-demand access to the canonical specification (`markdy://spec/agent-reference`), Well-Architected governance rules (`markdy://governance/rules`), and curated architecture templates (`markdy://templates/catalog`). |
|
|
26
|
+
| **💬 Prompts** | Pre-engineered prompt workflows (`create_architecture_diagram`, `audit_architecture`, `transpile_architecture`) that guide agents through structured diagram design. |
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
- Converts Mermaid, Docker Compose, Kubernetes manifests, or Terraform state into animated MarkdyScript scenes.
|
|
28
|
+
---
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
- Parses a MarkdyScript AST to output structural topology summaries, component role counts, and governance health.
|
|
30
|
+
## 🚀 Client Configuration
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
- Generates optimal system prompt constraints and instructions for LLMs.
|
|
32
|
+
### 1. Claude Desktop (`claude_desktop_config.json`)
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"markdy": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@markdy/mcp-server"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
38
44
|
|
|
39
|
-
###
|
|
45
|
+
### 2. Cursor (`.cursor/mcp.json`)
|
|
40
46
|
|
|
41
47
|
```json
|
|
42
48
|
{
|
|
@@ -49,7 +55,7 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
|
|
|
49
55
|
}
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
###
|
|
58
|
+
### 3. Google Antigravity (`~/.gemini/antigravity/mcp_config.json`)
|
|
53
59
|
|
|
54
60
|
```json
|
|
55
61
|
{
|
|
@@ -62,7 +68,7 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
|
|
|
62
68
|
}
|
|
63
69
|
```
|
|
64
70
|
|
|
65
|
-
###
|
|
71
|
+
### 4. Windsurf (`~/.codeium/windsurf/mcp_config.json`)
|
|
66
72
|
|
|
67
73
|
```json
|
|
68
74
|
{
|
|
@@ -75,9 +81,123 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
|
|
|
75
81
|
}
|
|
76
82
|
```
|
|
77
83
|
|
|
84
|
+
### 5. Zed (`settings.json`)
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"context_servers": {
|
|
89
|
+
"markdy": {
|
|
90
|
+
"command": {
|
|
91
|
+
"path": "npx",
|
|
92
|
+
"args": ["-y", "@markdy/mcp-server"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🛠️ Provided Tools
|
|
102
|
+
|
|
103
|
+
### 1. `validate_markdy_code`
|
|
104
|
+
Validates MarkdyScript syntax and verifies Well-Architected governance rules (layer boundaries, cycle detection, ingress gateway enforcement). Returns structured diagnostic suggestions and an AI healing prompt if parse errors occur.
|
|
105
|
+
|
|
106
|
+
#### Parameters
|
|
107
|
+
| Parameter | Type | Presence | Default | Description |
|
|
108
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
109
|
+
| `code` | `string` | **Required** | *None* | The complete MarkdyScript diagram code starting with `scene`. |
|
|
110
|
+
| `checkArchitecture` | `boolean` | Optional | `true` | When `true`, runs Well-Architected governance lint rules. |
|
|
111
|
+
|
|
112
|
+
#### Example Request
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"name": "validate_markdy_code",
|
|
116
|
+
"arguments": {
|
|
117
|
+
"code": "scene theme=paper layout=LR\nservice API\ndatabase DB\nbeat main:\n API -> DB \"query\"\n API <- DB \"200 OK\""
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### 2. `transpile_to_markdy`
|
|
125
|
+
Converts existing infrastructure definitions or diagrams into animated MarkdyScript scenes.
|
|
126
|
+
|
|
127
|
+
#### Parameters
|
|
128
|
+
| Parameter | Type | Presence | Allowed Values | Description |
|
|
129
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
130
|
+
| `source` | `string` | **Required** | *Raw code / markup* | Source code to transpile. |
|
|
131
|
+
| `format` | `string` | **Required** | `mermaid`, `docker-compose`, `k8s`, `terraform`, `drawio` | Format of the input source. |
|
|
132
|
+
| `title` | `string` | Optional | `"Imported Scene"` | Scene title rendered in the output diagram header. |
|
|
133
|
+
|
|
134
|
+
#### Example Request
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"name": "transpile_to_markdy",
|
|
138
|
+
"arguments": {
|
|
139
|
+
"format": "docker-compose",
|
|
140
|
+
"source": "version: '3'\nservices:\n web:\n image: nginx\n api:\n image: node-app",
|
|
141
|
+
"title": "Container Stack"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### 3. `explain_architecture`
|
|
149
|
+
Parses a MarkdyScript AST to output structural topology summaries, component role counts, and governance health metrics.
|
|
150
|
+
|
|
151
|
+
#### Parameters
|
|
152
|
+
| Parameter | Type | Presence | Description |
|
|
153
|
+
| :--- | :--- | :--- | :--- |
|
|
154
|
+
| `code` | `string` | **Required** | The MarkdyScript diagram code to inspect. |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### 4. `generate_markdy_prompt`
|
|
159
|
+
Generates optimal, hallucination-resistant LLM system prompts and grammar constraints tailored to a specific user goal.
|
|
160
|
+
|
|
161
|
+
#### Parameters
|
|
162
|
+
| Parameter | Type | Presence | Description |
|
|
163
|
+
| :--- | :--- | :--- | :--- |
|
|
164
|
+
| `userGoal` | `string` | **Required** | Description of the system or workflow to visualize. |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### 5. `get_architecture_catalog`
|
|
169
|
+
Returns production-grade golden architecture templates (Microservices, RAG, Kafka Event-Driven, K8s Ingress, GitOps CI/CD, OAuth2, HA Multi-Region, Flowcharts) with full runnable MarkdyScript source code.
|
|
170
|
+
|
|
171
|
+
#### Parameters
|
|
172
|
+
| Parameter | Type | Presence | Description |
|
|
173
|
+
| :--- | :--- | :--- | :--- |
|
|
174
|
+
| `filterCategory` | `string` | Optional | Filter string by category name (e.g. `'AI'`, `'Cloud'`, `'Security'`). |
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 📦 Provided Resources
|
|
179
|
+
|
|
180
|
+
AI agents can directly read these canonical context URIs via MCP:
|
|
181
|
+
|
|
182
|
+
| URI | MIME Type | Description |
|
|
183
|
+
| :--- | :--- | :--- |
|
|
184
|
+
| `markdy://spec/agent-reference` | `text/markdown` | Canonical MarkdyScript specification, node kinds, and cycle-prevention rules. |
|
|
185
|
+
| `markdy://templates/catalog` | `application/json` | Curated JSON catalog of all 8 golden architecture templates. |
|
|
186
|
+
| `markdy://governance/rules` | `application/json` | Well-Architected governance rules and lint presets. |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 💬 Provided Prompts
|
|
191
|
+
|
|
192
|
+
| Prompt | Arguments | Purpose |
|
|
193
|
+
| :--- | :--- | :--- |
|
|
194
|
+
| `create_architecture_diagram` | `userGoal` (req), `theme` (opt), `layout` (opt) | Guided workflow to design an animated Markdy architecture diagram from scratch. |
|
|
195
|
+
| `audit_architecture` | `code` (req) | Audits a MarkdyScript diagram against Well-Architected governance and cycle-safety rules. |
|
|
196
|
+
| `transpile_architecture` | `source` (req), `format` (req) | Guides migration of legacy diagrams or infra into animated MarkdyScript. |
|
|
197
|
+
|
|
78
198
|
---
|
|
79
199
|
|
|
80
|
-
## 📖
|
|
200
|
+
## 📖 Canonical References
|
|
81
201
|
|
|
82
202
|
- **Authoritative AI Agent Guide**: <https://markdy.com/AGENT.md>
|
|
83
203
|
- **Human Documentation**: <https://markdy.com/docs/>
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* packages/mcp-server/src/tools.ts
|
|
5
|
-
* MCP Tool definitions and
|
|
5
|
+
* MCP Tool definitions, Resource handlers, and Prompt workflows for Markdy.
|
|
6
6
|
*/
|
|
7
7
|
interface ToolResult {
|
|
8
8
|
[x: string]: unknown;
|
|
@@ -12,17 +12,29 @@ interface ToolResult {
|
|
|
12
12
|
}>;
|
|
13
13
|
isError?: boolean;
|
|
14
14
|
}
|
|
15
|
+
interface ResourceResult {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
contents: Array<{
|
|
18
|
+
uri: string;
|
|
19
|
+
mimeType?: string;
|
|
20
|
+
text: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
15
23
|
declare function handleValidateMarkdy(code: string, checkArchitecture?: boolean): ToolResult;
|
|
16
24
|
declare function handleTranspileToMarkdy(source: string, format: "mermaid" | "docker-compose" | "k8s" | "terraform" | "drawio", title?: string): Promise<ToolResult>;
|
|
17
25
|
declare function handleExplainArchitecture(code: string): ToolResult;
|
|
18
26
|
declare function handleGenerateMarkdyPrompt(userGoal: string): ToolResult;
|
|
27
|
+
declare function handleGetArchitectureCatalog(filterCategory?: string): ToolResult;
|
|
28
|
+
declare function handleReadResource(uri: string): ResourceResult;
|
|
19
29
|
|
|
20
30
|
/**
|
|
21
31
|
* packages/mcp-server/src/index.ts
|
|
22
32
|
* MCP Server for Markdy Diagram Engine.
|
|
33
|
+
* Supports Tools, Resources, and Prompts for Claude Desktop, Cursor, Antigravity, and autonomous agents.
|
|
23
34
|
*/
|
|
24
35
|
|
|
36
|
+
declare const MCP_SERVER_VERSION = "1.0.25";
|
|
25
37
|
declare function createMarkdyMcpServer(): Server;
|
|
26
38
|
declare function startMcpServer(): Promise<void>;
|
|
27
39
|
|
|
28
|
-
export { createMarkdyMcpServer, handleExplainArchitecture, handleGenerateMarkdyPrompt, handleTranspileToMarkdy, handleValidateMarkdy, startMcpServer };
|
|
40
|
+
export { MCP_SERVER_VERSION, createMarkdyMcpServer, handleExplainArchitecture, handleGenerateMarkdyPrompt, handleGetArchitectureCatalog, handleReadResource, handleTranspileToMarkdy, handleValidateMarkdy, startMcpServer };
|