Skip to main content
Glama
GhostLex MCP Server

GhostLex MCP Server

GhostLex MCP Server 🇮🇳⚖️

GhostLex Research Systems as a Model Context Protocol (MCP) Server. This exposes our core Indian legal AI capabilities to any MCP-compatible environment (Claude Desktop, Cursor, Antigravity Editor, ChatGPT, etc.).

🚀 What It Does

This server provides 5 tools and 1 resource for deep legal research on the newly enacted BNS/BNSS/BSA (Bharatiya Nyaya Sanhita, etc.):

  1. analyze_legal_query — Deep legal research with full statutory mapping and landmark Supreme Court citations.

  2. search_vault — Search locally cached research to save API credits.

  3. list_vault_entries — View all past research currently in the vault.

  4. generate_word_report — Full pipeline: Research → Format to GhostLex_Analysis_*.docx → Save.

  5. get_case_summary — Quick 200-word summary on any Indian legal topic.

Resource:

  • ghostlex://vault — Exposes the entire JSON case vault as readable context for the AI.

Related MCP server: courtmesh-mcp

🛠️ Setup & Installation

1. Prerequisites

Ensure you have Python 3.10+ installed.

2. Install Dependencies

cd "the ghost engine"
pip install -r requirements.txt

3. API Key

You must set your Google AI Studio API key as an environment variable before running the server or connecting to it.

  • Windows: set GOOGLE_API_KEY="your_api_key_here"

  • Mac/Linux: export GOOGLE_API_KEY="your_api_key_here"

🔌 Connecting to Claude Desktop / Antigravity

Add the following to your MCP configuration file (mcp_config.json or claude_desktop_config.json):

{
  "mcpServers": {
    "ghostlex-legal-ai": {
      "command": "python",
      "args": [
        "C:/path/to/the ghost engine/ghostlex_mcp_server.py"
      ],
      "env": {
        "GOOGLE_API_KEY": "your_api_key_here"
      }
    }
  }
}

(Make sure to change the path to where your ghostlex_mcp_server.py file actually lives!)

🧪 Testing Locally (MCP Inspector)

You can run the interactive MCP inspector to test all tools directly in your browser:

set GOOGLE_API_KEY="AIzaSy..." # your key
mcp dev ghostlex_mcp_server.py

This will open a web UI where you can click "Call Tool" and verify everything works.

🛡️ DPDP Compliance

This server automatically runs a compliance sweep on startup, erasing any generated .docx reports older than 24 hours to comply with the DPDP Act 2023.


Prepared by GhostLex Research Desk | Copyright © 2026 GhostLex Research Systems Created and Open-Sourced by Kabir Khan

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      An MCP server for the CourtMesh public API that enables AI clients to search and analyze Indian court case law, covering over 310 million case records from the Supreme Court, High Courts, District Courts, and tribunals.
      12
      234 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to query a FalkorDB citation graph of Indian Supreme Court judgments, determine whether cited authorities remain good law, trace overruling and reliance through multi-hop evidence paths, and access case-law tools or read-only Cypher.
      3
      MIT