MCP Integration Setup

Connect LORE to your AI coding assistant via the Model Context Protocol for deep architectural understanding.

What you get: Once connected, your AI assistant can answer questions about your codebase architecture, dependencies, hotspots, and more — all powered by LORE's 13 analyzers running behind the scenes.

What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to communicate with external tools and data sources. Instead of relying solely on the context window, MCP allows Claude, Cursor, and other AI tools to dynamically fetch structured information from specialized servers. LORE implements an MCP server that exposes code archaeology capabilities as tools the AI can invoke on demand.

When LORE is connected via MCP, your AI assistant gains the ability to analyze your project's dependency graph, detect circular dependencies, identify hotspots, evaluate type safety, and provide intelligent recommendations — all without you having to copy-paste analysis output. The AI simply asks LORE for what it needs, when it needs it.

Claude Desktop

Claude Desktop by Anthropic is the most popular MCP-compatible AI assistant. Setting up LORE with Claude takes about two minutes and provides immediate architectural intelligence to your Claude conversations.

Step 1: Open Configuration

Open your Claude Desktop configuration file. The location depends on your operating system. If the file doesn't exist yet, create it with the JSON content below.

# macOS
~/Library/Application Support/Claude/claude_desktop_config.json

# Windows
%APPDATA%\Claude\claude_desktop_config.json

# Linux
~/.config/Claude/claude_desktop_config.json

Step 2: Add LORE Server

Add the LORE MCP server configuration to the JSON file. The npx -y flag ensures LORE is automatically installed and kept up to date without manual intervention.

{
  "mcpServers": {
    "lore": {
      "command": "npx",
      "args": ["-y", "lore-mcp"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

Important: Replace /absolute/path/to/your/project with the actual absolute path to the project you want LORE to analyze. Claude Desktop needs this to know which codebase to analyze.

Step 3: Restart Claude

After saving the configuration file, completely quit and restart Claude Desktop. You will see a small hammer icon in the Claude interface indicating that MCP tools are available. LORE should appear in the tools list as "lore".

Step 4: Verify Connection

To verify that LORE is properly connected, ask Claude a question about your codebase architecture:

# Try asking Claude:
"What is the overall architecture of my project?"
"Are there any circular dependencies?"
"Which files are the biggest hotspots?"

Cursor

Cursor is an AI-first code editor with built-in MCP support. LORE integrates seamlessly, providing architectural context directly within your coding workflow without switching between applications.

Configuration

Open Cursor's MCP settings by navigating to Settings > MCP Servers or by editing the .cursor/mcp.json file in your project root. Add the following configuration:

{
  "mcpServers": {
    "lore": {
      "command": "npx",
      "args": ["-y", "lore-mcp"],
      "cwd": "${workspaceFolder}"
    }
  }
}

The ${workspaceFolder} variable automatically resolves to the root of your current project in Cursor, so you do not need to hardcode the path. After adding this configuration, restart Cursor or reload the MCP servers from the command palette.

Windsurf (Codeium)

Windsurf by Codeium supports MCP integration for extending its AI capabilities. The setup is similar to Claude Desktop and Cursor, with the configuration stored in a standard MCP settings file.

Configuration

{
  "mcpServers": {
    "lore": {
      "command": "npx",
      "args": ["-y", "lore-mcp"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

Save the configuration and restart Windsurf. LORE will be available as a tool in Cascade (Windsurf's AI assistant), giving it the ability to perform deep architectural analysis of your project on demand.

Available MCP Tools

When LORE is connected via MCP, it exposes the following tools that your AI assistant can invoke. Each tool returns structured data that the AI processes and presents in natural language, tailored to your specific question.

Tool Name Description Returns
analyze_project Run full architectural analysis Complete status report with scores
get_dependency_graph Query the module dependency tree Nodes and edges of the graph
find_hotspots Locate high-risk, change-prone modules Ranked list with complexity scores
check_circular_deps Detect problematic import cycles Cycle chains and affected files
get_coupling_matrix Measure inter-module coupling strength Matrix of coupling scores
get_type_safety Evaluate TypeScript type coverage Type safety score and gaps
get_recommendations AI-generated improvement suggestions Prioritized action items
check_hidden_coupling Reveal implicit dependencies Hidden coupling links

Example Prompts

Once LORE is connected, try these prompts in your AI assistant to experience the full power of architectural intelligence. Each prompt triggers specific LORE analyzers behind the scenes to provide accurate, data-driven answers.

# Architecture Overview
"Give me a complete architectural overview of this project."
"What are the main layers and how do they connect?"

# Risk Assessment
"Which parts of this codebase are most likely to break?"
"Show me the top 5 riskiest modules and why."
"Are there any circular dependencies I should fix first?"

# Improvement Guidance
"What would you recommend to improve code quality?"
"Where should I focus my refactoring efforts?"
"Which modules need better type safety?"

# Impact Analysis
"If I refactor the auth module, what else would be affected?"
"What is the import impact of the utils/ directory?"
"Show me the ripple effect of changing src/core/."

Troubleshooting

LORE doesn't appear in Claude Desktop

Make sure you have completely quit Claude Desktop (not just closed the window) and restarted it after editing the configuration file. On macOS, use Cmd+Q to quit. Also verify that the JSON in your config file is valid (no trailing commas, proper brackets) by running it through a JSON validator.

"Project not found" error

The cwd path in your configuration must be an absolute path to a valid project directory. On Windows, use forward slashes or escaped backslashes: "C:/Users/name/projects/my-app". Verify the path exists by running ls (macOS/Linux) or dir (Windows) on it.

Analysis takes too long

Large codebases (1000+ files) may take longer on first analysis. Subsequent runs use cached results and are significantly faster. You can also use .loreignore to exclude directories like node_modules/, dist/, and generated code from analysis, which can dramatically reduce processing time.

npx prompts for installation every time

If you want to avoid the npx installation prompt, install LORE globally with npm install -g lore-mcp and change the MCP config to use the direct command:

{
  "mcpServers": {
    "lore": {
      "command": "lore",
      "args": ["mcp"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}