Skip to main content
Glama

@macroforge/mcp-server

MCP server for Macroforge documentation and code analysis

npm version

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

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

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

Related MCP server: TypeScript LSP MCP

Installation

npm install @macroforge/mcp-server

Examples

# 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 on the Macroforge website.

License

MIT

Available Tools

5 tools
expand-codeA

Expands Macroforge macros in TypeScript code and returns the transformed result.

Shows:

  • The fully expanded TypeScript code with all generated methods

  • Any diagnostics (errors, warnings, info) with line/column locations

  • Help text for fixing issues (when available)

Useful for:

  • Seeing what code the macros generate

  • Understanding how @derive decorators transform your classes

  • Debugging macro expansion issues

Inputs: code (required), filename.

get-documentationA

Retrieves full documentation content for Macroforge sections.

Supports flexible search by:

  • Title (e.g., "Debug", "Vite Plugin")

  • ID (e.g., "debug", "vite-plugin")

  • Partial matches

Can accept a single section name or an array of sections. After calling list-sections, analyze the use_cases and fetch ALL relevant sections at once.

Inputs: section (required).

get-macro-infoA

Get documentation for Macroforge macros and decorators.

Returns information about:

  • Macro descriptions (e.g., Debug, Serialize, Clone)

  • Decorator documentation (e.g., @serde, @debug field decorators)

  • Available macro options and configuration

Use without parameters to get the full manifest of all available macros and decorators. Use with a name parameter to get info for a specific macro or decorator.

Inputs: name.

list-sectionsA

Lists all Macroforge documentation sections.

Returns sections with:

  • title: Section name

  • use_cases: When this doc is useful (comma-separated keywords)

  • path: File path

  • category: Category name

WORKFLOW:

  1. Call list-sections FIRST for any Macroforge-related task

  2. Analyze use_cases to find relevant sections

  3. Call get-documentation with ALL relevant section names

Example use_cases: "setup, install", "serialization, json", "validation, email"

Inputs: no named parameters.

macroforge-autofixerA

Validates TypeScript code with @derive decorators using Macroforge's native validation.

Returns structured JSON diagnostics with:

  • level: error | warning | info

  • message: What's wrong

  • location: Line and column number (when available)

  • help: Suggested fix (when available)

  • notes: Additional context (when available)

  • summary: Count of errors, warnings, and info messages

This tool MUST be used before sending Macroforge code to the user. If require_another_tool_call_after_fixing is true, fix the issues and validate again.

Detects:

  • Invalid/unknown macro names

  • Malformed @derive decorators

  • @serde validator issues (email, url, length, etc.)

  • Macro expansion failures

  • Syntax errors in generated code

Inputs: code (required), filename.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: expand-code transforms TypeScript code, get-documentation retrieves documentation content, get-macro-info provides macro/decorator details, list-sections lists documentation sections, and macroforge-autofixer validates code. The descriptions clearly differentiate their functions, making misselection unlikely.

    Naming Consistency4/5

    The naming is mostly consistent with a verb_noun pattern (expand-code, get-documentation, get-macro-info, list-sections), but macroforge-autofixer deviates slightly by using a compound noun prefix instead of a verb. This minor inconsistency doesn't significantly hinder readability or predictability.

    Tool Count5/5

    With 5 tools, this server is well-scoped for its purpose of Macroforge macro handling and documentation. Each tool earns its place by covering distinct aspects like code expansion, documentation retrieval, macro info, section listing, and validation, providing a complete workflow without being overly sparse or bloated.

    Completeness5/5

    The tool set offers complete coverage for the Macroforge domain: expand-code handles code transformation, get-documentation and get-macro-info cover documentation needs, list-sections supports discovery, and macroforge-autofixer ensures validation. This covers the full lifecycle from setup and usage to debugging and validation, with no obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Exposes TypeScript Language Server Protocol functionality to AI agents, enabling them to query types at specific positions, find definitions and references, get diagnostics, run type tests, and type-check inline code just like in an IDE.
      9
      297 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to interact with TypeScript projects through compiler-level code intelligence, providing tools for navigation, type information, diagnostics, refactoring, and semantic search.
      29
      179 npm
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to navigate and edit TypeScript/JavaScript source by named declarations, reading symbols, imports, diagnostics, and replacing code via the TypeScript AST.
      -