@dforge-core/dforge-mcp 0.1.0-rc.1

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 ADDED
@@ -0,0 +1,119 @@
1
+ # @dforge-core/dforge-mcp
2
+
3
+ MCP server for dForge module authoring. Exposes scaffold / pack / install
4
+ tools and schema resources so AI agents (Claude Code, Cursor, Zed, etc.)
5
+ can create and ship dForge modules through structured tool calls instead
6
+ of free-form JSON generation.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ # As an MCP server invoked by an AI editor — usually no install needed,
12
+ # the editor runs it via npx on demand. See "Wiring it up" below.
13
+
14
+ # Local install (for development / debugging):
15
+ npm install -g @dforge-core/dforge-mcp
16
+ dforge-mcp # speaks JSON-RPC over stdio; ctrl+C to quit
17
+ ```
18
+
19
+ ## Wiring it up
20
+
21
+ ### Claude Code
22
+
23
+ Add to `~/.claude/config.json` (or the project-local `.claude/mcp.json`):
24
+
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "dforge": {
29
+ "command": "npx",
30
+ "args": ["-y", "@dforge-core/dforge-mcp"],
31
+ "env": {
32
+ "DFORGE_CLI_BINARY": "/optional/path/to/dForge.Cli"
33
+ }
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ `DFORGE_CLI_BINARY` is only needed if you want `dforge_module_pack` /
40
+ `dforge_module_install` to use a non-published native binary (e.g. a
41
+ local C# build). Otherwise the server uses whatever `dforge-cli` is on
42
+ PATH (install via `npm install -g @dforge-core/dforge-cli`).
43
+
44
+ ### Cursor / Zed
45
+
46
+ Same shape — both editors take a `command + args` MCP config. Refer to
47
+ their docs for the exact file path.
48
+
49
+ ## What it exposes
50
+
51
+ ### Tools
52
+
53
+ | Tool | Behavior |
54
+ |---|---|
55
+ | `dforge_module_create` | Returns a file map for a new module. Client writes the files. |
56
+ | `dforge_entity_add` | Reads an existing module, returns the updated file map (manifest + new entity + regenerated UI/security). |
57
+ | `dforge_module_pack` | Shells to `dforge-cli module pack`. Returns tarball path + size. |
58
+ | `dforge_module_install` | Shells to `dforge-cli module install`. Returns CLI output. |
59
+ | `dforge_dbml_import` | Stub. Returns "not yet implemented" until the underlying CLI command lands. |
60
+
61
+ The `create` and `entity_add` tools deliberately **return** instead of writing — the LLM previews the file map with the user before commit.
62
+
63
+ ### Resources
64
+
65
+ | URI | Content |
66
+ |---|---|
67
+ | `dforge://schema/manifest` | JSON Schema for manifest.json |
68
+ | `dforge://schema/entity` | JSON Schema for entity files |
69
+ | `dforge://schema/data-view` | JSON Schema for ui/data_views.json |
70
+ | `dforge://docs/conventions` | MODULE_CONVENTIONS.md from dForge-core |
71
+
72
+ The schemas + conventions doc are vendored at build time from
73
+ `dForge-core/docs/`. Refresh with `scripts/vendor-resources.sh`.
74
+
75
+ ## Claude Skill
76
+
77
+ `skills/dforge-mcp-author/SKILL.md` is a Skill file that teaches Claude
78
+ how to drive the tools — gather requirements → preview → write → iterate.
79
+ Copy it into your `~/.claude/skills/` (or per-project `.claude/skills/`)
80
+ to enable.
81
+
82
+ ## For maintainers
83
+
84
+ ### Local development
85
+
86
+ ```bash
87
+ pnpm install
88
+ pnpm build # tsup → dist/server.js
89
+ pnpm typecheck # tsc --noEmit
90
+ node dist/server.js # smoke-test via stdio JSON-RPC
91
+ ```
92
+
93
+ The `@dforge-core/dforge-cli` dep is currently pinned to a `file:`
94
+ sibling path so this repo can be developed alongside `dforge-cli`. Before
95
+ publishing, change to a real npm version (`^0.1.0-rc.5` or higher — the
96
+ first version that exposes the `templates` subpath export).
97
+
98
+ ### Refresh vendored resources
99
+
100
+ When `dForge-core/docs/schemas/` or `MODULE_CONVENTIONS.md` change:
101
+
102
+ ```bash
103
+ scripts/vendor-resources.sh # auto-locate ../dForge-core
104
+ DFORGE_CORE=/abs/path/to/dForge-core scripts/vendor-resources.sh
105
+ ```
106
+
107
+ ### Publishing to npm
108
+
109
+ (Same approach as dforge-cli — `prepublishOnly` runs tsup so the
110
+ published tarball gets a fresh `dist/server.js`. No platform binaries to
111
+ manage, so a single `npm publish` covers it.)
112
+
113
+ ```bash
114
+ npm publish --access public --tag next
115
+ ```
116
+
117
+ ## License
118
+
119
+ MIT.