open-index/open-npm huggingface dataset:
npm package: @macroforge/mcp-server
Description: MCP server for Macroforge documentation and code analysis
Latest version: 0.1.79

# @macroforge/mcp-server

MCP server for Macroforge documentation and code analysis

[![npm version](https://badge.fury.io/js/%40macroforge%2Fmcp-server.svg)](https://www.npmjs.com/package/@macroforge/mcp-server)

## Overview

@macroforge/mcp-server

Macroforge MCP (Model Context Protocol) Server

This module provides the main entry point for the Macroforge MCP server, which enables AI assistants
and other MCP clients to access Macroforge documentation, validate code with @derive decorators, and
expand macros.

The server communicates over stdio transport and exposes the following tools:

- `list-sections` - List available documentation sections
- `get-documentation` - Retrieve documentation content
- `macroforge-autofixer` - Validate TypeScript code with @derive decorators
- `expand-code` - Expand Macroforge macros and show generated code
- `get-macro-info` - Get documentation for macros and decorators

@example

```bash
# Run the server directly
npx @macroforge/mcp-server

# Or configure in your MCP client settings
{
"mcpServers": {
"macroforge": {
"command": "npx",
"args": ["@macroforge/mcp-server"]
}
}
}
```

## Installation

```bash
npm install @macroforge/mcp-server
```

## Examples

```typescript
# Run the server directly
npx @macroforge/mcp-server
# Or configure in your MCP client settings
{
"mcpServers": {
"macroforge": {
"command": "npx",
"args": ["@macroforge/mcp-server"]
}
}
}
```

## Documentation

See the [full documentation](https://macroforge.dev/docs/api/reference/typescript/mcp-server) on the
Macroforge website.

## License

MIT
npm package: @macroforge/svelte-preprocessor
Description: Svelte preprocessor for expanding Macroforge macros in component script blocks
Latest version: 0.1.79

# @macroforge/svelte-preprocessor

Svelte preprocessor for expanding Macroforge macros in component script blocks

[![npm version](https://badge.fury.io/js/%40macroforge%2Fsvelte-preprocessor.svg)](https://www.npmjs.com/package/@macroforge/svelte-preprocessor)

## Overview

@macroforge/svelte-preprocessor

Svelte preprocessor for expanding Macroforge macros in component script blocks.

This module provides integration between Macroforge's macro expansion system and
Svelte's preprocessing pipeline. It intercepts `<script>` blocks in `.svelte`
files, detects `@derive` decorators, and expands them into generated code before
TypeScript compilation occurs.

## How It Works

1. The preprocessor is registered in `svelte.config.js` as part of the
   preprocess array
2. When Svelte compiles a component, it passes each `<script>` block to this
   preprocessor
3. The preprocessor checks if the script contains `@derive` decorators
4. If found, it calls the native `macroforge` binding to expand the macros
5. The expanded code replaces the original script content

## Important Notes

- Must be placed BEFORE other preprocessors (like `vitePreprocess()`) in the
  chain
- Uses lazy-loading for native bindings to avoid initialization overhead
- Gracefully degrades if native bindings are unavailable
- Only processes TypeScript blocks by default (configurable via options)

## Installation

```bash
npm install @macroforge/svelte-preprocessor
```

## API

### Functions

- **`macroforgePreprocess`** - Whether to preserve `@derive` decorators in the
  expanded output.

### Types

- **`ExpandResult`** - Whether to preserve `@derive` decorators in the expanded
  output.
- **`MacroforgePreprocessorOptions`** - Configuration options for the Macroforge
  Svelte preprocessor.

## Examples

```typescript
macroforgePreprocess();
macroforgePreprocess({ keepDecorators: true });
macroforgePreprocess({ processJavaScript: true });
```

## Documentation

See the
[full documentation](https://macroforge.dev/docs/api/reference/typescript/svelte-preprocessor)
on the Macroforge website.

## License

MIT