@markdy/mcp-server 1.0.24 → 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 CHANGED
@@ -1,35 +1,48 @@
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, Cursor, Google Antigravity, and autonomous AI agents with tools to parse, validate, transpile, explain, and craft animated Markdy architecture diagrams.
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
- <img src="https://raw.githubusercontent.com/HoangYell/markdy-com/main/website/public/images/markdy-ai-agent-workflow.webp" alt="Markdy AI Agent & MCP Integration" width="900" />
8
+ <a href="https://markdy.com/agent/">
9
+ <img src="https://raw.githubusercontent.com/HoangYell/markdy-com/main/website/public/images/markdy-ai-agent-workflow.webp" alt="Markdy AI Agent & MCP Integration" width="900" />
10
+ </a>
11
+ </p>
12
+ <p align="center">
13
+ <a href="https://markdy.com/playground/">
14
+ <img src="https://raw.githubusercontent.com/HoangYell/markdy-com/main/website/public/images/scene-oauth-pkce-sequence.webp" alt="Markdy AI-Generated OAuth Sequence Preview" width="900" />
15
+ </a>
9
16
  </p>
10
17
 
11
18
  ---
12
19
 
13
- ## 🛠️ Provided Tools
20
+ ## Key Capabilities
14
21
 
15
- 1. `validate_markdy_code`
16
- - Validates syntax and executes Well-Architected governance rules (layer boundaries, cycle detection, gateway checks).
17
- - Generates structured diagnostic hints and AI repair prompts.
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. |
18
27
 
19
- 2. `transpile_to_markdy`
20
- - Converts Mermaid, Docker Compose, Kubernetes manifests, or Terraform state into animated MarkdyScript scenes.
28
+ ---
21
29
 
22
- 3. `explain_architecture`
23
- - Parses a MarkdyScript AST to output structural topology summaries, component role counts, and governance health.
30
+ ## 🚀 Client Configuration
24
31
 
25
- 4. `generate_markdy_prompt`
26
- - Generates optimal system prompt constraints and instructions for LLMs.
32
+ ### 1. Claude Desktop (`claude_desktop_config.json`)
27
33
 
28
- ---
29
-
30
- ## 🚀 Configuration
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "markdy": {
38
+ "command": "npx",
39
+ "args": ["-y", "@markdy/mcp-server"]
40
+ }
41
+ }
42
+ }
43
+ ```
31
44
 
32
- ### Claude Desktop (`claude_desktop_config.json`)
45
+ ### 2. Cursor (`.cursor/mcp.json`)
33
46
 
34
47
  ```json
35
48
  {
@@ -42,7 +55,7 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
42
55
  }
43
56
  ```
44
57
 
45
- ### Cursor (`.cursor/mcp.json`)
58
+ ### 3. Google Antigravity (`~/.gemini/antigravity/mcp_config.json`)
46
59
 
47
60
  ```json
48
61
  {
@@ -55,7 +68,7 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
55
68
  }
56
69
  ```
57
70
 
58
- ### Google Antigravity (`~/.gemini/antigravity/mcp_config.json`)
71
+ ### 4. Windsurf (`~/.codeium/windsurf/mcp_config.json`)
59
72
 
60
73
  ```json
61
74
  {
@@ -68,9 +81,123 @@ Equip Claude Desktop, Cursor, Google Antigravity, and autonomous AI agents with
68
81
  }
69
82
  ```
70
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
+
71
198
  ---
72
199
 
73
- ## 📖 Documentation & References
200
+ ## 📖 Canonical References
74
201
 
75
202
  - **Authoritative AI Agent Guide**: <https://markdy.com/AGENT.md>
76
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 execution handlers for Markdy.
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 };