@macroforge/mcp-server 0.1.17
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/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/docs-loader.d.ts +30 -0
- package/dist/tools/docs-loader.d.ts.map +1 -0
- package/dist/tools/docs-loader.js +112 -0
- package/dist/tools/docs-loader.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +348 -0
- package/dist/tools/index.js.map +1 -0
- package/docs/api/api-overview.md +75 -0
- package/docs/api/expand-sync.md +121 -0
- package/docs/api/native-plugin.md +106 -0
- package/docs/api/position-mapper.md +127 -0
- package/docs/api/transform-sync.md +98 -0
- package/docs/builtin-macros/clone.md +180 -0
- package/docs/builtin-macros/debug.md +222 -0
- package/docs/builtin-macros/default.md +192 -0
- package/docs/builtin-macros/deserialize.md +662 -0
- package/docs/builtin-macros/hash.md +205 -0
- package/docs/builtin-macros/macros-overview.md +169 -0
- package/docs/builtin-macros/ord.md +258 -0
- package/docs/builtin-macros/partial-eq.md +306 -0
- package/docs/builtin-macros/partial-ord.md +268 -0
- package/docs/builtin-macros/serialize.md +321 -0
- package/docs/concepts/architecture.md +139 -0
- package/docs/concepts/derive-system.md +173 -0
- package/docs/concepts/how-macros-work.md +124 -0
- package/docs/custom-macros/custom-overview.md +84 -0
- package/docs/custom-macros/rust-setup.md +146 -0
- package/docs/custom-macros/ts-macro-derive.md +307 -0
- package/docs/custom-macros/ts-quote.md +696 -0
- package/docs/getting-started/first-macro.md +120 -0
- package/docs/getting-started/installation.md +110 -0
- package/docs/integration/cli.md +207 -0
- package/docs/integration/configuration.md +116 -0
- package/docs/integration/integration-overview.md +51 -0
- package/docs/integration/typescript-plugin.md +96 -0
- package/docs/integration/vite-plugin.md +126 -0
- package/docs/language-servers/ls-overview.md +47 -0
- package/docs/language-servers/svelte-ls.md +80 -0
- package/docs/language-servers/zed-extensions.md +84 -0
- package/docs/sections.json +258 -0
- package/package.json +48 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Vite Plugin
|
|
2
|
+
|
|
3
|
+
*The Vite plugin provides build-time macro expansion, transforming your code during development and production builds.*
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @macroforge/vite-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
Add the plugin to your `vite.config.ts`:
|
|
14
|
+
|
|
15
|
+
`vite.config.ts`
|
|
16
|
+
```typescript
|
|
17
|
+
import macroforge from "@macroforge/vite-plugin";
|
|
18
|
+
import { defineConfig } from "vite";
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [
|
|
22
|
+
macroforge()
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
macroforge({
|
|
31
|
+
// Generate .d.ts files for expanded code
|
|
32
|
+
generateTypes: true,
|
|
33
|
+
|
|
34
|
+
// Output directory for generated types
|
|
35
|
+
typesOutputDir: ".macroforge/types",
|
|
36
|
+
|
|
37
|
+
// Emit metadata files for debugging
|
|
38
|
+
emitMetadata: false,
|
|
39
|
+
|
|
40
|
+
// Keep @derive decorators in output (for debugging)
|
|
41
|
+
keepDecorators: false,
|
|
42
|
+
|
|
43
|
+
// File patterns to process
|
|
44
|
+
include: ["**/*.ts", "**/*.tsx"],
|
|
45
|
+
exclude: ["node_modules/**"]
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Option Reference
|
|
50
|
+
|
|
51
|
+
| `generateTypes`
|
|
52
|
+
| `boolean`
|
|
53
|
+
| `true`
|
|
54
|
+
| Generate .d.ts files
|
|
55
|
+
|
|
56
|
+
| `typesOutputDir`
|
|
57
|
+
| `string`
|
|
58
|
+
| `.macroforge/types`
|
|
59
|
+
| Where to write type files
|
|
60
|
+
|
|
61
|
+
| `emitMetadata`
|
|
62
|
+
| `boolean`
|
|
63
|
+
| `false`
|
|
64
|
+
| Emit macro metadata files
|
|
65
|
+
|
|
66
|
+
| `keepDecorators`
|
|
67
|
+
| `boolean`
|
|
68
|
+
| `false`
|
|
69
|
+
| Keep decorators in output
|
|
70
|
+
|
|
71
|
+
## Framework Integration
|
|
72
|
+
|
|
73
|
+
### React (Vite)
|
|
74
|
+
|
|
75
|
+
`vite.config.ts`
|
|
76
|
+
```typescript
|
|
77
|
+
import macroforge from "@macroforge/vite-plugin";
|
|
78
|
+
import react from "@vitejs/plugin-react";
|
|
79
|
+
import { defineConfig } from "vite";
|
|
80
|
+
|
|
81
|
+
export default defineConfig({
|
|
82
|
+
plugins: [
|
|
83
|
+
macroforge(), // Before React plugin
|
|
84
|
+
react()
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### SvelteKit
|
|
90
|
+
|
|
91
|
+
`vite.config.ts`
|
|
92
|
+
```typescript
|
|
93
|
+
import macroforge from "@macroforge/vite-plugin";
|
|
94
|
+
import { sveltekit } from "@sveltejs/kit/vite";
|
|
95
|
+
import { defineConfig } from "vite";
|
|
96
|
+
|
|
97
|
+
export default defineConfig({
|
|
98
|
+
plugins: [
|
|
99
|
+
macroforge(), // Before SvelteKit
|
|
100
|
+
sveltekit()
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
>
|
|
106
|
+
> Always place the Macroforge plugin before other framework plugins to ensure macros are expanded first.
|
|
107
|
+
|
|
108
|
+
## Development Server
|
|
109
|
+
|
|
110
|
+
During development, the plugin:
|
|
111
|
+
|
|
112
|
+
- Watches for file changes
|
|
113
|
+
|
|
114
|
+
- Expands macros on save
|
|
115
|
+
|
|
116
|
+
- Provides HMR support for expanded code
|
|
117
|
+
|
|
118
|
+
## Production Build
|
|
119
|
+
|
|
120
|
+
During production builds, the plugin:
|
|
121
|
+
|
|
122
|
+
- Expands all macros in the source files
|
|
123
|
+
|
|
124
|
+
- Generates type declaration files
|
|
125
|
+
|
|
126
|
+
- Strips `@derive` decorators from output
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Language Servers
|
|
2
|
+
|
|
3
|
+
*Macroforge provides language server integrations for enhanced IDE support beyond the TypeScript plugin.*
|
|
4
|
+
|
|
5
|
+
<Alert type="warning" title="Work in Progress">
|
|
6
|
+
Language server integrations are currently experimental. They work in the repository but are not yet published as official extensions. You'll need to fork the repo and install them as developer extensions.
|
|
7
|
+
</Alert>
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
While the [TypeScript Plugin]({base}/docs/integration/typescript-plugin) provides macro support in any TypeScript-aware editor, dedicated language servers offer deeper integration for specific frameworks and editors.
|
|
12
|
+
|
|
13
|
+
| [Svelte Language Server]({base}/docs/language-servers/svelte)
|
|
14
|
+
| Full Svelte support with macroforge
|
|
15
|
+
| Working (dev install)
|
|
16
|
+
|
|
17
|
+
| [Zed Extensions]({base}/docs/language-servers/zed)
|
|
18
|
+
| VTSLS and Svelte for Zed editor
|
|
19
|
+
| Working (dev install)
|
|
20
|
+
|
|
21
|
+
## Current Status
|
|
22
|
+
|
|
23
|
+
The language servers are functional and used during development of macroforge itself. However, they require manual installation:
|
|
24
|
+
|
|
25
|
+
1. Fork or clone the [macroforge-ts repository](https://github.com/rymskip/macroforge-ts)
|
|
26
|
+
|
|
27
|
+
2. Build the extension you need
|
|
28
|
+
|
|
29
|
+
3. Install it as a developer extension in your editor
|
|
30
|
+
|
|
31
|
+
See the individual pages for detailed installation instructions.
|
|
32
|
+
|
|
33
|
+
## Roadmap
|
|
34
|
+
|
|
35
|
+
We're working on official extension releases for:
|
|
36
|
+
|
|
37
|
+
- VS Code (via VTSLS)
|
|
38
|
+
|
|
39
|
+
- Zed (native extensions)
|
|
40
|
+
|
|
41
|
+
- Other editors with LSP support
|
|
42
|
+
|
|
43
|
+
## Detailed Guides
|
|
44
|
+
|
|
45
|
+
- [Svelte Language Server]({base}/docs/language-servers/svelte) - Full Svelte IDE support
|
|
46
|
+
|
|
47
|
+
- [Zed Extensions]({base}/docs/language-servers/zed) - VTSLS and Svelte for Zed
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Svelte Language Server
|
|
2
|
+
|
|
3
|
+
*`@macroforge/svelte-language-server` provides full Svelte IDE support with macroforge integration.*
|
|
4
|
+
|
|
5
|
+
<Alert type="warning" title="Developer Installation Required">
|
|
6
|
+
This package is not yet published as an official extension. You'll need to build and install it manually.
|
|
7
|
+
</Alert>
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Svelte syntax diagnostics** - Errors and warnings in .svelte files
|
|
12
|
+
|
|
13
|
+
- **HTML support** - Hover info, autocompletions, Emmet, outline symbols
|
|
14
|
+
|
|
15
|
+
- **CSS/SCSS/LESS** - Diagnostics, hover, completions, formatting, Emmet, color picking
|
|
16
|
+
|
|
17
|
+
- **TypeScript/JavaScript** - Full language features with macroforge macro expansion
|
|
18
|
+
|
|
19
|
+
- **Go-to-definition** - Navigate to macro-generated code
|
|
20
|
+
|
|
21
|
+
- **Code actions** - Quick fixes and refactorings
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### 1. Clone the Repository
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/rymskip/macroforge-ts.git
|
|
29
|
+
cd macroforge-ts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Build the Language Server
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Install dependencies
|
|
36
|
+
npm install
|
|
37
|
+
|
|
38
|
+
# Build the Svelte language server
|
|
39
|
+
cd packages/svelte-language-server
|
|
40
|
+
npm run build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Configure Your Editor
|
|
44
|
+
|
|
45
|
+
The language server exposes a `svelteserver` binary that implements the Language Server Protocol (LSP). Configure your editor to use it:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# The binary is located at:
|
|
49
|
+
./packages/svelte-language-server/bin/server.js
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Package Info
|
|
53
|
+
|
|
54
|
+
| Package
|
|
55
|
+
| `@macroforge/svelte-language-server`
|
|
56
|
+
|
|
57
|
+
| Version
|
|
58
|
+
| 0.1.7
|
|
59
|
+
|
|
60
|
+
| CLI Command
|
|
61
|
+
| `svelteserver`
|
|
62
|
+
|
|
63
|
+
| Node Version
|
|
64
|
+
| >= 18.0.0
|
|
65
|
+
|
|
66
|
+
## How It Works
|
|
67
|
+
|
|
68
|
+
The Svelte language server extends the standard Svelte language tooling with macroforge integration:
|
|
69
|
+
|
|
70
|
+
1. Parses `.svelte` files and extracts TypeScript/JavaScript blocks
|
|
71
|
+
|
|
72
|
+
2. Expands macros using the `@macroforge/typescript-plugin`
|
|
73
|
+
|
|
74
|
+
3. Maps diagnostics back to original source positions
|
|
75
|
+
|
|
76
|
+
4. Provides completions for macro-generated methods
|
|
77
|
+
|
|
78
|
+
## Using with Zed
|
|
79
|
+
|
|
80
|
+
For Zed editor, see the [Zed Extensions]({base}/docs/language-servers/zed) page for the dedicated `svelte-macroforge` extension.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Zed Extensions
|
|
2
|
+
|
|
3
|
+
*Macroforge provides two extensions for the [Zed editor](https://zed.dev): one for TypeScript via VTSLS, and one for Svelte.*
|
|
4
|
+
|
|
5
|
+
<Alert type="warning" title="Developer Installation Required">
|
|
6
|
+
These extensions are not yet in the Zed extension registry. You'll need to install them as developer extensions.
|
|
7
|
+
</Alert>
|
|
8
|
+
|
|
9
|
+
## Available Extensions
|
|
10
|
+
|
|
11
|
+
| `vtsls-macroforge`
|
|
12
|
+
| VTSLS with macroforge support for TypeScript
|
|
13
|
+
| `crates/extensions/vtsls-macroforge`
|
|
14
|
+
|
|
15
|
+
| `svelte-macroforge`
|
|
16
|
+
| Svelte language support with macroforge
|
|
17
|
+
| `crates/extensions/svelte-macroforge`
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### 1. Clone the Repository
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/rymskip/macroforge-ts.git
|
|
25
|
+
cd macroforge-ts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. Build the Extension
|
|
29
|
+
|
|
30
|
+
Build the extension you want to use:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# For VTSLS (TypeScript)
|
|
34
|
+
cd crates/extensions/vtsls-macroforge
|
|
35
|
+
|
|
36
|
+
# Or for Svelte
|
|
37
|
+
cd crates/extensions/svelte-macroforge
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. Install as Dev Extension in Zed
|
|
41
|
+
|
|
42
|
+
In Zed, open the command palette and run **zed: install dev extension**, then select the extension directory.
|
|
43
|
+
|
|
44
|
+
Alternatively, symlink the extension to your Zed extensions directory:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# macOS
|
|
48
|
+
ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/Library/Application\\ Support/Zed/extensions/installed/vtsls-macroforge
|
|
49
|
+
|
|
50
|
+
# Linux
|
|
51
|
+
ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/.config/zed/extensions/installed/vtsls-macroforge
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## vtsls-macroforge
|
|
55
|
+
|
|
56
|
+
This extension wraps [VTSLS](https://github.com/yioneko/vtsls) (a TypeScript language server) with macroforge integration. It provides:
|
|
57
|
+
|
|
58
|
+
- Full TypeScript language features
|
|
59
|
+
|
|
60
|
+
- Macro expansion at edit time
|
|
61
|
+
|
|
62
|
+
- Accurate error positions in original source
|
|
63
|
+
|
|
64
|
+
- Completions for macro-generated methods
|
|
65
|
+
|
|
66
|
+
## svelte-macroforge
|
|
67
|
+
|
|
68
|
+
This extension provides Svelte support using the `@macroforge/svelte-language-server`. It includes:
|
|
69
|
+
|
|
70
|
+
- Svelte component syntax support
|
|
71
|
+
|
|
72
|
+
- HTML, CSS, and TypeScript features
|
|
73
|
+
|
|
74
|
+
- Macroforge integration in script blocks
|
|
75
|
+
|
|
76
|
+
## Troubleshooting
|
|
77
|
+
|
|
78
|
+
### Extension not loading
|
|
79
|
+
|
|
80
|
+
Make sure you've restarted Zed after installing the extension. Check the Zed logs for any error messages.
|
|
81
|
+
|
|
82
|
+
### Macros not expanding
|
|
83
|
+
|
|
84
|
+
Ensure your project has the `macroforge` package installed and a valid `tsconfig.json` with the TypeScript plugin configured.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "installation",
|
|
4
|
+
"title": "Installation",
|
|
5
|
+
"category": "getting-started",
|
|
6
|
+
"category_title": "Getting Started",
|
|
7
|
+
"path": "getting-started/installation.md",
|
|
8
|
+
"use_cases": "setup, install, npm, getting started, quick start, init"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "first-macro",
|
|
12
|
+
"title": "First Macro",
|
|
13
|
+
"category": "getting-started",
|
|
14
|
+
"category_title": "Getting Started",
|
|
15
|
+
"path": "getting-started/first-macro.md",
|
|
16
|
+
"use_cases": "tutorial, example, hello world, beginner, learn"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "how-macros-work",
|
|
20
|
+
"title": "How Macros Work",
|
|
21
|
+
"category": "concepts",
|
|
22
|
+
"category_title": "Core Concepts",
|
|
23
|
+
"path": "concepts/how-macros-work.md",
|
|
24
|
+
"use_cases": "architecture, overview, understanding, basics, fundamentals"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "derive-system",
|
|
28
|
+
"title": "The Derive System",
|
|
29
|
+
"category": "concepts",
|
|
30
|
+
"category_title": "Core Concepts",
|
|
31
|
+
"path": "concepts/derive-system.md",
|
|
32
|
+
"use_cases": "@derive, decorator, annotation, derive macro"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "architecture",
|
|
36
|
+
"title": "Architecture",
|
|
37
|
+
"category": "concepts",
|
|
38
|
+
"category_title": "Core Concepts",
|
|
39
|
+
"path": "concepts/architecture.md",
|
|
40
|
+
"use_cases": "internals, rust, swc, napi, how it works"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "macros-overview",
|
|
44
|
+
"title": "Overview",
|
|
45
|
+
"category": "builtin-macros",
|
|
46
|
+
"category_title": "Built-in Macros",
|
|
47
|
+
"path": "builtin-macros/macros-overview.md",
|
|
48
|
+
"use_cases": "all macros, list, available macros, macro list"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "debug",
|
|
52
|
+
"title": "Debug",
|
|
53
|
+
"category": "builtin-macros",
|
|
54
|
+
"category_title": "Built-in Macros",
|
|
55
|
+
"path": "builtin-macros/debug.md",
|
|
56
|
+
"use_cases": "toString, debugging, logging, output, print"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "clone",
|
|
60
|
+
"title": "Clone",
|
|
61
|
+
"category": "builtin-macros",
|
|
62
|
+
"category_title": "Built-in Macros",
|
|
63
|
+
"path": "builtin-macros/clone.md",
|
|
64
|
+
"use_cases": "copy, clone, duplicate, shallow copy, immutable"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "default",
|
|
68
|
+
"title": "Default",
|
|
69
|
+
"category": "builtin-macros",
|
|
70
|
+
"category_title": "Built-in Macros",
|
|
71
|
+
"path": "builtin-macros/default.md",
|
|
72
|
+
"use_cases": "default values, factory, initialization, constructor"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "hash",
|
|
76
|
+
"title": "Hash",
|
|
77
|
+
"category": "builtin-macros",
|
|
78
|
+
"category_title": "Built-in Macros",
|
|
79
|
+
"path": "builtin-macros/hash.md",
|
|
80
|
+
"use_cases": "hashCode, hashing, hash map, equality, hash function"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "ord",
|
|
84
|
+
"title": "Ord",
|
|
85
|
+
"category": "builtin-macros",
|
|
86
|
+
"category_title": "Built-in Macros",
|
|
87
|
+
"path": "builtin-macros/ord.md",
|
|
88
|
+
"use_cases": "compareTo, ordering, sorting, comparison, total order"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "partial-eq",
|
|
92
|
+
"title": "PartialEq",
|
|
93
|
+
"category": "builtin-macros",
|
|
94
|
+
"category_title": "Built-in Macros",
|
|
95
|
+
"path": "builtin-macros/partial-eq.md",
|
|
96
|
+
"use_cases": "equals, equality, comparison, value equality"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "partial-ord",
|
|
100
|
+
"title": "PartialOrd",
|
|
101
|
+
"category": "builtin-macros",
|
|
102
|
+
"category_title": "Built-in Macros",
|
|
103
|
+
"path": "builtin-macros/partial-ord.md",
|
|
104
|
+
"use_cases": "compareTo, partial ordering, sorting, nullable comparison"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "serialize",
|
|
108
|
+
"title": "Serialize",
|
|
109
|
+
"category": "builtin-macros",
|
|
110
|
+
"category_title": "Built-in Macros",
|
|
111
|
+
"path": "builtin-macros/serialize.md",
|
|
112
|
+
"use_cases": "toJSON, serialization, json, api, data transfer"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "deserialize",
|
|
116
|
+
"title": "Deserialize",
|
|
117
|
+
"category": "builtin-macros",
|
|
118
|
+
"category_title": "Built-in Macros",
|
|
119
|
+
"path": "builtin-macros/deserialize.md",
|
|
120
|
+
"use_cases": "fromJSON, deserialization, parsing, validation, json"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "custom-overview",
|
|
124
|
+
"title": "Overview",
|
|
125
|
+
"category": "custom-macros",
|
|
126
|
+
"category_title": "Custom Macros",
|
|
127
|
+
"path": "custom-macros/custom-overview.md",
|
|
128
|
+
"use_cases": "custom, extending, creating macros, own macro"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "rust-setup",
|
|
132
|
+
"title": "Rust Setup",
|
|
133
|
+
"category": "custom-macros",
|
|
134
|
+
"category_title": "Custom Macros",
|
|
135
|
+
"path": "custom-macros/rust-setup.md",
|
|
136
|
+
"use_cases": "rust, cargo, napi, compilation, building"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "ts-macro-derive",
|
|
140
|
+
"title": "ts_macro_derive",
|
|
141
|
+
"category": "custom-macros",
|
|
142
|
+
"category_title": "Custom Macros",
|
|
143
|
+
"path": "custom-macros/ts-macro-derive.md",
|
|
144
|
+
"use_cases": "attribute, proc macro, derive attribute, rust macro"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "ts-quote",
|
|
148
|
+
"title": "Template Syntax",
|
|
149
|
+
"category": "custom-macros",
|
|
150
|
+
"category_title": "Custom Macros",
|
|
151
|
+
"path": "custom-macros/ts-quote.md",
|
|
152
|
+
"use_cases": "ts_quote, template, code generation, interpolation"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "integration-overview",
|
|
156
|
+
"title": "Overview",
|
|
157
|
+
"category": "integration",
|
|
158
|
+
"category_title": "Integration",
|
|
159
|
+
"path": "integration/integration-overview.md",
|
|
160
|
+
"use_cases": "setup, integration, tools, ecosystem"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "cli",
|
|
164
|
+
"title": "CLI",
|
|
165
|
+
"category": "integration",
|
|
166
|
+
"category_title": "Integration",
|
|
167
|
+
"path": "integration/cli.md",
|
|
168
|
+
"use_cases": "command line, macroforge command, expand, terminal"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "typescript-plugin",
|
|
172
|
+
"title": "TypeScript Plugin",
|
|
173
|
+
"category": "integration",
|
|
174
|
+
"category_title": "Integration",
|
|
175
|
+
"path": "integration/typescript-plugin.md",
|
|
176
|
+
"use_cases": "vscode, ide, language server, intellisense, autocomplete"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "vite-plugin",
|
|
180
|
+
"title": "Vite Plugin",
|
|
181
|
+
"category": "integration",
|
|
182
|
+
"category_title": "Integration",
|
|
183
|
+
"path": "integration/vite-plugin.md",
|
|
184
|
+
"use_cases": "vite, build, bundler, react, svelte, sveltekit"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "configuration",
|
|
188
|
+
"title": "Configuration",
|
|
189
|
+
"category": "integration",
|
|
190
|
+
"category_title": "Integration",
|
|
191
|
+
"path": "integration/configuration.md",
|
|
192
|
+
"use_cases": "macroforge.json, config, settings, options"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "ls-overview",
|
|
196
|
+
"title": "Overview",
|
|
197
|
+
"category": "language-servers",
|
|
198
|
+
"category_title": "Language Servers",
|
|
199
|
+
"path": "language-servers/ls-overview.md",
|
|
200
|
+
"use_cases": "lsp, language server, editor support"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "svelte-ls",
|
|
204
|
+
"title": "Svelte",
|
|
205
|
+
"category": "language-servers",
|
|
206
|
+
"category_title": "Language Servers",
|
|
207
|
+
"path": "language-servers/svelte-ls.md",
|
|
208
|
+
"use_cases": "svelte, svelte language server, .svelte files"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "zed-extensions",
|
|
212
|
+
"title": "Zed Extensions",
|
|
213
|
+
"category": "language-servers",
|
|
214
|
+
"category_title": "Language Servers",
|
|
215
|
+
"path": "language-servers/zed-extensions.md",
|
|
216
|
+
"use_cases": "zed, zed editor, extension"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "api-overview",
|
|
220
|
+
"title": "Overview",
|
|
221
|
+
"category": "api",
|
|
222
|
+
"category_title": "API Reference",
|
|
223
|
+
"path": "api/api-overview.md",
|
|
224
|
+
"use_cases": "api, functions, exports, programmatic"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "expand-sync",
|
|
228
|
+
"title": "expandSync()",
|
|
229
|
+
"category": "api",
|
|
230
|
+
"category_title": "API Reference",
|
|
231
|
+
"path": "api/expand-sync.md",
|
|
232
|
+
"use_cases": "expandSync, expand, transform, macro expansion"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"id": "transform-sync",
|
|
236
|
+
"title": "transformSync()",
|
|
237
|
+
"category": "api",
|
|
238
|
+
"category_title": "API Reference",
|
|
239
|
+
"path": "api/transform-sync.md",
|
|
240
|
+
"use_cases": "transformSync, transform, metadata, low-level"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"id": "native-plugin",
|
|
244
|
+
"title": "NativePlugin",
|
|
245
|
+
"category": "api",
|
|
246
|
+
"category_title": "API Reference",
|
|
247
|
+
"path": "api/native-plugin.md",
|
|
248
|
+
"use_cases": "NativePlugin, caching, language server, stateful"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"id": "position-mapper",
|
|
252
|
+
"title": "PositionMapper",
|
|
253
|
+
"category": "api",
|
|
254
|
+
"category_title": "API Reference",
|
|
255
|
+
"path": "api/position-mapper.md",
|
|
256
|
+
"use_cases": "PositionMapper, source map, diagnostics, position"
|
|
257
|
+
}
|
|
258
|
+
]
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@macroforge/mcp-server",
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"description": "MCP server for Macroforge documentation and code analysis",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"macroforge-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/rymskip/macroforge-ts.git",
|
|
13
|
+
"directory": "packages/mcp-server"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc && chmod +x dist/index.js",
|
|
17
|
+
"build:docs": "node scripts/extract-docs.cjs",
|
|
18
|
+
"dev": "npx @modelcontextprotocol/inspector dist/index.js",
|
|
19
|
+
"start": "node dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.11.1"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.0.0",
|
|
26
|
+
"typescript": "^5.7.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"macroforge": "^0.1.17"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"macroforge": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"docs"
|
|
39
|
+
],
|
|
40
|
+
"keywords": [
|
|
41
|
+
"mcp",
|
|
42
|
+
"macroforge",
|
|
43
|
+
"typescript",
|
|
44
|
+
"macros",
|
|
45
|
+
"documentation"
|
|
46
|
+
],
|
|
47
|
+
"license": "MIT"
|
|
48
|
+
}
|