Skip to content

Code Synesthesia is a creative Model Context Protocol (MCP) server that allows GitHub Copilot to "see" and "feel" the mood of your code. It analyzes Python code complexity, maintainability, and style to generate a visual "vibe" (a theme color palette) and a rich, procedural "Abstract Code Art" SVG image representing the code's structure.

Notifications You must be signed in to change notification settings

Aadhavancnp/code-synesthesia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Synesthesia MCP Server

A creative MCP server that analyzes Python code complexity and style to generate a visual "vibe" (SVG color palette) and a rich, procedural "Abstract Code Art" SVG image representing the code's structure. This allows GitHub Copilot to "see" the mood of the code and describe it creatively.

Code Synesthesia Output

Features

  • analyze_code_metrics Tool: Calculates cyclomatic complexity, lines of code, comment ratio, and maintainability index using radon.
  • generate_vibe_palette Tool: Maps the metrics to a theme color palette (hex codes) and a descriptive "vibe" (e.g., "Chaotic Neon", "Zen Garden").
  • generate_abstract_art Tool: Generates a rich, procedural SVG artwork based on the code's metrics and color palette.
  • vibe_check Prompt: A custom prompt that instructs Copilot to run these tools and present the final artwork and a poetic description to the user.

Setup

  1. Ensure you have Python 3.10+ installed.
  2. Install dependencies using uv:
    uv add mcp radon

VS Code Integration

To use this MCP server with GitHub Copilot in VS Code, you need to configure it in your MCP settings.

  1. Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P).
  2. Search for and select "GitHub Copilot: Edit MCP Settings".
  3. Add the following configuration to the mcpServers object in the mcp.json file:
{
  "mcpServers": {
    "code-synesthesia": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "server.py"
      ]
    }
  }
}

Note: Ensure the path to server.py is correct for your system.

  1. Restart VS Code or reload the window.
  2. Open a Python file and ask Copilot Chat: "Run a vibe check on this file using the code-synesthesia MCP server."

Note: GitHub Copilot Chat in VS Code can render SVG code blocks directly in the chat window, allowing you to see the generated art without leaving the editor!

About

Code Synesthesia is a creative Model Context Protocol (MCP) server that allows GitHub Copilot to "see" and "feel" the mood of your code. It analyzes Python code complexity, maintainability, and style to generate a visual "vibe" (a theme color palette) and a rich, procedural "Abstract Code Art" SVG image representing the code's structure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages