@domphy/mcp 0.10.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/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/chunk-QJ7O62KB.js +54 -0
- package/dist/chunk-QJ7O62KB.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +26 -0
- package/dist/tools.js +17 -0
- package/dist/tools.js.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Huu Khanh Nguyen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @domphy/mcp
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server that gives MCP-capable AI agents (Claude Desktop, Cursor, …) first-class access to Domphy — so they can look up the real API and validate their own output instead of guessing.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Does |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `domphy_list_patches` | every `@domphy/ui` patch with host tag + signature |
|
|
10
|
+
| `domphy_get_patch` | one patch's full contract (host tag, signature, doc, source) |
|
|
11
|
+
| `domphy_list_packages` | all `@domphy/*` packages with versions + descriptions |
|
|
12
|
+
| `domphy_rules` | the Domphy code-generation rules (`llms.txt`) |
|
|
13
|
+
| `domphy_diagnose` | run [`@domphy/doctor`](https://www.domphy.com/docs/doctor/) on a JSON element tree and return issues to fix |
|
|
14
|
+
|
|
15
|
+
Patch/package data is fetched live from `domphy.com` (always current with the latest release); `domphy_diagnose` runs locally.
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
### Claude Desktop / Claude Code
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"domphy": { "command": "npx", "args": ["-y", "@domphy/mcp"] }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Cursor
|
|
30
|
+
|
|
31
|
+
Add to `.cursor/mcp.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "mcpServers": { "domphy": { "command": "npx", "args": ["-y", "@domphy/mcp"] } } }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Once connected, the agent can call `domphy_get_patch`/`domphy_rules` before writing code and `domphy_diagnose` after — the self-correction loop that lets it write correct Domphy despite thin training data.
|
|
38
|
+
|
|
39
|
+
Set `DOMPHY_ORIGIN` to point at a different docs origin (e.g. a preview deploy).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/tools.ts
|
|
2
|
+
import { diagnose, format } from "@domphy/doctor";
|
|
3
|
+
var ORIGIN = process.env.DOMPHY_ORIGIN ?? "https://www.domphy.com";
|
|
4
|
+
var cache = null;
|
|
5
|
+
async function loadManifest() {
|
|
6
|
+
if (cache) return cache;
|
|
7
|
+
const res = await fetch(`${ORIGIN}/manifest.json`);
|
|
8
|
+
if (!res.ok) throw new Error(`Failed to fetch manifest: ${res.status}`);
|
|
9
|
+
cache = await res.json();
|
|
10
|
+
return cache;
|
|
11
|
+
}
|
|
12
|
+
async function listPatches() {
|
|
13
|
+
const m = await loadManifest();
|
|
14
|
+
return m.patches.map(
|
|
15
|
+
(p) => `${p.name}${p.hostTag ? ` <${p.hostTag}>` : ""} \u2014 ${p.signature}`
|
|
16
|
+
).join("\n");
|
|
17
|
+
}
|
|
18
|
+
async function getPatch(name) {
|
|
19
|
+
const m = await loadManifest();
|
|
20
|
+
const patch = m.patches.find((p) => p.name === name);
|
|
21
|
+
if (!patch) {
|
|
22
|
+
const near = m.patches.filter((p) => p.name.includes(name) || name.includes(p.name)).map((p) => p.name);
|
|
23
|
+
return `No patch named "${name}".${near.length ? ` Did you mean: ${near.join(", ")}?` : ""}`;
|
|
24
|
+
}
|
|
25
|
+
return JSON.stringify(patch, null, 2);
|
|
26
|
+
}
|
|
27
|
+
async function listPackages() {
|
|
28
|
+
const m = await loadManifest();
|
|
29
|
+
return m.packages.map((p) => `${p.name}@${p.version} \u2014 ${p.description}`).join("\n");
|
|
30
|
+
}
|
|
31
|
+
async function getRules() {
|
|
32
|
+
const res = await fetch(`${ORIGIN}/llms.txt`);
|
|
33
|
+
if (!res.ok) throw new Error(`Failed to fetch rules: ${res.status}`);
|
|
34
|
+
return res.text();
|
|
35
|
+
}
|
|
36
|
+
function diagnoseTree(elementJson) {
|
|
37
|
+
let tree;
|
|
38
|
+
try {
|
|
39
|
+
tree = JSON.parse(elementJson);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return `Invalid JSON: ${error.message}`;
|
|
42
|
+
}
|
|
43
|
+
return format(diagnose(tree));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
loadManifest,
|
|
48
|
+
listPatches,
|
|
49
|
+
getPatch,
|
|
50
|
+
listPackages,
|
|
51
|
+
getRules,
|
|
52
|
+
diagnoseTree
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-QJ7O62KB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools.ts"],"sourcesContent":["import { diagnose, format } from \"@domphy/doctor\";\n\n/**\n * Pure tool implementations for the Domphy MCP server. Kept transport-free so\n * they are unit-testable. The server (index.ts) wires these to MCP requests.\n */\n\nconst ORIGIN = process.env.DOMPHY_ORIGIN ?? \"https://www.domphy.com\";\n\ninterface Manifest {\n version: string;\n packages: Array<{\n name: string;\n version: string;\n description: string;\n subpaths: string[];\n peerDependencies: string[];\n }>;\n patches: Array<{\n name: string;\n hostTag: string | null;\n signature: string;\n doc: string;\n source: string;\n }>;\n}\n\nlet cache: Manifest | null = null;\n\nexport async function loadManifest(): Promise<Manifest> {\n if (cache) return cache;\n const res = await fetch(`${ORIGIN}/manifest.json`);\n if (!res.ok) throw new Error(`Failed to fetch manifest: ${res.status}`);\n cache = (await res.json()) as Manifest;\n return cache;\n}\n\nexport async function listPatches(): Promise<string> {\n const m = await loadManifest();\n return m.patches\n .map(\n (p) => `${p.name}${p.hostTag ? ` <${p.hostTag}>` : \"\"} — ${p.signature}`,\n )\n .join(\"\\n\");\n}\n\nexport async function getPatch(name: string): Promise<string> {\n const m = await loadManifest();\n const patch = m.patches.find((p) => p.name === name);\n if (!patch) {\n const near = m.patches\n .filter((p) => p.name.includes(name) || name.includes(p.name))\n .map((p) => p.name);\n return `No patch named \"${name}\".${near.length ? ` Did you mean: ${near.join(\", \")}?` : \"\"}`;\n }\n return JSON.stringify(patch, null, 2);\n}\n\nexport async function listPackages(): Promise<string> {\n const m = await loadManifest();\n return m.packages\n .map((p) => `${p.name}@${p.version} — ${p.description}`)\n .join(\"\\n\");\n}\n\nexport async function getRules(): Promise<string> {\n const res = await fetch(`${ORIGIN}/llms.txt`);\n if (!res.ok) throw new Error(`Failed to fetch rules: ${res.status}`);\n return res.text();\n}\n\n/** Runs @domphy/doctor on a JSON element tree (static parts only). */\nexport function diagnoseTree(elementJson: string): string {\n let tree: unknown;\n try {\n tree = JSON.parse(elementJson);\n } catch (error) {\n return `Invalid JSON: ${(error as Error).message}`;\n }\n return format(diagnose(tree));\n}\n"],"mappings":";AAAA,SAAS,UAAU,cAAc;AAOjC,IAAM,SAAS,QAAQ,IAAI,iBAAiB;AAoB5C,IAAI,QAAyB;AAE7B,eAAsB,eAAkC;AACtD,MAAI,MAAO,QAAO;AAClB,QAAM,MAAM,MAAM,MAAM,GAAG,MAAM,gBAAgB;AACjD,MAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,6BAA6B,IAAI,MAAM,EAAE;AACtE,UAAS,MAAM,IAAI,KAAK;AACxB,SAAO;AACT;AAEA,eAAsB,cAA+B;AACnD,QAAM,IAAI,MAAM,aAAa;AAC7B,SAAO,EAAE,QACN;AAAA,IACC,CAAC,MAAM,GAAG,EAAE,IAAI,GAAG,EAAE,UAAU,KAAK,EAAE,OAAO,MAAM,EAAE,WAAM,EAAE,SAAS;AAAA,EACxE,EACC,KAAK,IAAI;AACd;AAEA,eAAsB,SAAS,MAA+B;AAC5D,QAAM,IAAI,MAAM,aAAa;AAC7B,QAAM,QAAQ,EAAE,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AACnD,MAAI,CAAC,OAAO;AACV,UAAM,OAAO,EAAE,QACZ,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,IAAI,CAAC,EAC5D,IAAI,CAAC,MAAM,EAAE,IAAI;AACpB,WAAO,mBAAmB,IAAI,KAAK,KAAK,SAAS,kBAAkB,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE;AAAA,EAC5F;AACA,SAAO,KAAK,UAAU,OAAO,MAAM,CAAC;AACtC;AAEA,eAAsB,eAAgC;AACpD,QAAM,IAAI,MAAM,aAAa;AAC7B,SAAO,EAAE,SACN,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,EAAE,OAAO,WAAM,EAAE,WAAW,EAAE,EACtD,KAAK,IAAI;AACd;AAEA,eAAsB,WAA4B;AAChD,QAAM,MAAM,MAAM,MAAM,GAAG,MAAM,WAAW;AAC5C,MAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,0BAA0B,IAAI,MAAM,EAAE;AACnE,SAAO,IAAI,KAAK;AAClB;AAGO,SAAS,aAAa,aAA6B;AACxD,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,MAAM,WAAW;AAAA,EAC/B,SAAS,OAAO;AACd,WAAO,iBAAkB,MAAgB,OAAO;AAAA,EAClD;AACA,SAAO,OAAO,SAAS,IAAI,CAAC;AAC9B;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
diagnoseTree,
|
|
4
|
+
getPatch,
|
|
5
|
+
getRules,
|
|
6
|
+
listPackages,
|
|
7
|
+
listPatches
|
|
8
|
+
} from "./chunk-QJ7O62KB.js";
|
|
9
|
+
|
|
10
|
+
// src/index.ts
|
|
11
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
12
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
+
import {
|
|
14
|
+
CallToolRequestSchema,
|
|
15
|
+
ListToolsRequestSchema
|
|
16
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
17
|
+
var server = new Server(
|
|
18
|
+
{ name: "domphy", version: "0.10.0" },
|
|
19
|
+
{ capabilities: { tools: {} } }
|
|
20
|
+
);
|
|
21
|
+
var tools = [
|
|
22
|
+
{
|
|
23
|
+
name: "domphy_list_patches",
|
|
24
|
+
description: "List every @domphy/ui patch with its host tag and signature.",
|
|
25
|
+
inputSchema: { type: "object", properties: {} }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "domphy_get_patch",
|
|
29
|
+
description: "Get one patch's full contract (host tag, signature, doc, source).",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
name: { type: "string", description: "patch name, e.g. button" }
|
|
34
|
+
},
|
|
35
|
+
required: ["name"]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "domphy_list_packages",
|
|
40
|
+
description: "List all @domphy/* packages with versions and descriptions.",
|
|
41
|
+
inputSchema: { type: "object", properties: {} }
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "domphy_rules",
|
|
45
|
+
description: "Get the Domphy code-generation rules (llms.txt) to follow.",
|
|
46
|
+
inputSchema: { type: "object", properties: {} }
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "domphy_diagnose",
|
|
50
|
+
description: "Run @domphy/doctor on a JSON Domphy element tree and return issues to fix (inline-typography, void-content, unknown-tag, \u2026).",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: {
|
|
54
|
+
element: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "JSON of the Domphy element tree"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
required: ["element"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
64
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
65
|
+
const { name } = request.params;
|
|
66
|
+
const args = request.params.arguments ?? {};
|
|
67
|
+
let text;
|
|
68
|
+
try {
|
|
69
|
+
switch (name) {
|
|
70
|
+
case "domphy_list_patches":
|
|
71
|
+
text = await listPatches();
|
|
72
|
+
break;
|
|
73
|
+
case "domphy_get_patch":
|
|
74
|
+
text = await getPatch(String(args.name));
|
|
75
|
+
break;
|
|
76
|
+
case "domphy_list_packages":
|
|
77
|
+
text = await listPackages();
|
|
78
|
+
break;
|
|
79
|
+
case "domphy_rules":
|
|
80
|
+
text = await getRules();
|
|
81
|
+
break;
|
|
82
|
+
case "domphy_diagnose":
|
|
83
|
+
text = diagnoseTree(String(args.element));
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
text = `Unknown tool: ${name}`;
|
|
87
|
+
}
|
|
88
|
+
} catch (error) {
|
|
89
|
+
text = `Error: ${error.message}`;
|
|
90
|
+
}
|
|
91
|
+
return { content: [{ type: "text", text }] };
|
|
92
|
+
});
|
|
93
|
+
await server.connect(new StdioServerTransport());
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n diagnoseTree,\n getPatch,\n getRules,\n listPackages,\n listPatches,\n} from \"./tools.js\";\n\nconst server = new Server(\n { name: \"domphy\", version: \"0.10.0\" },\n { capabilities: { tools: {} } },\n);\n\nconst tools = [\n {\n name: \"domphy_list_patches\",\n description: \"List every @domphy/ui patch with its host tag and signature.\",\n inputSchema: { type: \"object\", properties: {} },\n },\n {\n name: \"domphy_get_patch\",\n description:\n \"Get one patch's full contract (host tag, signature, doc, source).\",\n inputSchema: {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"patch name, e.g. button\" },\n },\n required: [\"name\"],\n },\n },\n {\n name: \"domphy_list_packages\",\n description: \"List all @domphy/* packages with versions and descriptions.\",\n inputSchema: { type: \"object\", properties: {} },\n },\n {\n name: \"domphy_rules\",\n description: \"Get the Domphy code-generation rules (llms.txt) to follow.\",\n inputSchema: { type: \"object\", properties: {} },\n },\n {\n name: \"domphy_diagnose\",\n description:\n \"Run @domphy/doctor on a JSON Domphy element tree and return issues to fix (inline-typography, void-content, unknown-tag, …).\",\n inputSchema: {\n type: \"object\",\n properties: {\n element: {\n type: \"string\",\n description: \"JSON of the Domphy element tree\",\n },\n },\n required: [\"element\"],\n },\n },\n];\n\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));\n\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name } = request.params;\n const args = (request.params.arguments ?? {}) as Record<string, unknown>;\n let text: string;\n try {\n switch (name) {\n case \"domphy_list_patches\":\n text = await listPatches();\n break;\n case \"domphy_get_patch\":\n text = await getPatch(String(args.name));\n break;\n case \"domphy_list_packages\":\n text = await listPackages();\n break;\n case \"domphy_rules\":\n text = await getRules();\n break;\n case \"domphy_diagnose\":\n text = diagnoseTree(String(args.element));\n break;\n default:\n text = `Unknown tool: ${name}`;\n }\n } catch (error) {\n text = `Error: ${(error as Error).message}`;\n }\n return { content: [{ type: \"text\", text }] };\n});\n\nawait server.connect(new StdioServerTransport());\n"],"mappings":";;;;;;;;;;AACA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP,IAAM,SAAS,IAAI;AAAA,EACjB,EAAE,MAAM,UAAU,SAAS,SAAS;AAAA,EACpC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,EAAE;AAChC;AAEA,IAAM,QAAQ;AAAA,EACZ;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa,EAAE,MAAM,UAAU,YAAY,CAAC,EAAE;AAAA,EAChD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IACF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM,EAAE,MAAM,UAAU,aAAa,0BAA0B;AAAA,MACjE;AAAA,MACA,UAAU,CAAC,MAAM;AAAA,IACnB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa,EAAE,MAAM,UAAU,YAAY,CAAC,EAAE;AAAA,EAChD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa,EAAE,MAAM,UAAU,YAAY,CAAC,EAAE;AAAA,EAChD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IACF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,SAAS;AAAA,UACP,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,SAAS;AAAA,IACtB;AAAA,EACF;AACF;AAEA,OAAO,kBAAkB,wBAAwB,aAAa,EAAE,MAAM,EAAE;AAExE,OAAO,kBAAkB,uBAAuB,OAAO,YAAY;AACjE,QAAM,EAAE,KAAK,IAAI,QAAQ;AACzB,QAAM,OAAQ,QAAQ,OAAO,aAAa,CAAC;AAC3C,MAAI;AACJ,MAAI;AACF,YAAQ,MAAM;AAAA,MACZ,KAAK;AACH,eAAO,MAAM,YAAY;AACzB;AAAA,MACF,KAAK;AACH,eAAO,MAAM,SAAS,OAAO,KAAK,IAAI,CAAC;AACvC;AAAA,MACF,KAAK;AACH,eAAO,MAAM,aAAa;AAC1B;AAAA,MACF,KAAK;AACH,eAAO,MAAM,SAAS;AACtB;AAAA,MACF,KAAK;AACH,eAAO,aAAa,OAAO,KAAK,OAAO,CAAC;AACxC;AAAA,MACF;AACE,eAAO,iBAAiB,IAAI;AAAA,IAChC;AAAA,EACF,SAAS,OAAO;AACd,WAAO,UAAW,MAAgB,OAAO;AAAA,EAC3C;AACA,SAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,KAAK,CAAC,EAAE;AAC7C,CAAC;AAED,MAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;","names":[]}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface Manifest {
|
|
2
|
+
version: string;
|
|
3
|
+
packages: Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
description: string;
|
|
7
|
+
subpaths: string[];
|
|
8
|
+
peerDependencies: string[];
|
|
9
|
+
}>;
|
|
10
|
+
patches: Array<{
|
|
11
|
+
name: string;
|
|
12
|
+
hostTag: string | null;
|
|
13
|
+
signature: string;
|
|
14
|
+
doc: string;
|
|
15
|
+
source: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
declare function loadManifest(): Promise<Manifest>;
|
|
19
|
+
declare function listPatches(): Promise<string>;
|
|
20
|
+
declare function getPatch(name: string): Promise<string>;
|
|
21
|
+
declare function listPackages(): Promise<string>;
|
|
22
|
+
declare function getRules(): Promise<string>;
|
|
23
|
+
/** Runs @domphy/doctor on a JSON element tree (static parts only). */
|
|
24
|
+
declare function diagnoseTree(elementJson: string): string;
|
|
25
|
+
|
|
26
|
+
export { diagnoseTree, getPatch, getRules, listPackages, listPatches, loadManifest };
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
diagnoseTree,
|
|
3
|
+
getPatch,
|
|
4
|
+
getRules,
|
|
5
|
+
listPackages,
|
|
6
|
+
listPatches,
|
|
7
|
+
loadManifest
|
|
8
|
+
} from "./chunk-QJ7O62KB.js";
|
|
9
|
+
export {
|
|
10
|
+
diagnoseTree,
|
|
11
|
+
getPatch,
|
|
12
|
+
getRules,
|
|
13
|
+
listPackages,
|
|
14
|
+
listPatches,
|
|
15
|
+
loadManifest
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@domphy/mcp",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "Domphy MCP server - exposes patches, packages, rules, and the doctor to MCP-capable AI agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"domphy-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"./tools": {
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./dist/tools.d.ts",
|
|
21
|
+
"default": "./dist/tools.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"domphy",
|
|
27
|
+
"mcp",
|
|
28
|
+
"ai",
|
|
29
|
+
"model-context-protocol"
|
|
30
|
+
],
|
|
31
|
+
"author": "Huu Khanh Nguyen",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/domphy/domphy.git",
|
|
36
|
+
"directory": "packages/mcp"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
40
|
+
"@domphy/doctor": "^0.10.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@domphy/core": "^0.10.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^25.9.2",
|
|
47
|
+
"tsup": "^8.5.0",
|
|
48
|
+
"typescript": "^5.8.3",
|
|
49
|
+
"vitest": "^4.0.18",
|
|
50
|
+
"@domphy/core": "0.10.0"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"README.md"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsup --watch",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest"
|
|
61
|
+
}
|
|
62
|
+
}
|