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.
Clone the repository:
git clone https://github.com/phxdev1/archy.git
cd archy
Install dependencies:
npm install
Build the project:
npm run build
Use the convenient installation script to configure the MCP server for VS Code and Claude:
npm run install-mcp
This script automatically:
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)When an OpenRouter API key is configured, additional AI-powered features become available:
To use these features:
OPENROUTER_API_KEY
environment variableArchy supports exporting Mermaid diagrams to various formats:
Generates a Mermaid diagram from a text description.
Parameters:
description
: Text description of the diagram to generatediagramType
: Type of diagram to generate (e.g., 'flowchart', 'classDiagram', etc.)Example:
{
"description": "A user authentication system with login, registration, and password reset",
"diagramType": "flowchart"
}
Generates a Mermaid diagram from a GitHub repository.
Parameters:
repoUrl
: URL of the GitHub repositorydiagramType
: Type of diagram to generateExample:
{
"repoUrl": "https://github.com/username/repository",
"diagramType": "classDiagram"
}
Lists all supported diagram types with descriptions.
The following tools require an OpenRouter API key:
Uses AI to generate a Mermaid diagram from text.
Parameters:
description
: Text description of the diagramdiagramType
: Type of diagram to generateuseAdvancedModel
: (Optional) Whether to use an advanced AI modelGenerates a diagram from code using AI.
Parameters:
code
: Code to analyzediagramType
: Type of diagram to generateCreates a diagram showing differences between code versions.
Parameters:
beforeCode
: Code before changesafterCode
: Code after changesdiagramType
: Type of diagram to generateExports a Mermaid diagram to an image format.
Parameters:
mermaidCode
: Mermaid diagram codeformat
: (Optional) Image format ('png', 'svg', 'pdf')width
: (Optional) Image width in pixelsheight
: (Optional) Image height in pixelsbackgroundColor
: (Optional) Background colorShows repository evolution over time.
Parameters:
repoUrl
: GitHub repository URLdiagramType
: Type of diagramfilepath
: (Optional) Specific file to trackcommitLimit
: (Optional) Maximum number of commits to analyzegenerate_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
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
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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