M

MCP Legal Doc Analyzer

by dbsectrainer · io.github.dbsectrainer/mcp-legal-doc-analyzer

Enables local, on-device legal document analysis including clause extraction, risk flagging, compliance checking, and clause-level version comparison without sending documents externally.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-dbsectrainer-mcp-legal-doc-analyzer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-legal-doc-analyzer"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_VALUE>",
        "DB": "~/.mcp/legal.db",
        "OCR": "false",
        "HTTP_PORT": "<VALUE>",
        "TEMPLATES": "<VALUE>",
        "NO_HISTORY": "false",
        "CLAUSE_PATTERNS": "<VALUE>",
        "BULK_CONCURRENCY": "4",
        "CONFIDENCE_THRESHOLD": "0.6"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
YOUR_API_KEY secret Yes Your API key for the service
DB No Path to the SQLite database file used to store document analysis history. Default: ~/.mcp/legal.db
OCR No Enable OCR fallback for scanned PDFs that contain no extractable text layer. Requires the optional peer dependencies tesseract.js, pdfjs-dist, and canvas. Default: false
HTTP_PORT No Start the server in Streamable HTTP mode on the given port instead of stdio.
TEMPLATES No Directory to load custom YAML compliance rule templates from. Templates in this directory are merged with the built-in set.
NO_HISTORY No Disable storing document analysis results in the local database. Default: false
CLAUSE_PATTERNS No Path to a YAML file defining custom clause detection patterns.
BULK_CONCURRENCY No Number of files to process in parallel when using bulk_analyze. Default: 4
CONFIDENCE_THRESHOLD No Minimum confidence score (0–1) for extracted clauses to be included in results. Extractions below this threshold are flagged as low-confidence. Default: 0.6

Similar servers