Understand-Anything-MCP

Understand-Anything MCP Server

npm version license GitHub stars

A Model Context Protocol (MCP) server that empowers your AI agents to understand your entire project architecture, and a headless CI gateway to enforce architectural rules before code is merged.

Quick Start

[!NOTE] Prerequisite: ua-mcp is a lightweight reader that connects your AI assistant to your local Understand-Anything knowledge graph. It does not build the graph itself. You must install the core scanner from Egonex-AI/Understand-Anything and run /understand in your project to produce the .ua/knowledge-graph.json file. Commit this file to your repository before proceeding.

Get your AI assistant hooked up with architectural context in 60 seconds. ua_find_callers, ua_impact_analysis, and ua_precheck work immediately for free with no license key required!

Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "understand-anything": {
      "command": "npx",
      "args": ["-y", "ua-mcp"],
      "env": {
        "UA_PROJECT_PATH": "/absolute/path/to/your/project"
      }
    }
  }
}

Cursor

  1. Go to Settings > Features > MCP.
  2. Click + Add new MCP server.
  3. Name: understand-anything
  4. Type: command
  5. Command: npx -y ua-mcp
  6. Add an environment variable: UA_PROJECT_PATH = /absolute/path/to/your/project

How UA-MCP compares to Understand-Anything Tool

The free upstream Understand-Anything tool is responsible for generating the local knowledge graph and performing manual local analysis. UA-MCP sits on top of this graph to provide an automated governance layer and safety net for your codebase. While the free tool is a diagnostic scanner, UA-MCP actively blocks risky merges via its CI/branch-protection gate (ua-ci) and enforces your custom .ua-rules.json architectural boundaries.

Privacy Policy

[!IMPORTANT] Link to Privacy Policy

Data Processing Details:

Security Considerations

🚀 Features

[!TIP] System Instruction Recommended: For the best experience, add the following to your AI assistant’s system prompt or custom instructions: “Always call ua_precheck before modifying any file in this project.”

How it works

  1. Your AI agent decides it wants to modify a critical file (e.g., src/auth.ts).
  2. The agent (following its system instructions) triggers ua_precheck before making the edit to run an Architectural Safety Linter.
  3. The server analyzes the graph to determine the “blast radius” and checks it against your rules.
  4. If the blast radius is too large or violates a rule, a Safety Checkpoint (Elicitation Prompt) interrupts the agent, asking for your explicit confirmation before proceeding.

Configuration Rules (.ua-rules.json)

You can define specific boundaries in a .ua-rules.json file in the root of your workspace to dictate what the LLM is allowed to touch.

{
  // Understand-Anything Architectural Rules
  // Define constraints that agents and developers must respect.
  "rules": [
    {
      "id": "no-ui-db-import",
      "description": "UI layer must never import database layer directly",
      "from_pattern": "src/ui/**",
      "to_pattern": "src/db/**",
      "severity": "error"
    },
    {
      "id": "auth-required-for-payments",
      "description": "Payment modules must always be reachable from auth",
      "requires_path_through": "src/auth/**",
      "for_pattern": "src/payments/**",
      "severity": "error"
    }
  ]
}

đź”’ Usage: CI/CD Branch Protection (Enforcement)

CI Gateway (ua-ci)

A companion CLI that runs locally in your GitHub Actions or GitLab CI. It parses your PR diff and compares it to the local graph.

[!IMPORTANT] The True Enforcement Backstop: While local agents rely on system instructions to run ua_precheck, the ua-ci command is designed to be your unbypassable safety net. By running ua-ci in your GitHub Actions and requiring it as a status check in GitHub Branch Protection, you ensure that no rogue edits can ever be merged into production without explicit approval.

Note on Free Tier: If a valid Pro license key is not detected in the environment variables, the CI check will log a warning and silently pass (exit 0) so it does not block builds for non-paying users.

# .github/workflows/ua-ci.yml
name: Understand-Anything CI Check
on:
  pull_request:
    branches: [ main ]

jobs:
  ua-ci-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Generate PR Diff
        run: git diff origin/main...HEAD > pr.diff

      - name: Run UA Branch Protection
        env:
          UA_LICENSE_KEY: $
        run: npx ua-ci --pr-diff=pr.diff

🛡️ Usage: Local Governance (Agents)

When connected to Claude Desktop or an MCP client, the following tools become available to the agent:

Claude Desktop (claude_desktop_config.json)

Add the following to your Claude Desktop config file (usually ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "understand-anything": {
      "command": "npx",
      "args": ["-y", "ua-mcp"],
      "env": {
        "UA_PROJECT_PATH": "/path/to/your/project",
        "UA_LICENSE_KEY": "your_license_key_here"
      }
    }
  }
}

Cursor

  1. Go to Settings > Features > MCP.
  2. Click + Add new MCP server.
  3. Name: understand-anything
  4. Type: command
  5. Command: npx -y ua-mcp

Continue

Add to your config.json under mcpServers:

"understand-anything": {
  "command": "npx",
  "args": ["-y", "ua-mcp"]
}

Available Tools & Tiering

The Understand-Anything MCP Server operates on a tiered licensing model.

Core Tools (Free Tier)

Available out of the box with no license required.

Premium Tools (Pro Tier)

Pro Tier — Architectural Enforcement & CI Safety

Team Use: One Pro license key can be shared across your entire team’s CI pipelines and MCP configurations — no per-seat pricing.

Pricing

Tier Price Features
Free $0 forever Basic graph operations, local storage.
Pro $10/month OR $50 one-time Unlimited nodes, advanced graph analytics, rule enforcement, priority support. (Lifetime access limited availability)

Get your license key:

Troubleshooting

License

MIT License