Archy MCP server

Generates architectural diagrams from text descriptions or GitHub repositories using Mermaid syntax, supporting flowcharts, class diagrams, sequence diagrams, and repository evolution tracking.
Back to servers
Setup instructions
Provider
phxdev1
Release date
Apr 26, 2025
Language
TypeScript
Package
Stats
523.25M downloads
17 stars

This MCP server creates architectural diagrams from text descriptions or GitHub repositories using Mermaid syntax. It supports various diagram types like flowcharts, sequence diagrams, class diagrams, and more.

Installation

Prerequisites

  • Node.js (v16 or higher)
  • npm (v7 or higher)
  • TypeScript (v5.8 or higher, included in dependencies)

Install from Source

  1. Clone the repository:

    git clone https://github.com/phxdev1/archy.git
    cd archy
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Automated MCP Installation

Use the convenient installation script to configure the MCP server for VS Code and Claude:

npm run install-mcp

This script automatically:

  • Detects the correct MCP settings locations for your operating system
  • Updates the MCP configuration files
  • Prompts for a GitHub token (optional)
  • Makes the server executable

Configuration

Archy can be configured using environment variables:

  • GITHUB_TOKEN: GitHub API token for authenticated requests (optional)
  • OPENROUTER_API_KEY: OpenRouter API key for AI-powered diagram generation (optional)

OpenRouter Integration

When an OpenRouter API key is configured, additional AI-powered features become available:

  • Enhanced text-to-diagram generation
  • Code-to-diagram generation
  • Diff visualization

To use these features:

  1. Sign up at OpenRouter
  2. Get your API key
  3. Set the OPENROUTER_API_KEY environment variable

Image Export

Archy supports exporting Mermaid diagrams to various formats:

  • PNG: Raster image format
  • SVG: Vector image format
  • PDF: Document format

Available Tools

generate_diagram_from_text

Generates a Mermaid diagram from a text description.

Parameters:

  • description: Text description of the diagram to generate
  • diagramType: Type of diagram to generate (e.g., 'flowchart', 'classDiagram', etc.)

Example:

{
  "description": "A user authentication system with login, registration, and password reset",
  "diagramType": "flowchart"
}

generate_diagram_from_github

Generates a Mermaid diagram from a GitHub repository.

Parameters:

  • repoUrl: URL of the GitHub repository
  • diagramType: Type of diagram to generate

Example:

{
  "repoUrl": "https://github.com/username/repository",
  "diagramType": "classDiagram"
}

list_supported_diagram_types

Lists all supported diagram types with descriptions.

AI-Powered Tools

The following tools require an OpenRouter API key:

generate_diagram_from_text_with_ai

Uses AI to generate a Mermaid diagram from text.

Parameters:

  • description: Text description of the diagram
  • diagramType: Type of diagram to generate
  • useAdvancedModel: (Optional) Whether to use an advanced AI model

generate_diagram_from_code

Generates a diagram from code using AI.

Parameters:

  • code: Code to analyze
  • diagramType: Type of diagram to generate

generate_diff_diagram

Creates a diagram showing differences between code versions.

Parameters:

  • beforeCode: Code before changes
  • afterCode: Code after changes
  • diagramType: Type of diagram to generate

export_diagram_to_image

Exports a Mermaid diagram to an image format.

Parameters:

  • mermaidCode: Mermaid diagram code
  • format: (Optional) Image format ('png', 'svg', 'pdf')
  • width: (Optional) Image width in pixels
  • height: (Optional) Image height in pixels
  • backgroundColor: (Optional) Background color

generate_repository_evolution_diagram

Shows repository evolution over time.

Parameters:

  • repoUrl: GitHub repository URL
  • diagramType: Type of diagram
  • filepath: (Optional) Specific file to track
  • commitLimit: (Optional) Maximum number of commits to analyze

Examples

Generating a Class Diagram from Text

generate_diagram_from_text({
  "description": "Create a class diagram for a library system with Book, Author, and Library classes. Books have titles and ISBNs. Authors have names and can write multiple books. Libraries contain many books.",
  "diagramType": "classDiagram"
})

Result:

classDiagram
  class Book {
    +String title
    +String ISBN
    +getDetails()
  }
  class Author {
    +String name
    +List books
    +addBook(Book)
  }
  class Library {
    +List books
    +addBook(Book)
    +findBookByISBN(String)
  }
  Author "1" -- "n" Book: writes
  Library "1" -- "n" Book: contains

Generating a Flowchart from GitHub

generate_diagram_from_github({
  "repoUrl": "https://github.com/username/api-service",
  "diagramType": "flowchart"
})

Result:

flowchart TD
  A[Client] --> B[API Gateway]
  B --> C{Authentication}
  C -->|Valid| D[Route Request]
  C -->|Invalid| E[Return 401]
  D --> F[Service 1]
  D --> G[Service 2]
  D --> H[Service 3]
  F --> I[Database]
  G --> I
  H --> I

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "archy" '{"command":"node","args":["/path/to/archy/build/index.js"],"env":{"GITHUB_TOKEN":"your-github-token"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "archy": {
            "command": "node",
            "args": [
                "/path/to/archy/build/index.js"
            ],
            "env": {
                "GITHUB_TOKEN": "your-github-token"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "archy": {
            "command": "node",
            "args": [
                "/path/to/archy/build/index.js"
            ],
            "env": {
                "GITHUB_TOKEN": "your-github-token"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later