Legal MCP Server

Legal MCP Server

Enables legal document analysis using Azure Blob Storage and Anthropic Claude API with streaming capabilities, prompt library management, and document retrieval for PDF files.

Category
Visit Server

README

Legal MCP Server

A Model Context Protocol (MCP) compliant server for legal document analysis using Azure Blob Storage and Anthropic Claude API.

Features

  • Document Management: List and retrieve pre-loaded .txt documents from Azure Blob Storage
  • Prompt Library: Manage curated prompts for legal document analysis
  • Streaming Analysis: Execute document analysis with real-time progress updates via MCP progress notifications
  • MCP SSE Transport: Full compliance with MCP specification using Server-Sent Events

Prerequisites

  • Node.js 18+
  • Azure Storage Account with:
    • documents-texts container (for .txt documents)
    • prompts container (for prompt library JSON)
  • Anthropic Claude API key with credits

Setup

  1. Clone and install dependencies:

    git clone <your-repo-url>
    cd Legal-MCP
    npm install
    
  2. Configure environment variables:

    cp .env.example .env
    # Edit .env with your actual values
    
  3. Upload initial prompt library to Azure:

    # Using Azure CLI (after setting up connection)
    az storage blob upload \
      --account-name legalmcpstore \
      --container-name prompts \
      --name "library.json" \
      --file ./prompts/library.json \
      --connection-string "$AZURE_STORAGE_CONNECTION_STRING"
    
  4. Upload documents to Azure:

    # Upload `.txt` files to the documents-texts container
    az storage blob upload \
      --account-name legalmcpstore \
      --container-name documents-texts \
      --name "your-document.txt" \
      --file ./path/to/your-document.txt \
      --connection-string "$AZURE_STORAGE_CONNECTION_STRING"
    

Running Locally

Development mode (with auto-reload):

npm run dev

Production mode:

npm run build
npm start

The server will start on http://localhost:3000 (or the port specified in PORT env var).

MCP Client Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "legal-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/Legal-MCP/dist/index.js"],
      "env": {
        "AZURE_STORAGE_CONNECTION_STRING": "...",
        "ANTHROPIC_API_KEY": "..."
      }
    }
  }
}

Note: For SSE transport, you'll need to configure the HTTP endpoint instead. See MCP documentation for SSE client setup.

Testing with MCP Inspector

You can test the server using the MCP Inspector or any MCP-compatible client:

# Server should be running on http://localhost:3000/mcp
# Use an MCP client that supports SSE transport

Available Tools

  1. list_documents: Returns all available .txt documents
  2. list_prompts: Lists available analysis prompts (with optional search)
  3. get_prompt: Retrieves full prompt details by ID
  4. add_prompt: Adds a new user-contributed prompt
  5. execute_analysis: Executes document analysis with streaming progress updates

Project Structure

legal-mcp/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── storage/
│   │   ├── azure-blob.ts     # Azure Blob Storage client
│   │   └── prompts.ts         # Prompt library management
│   ├── claude/
│   │   └── client.ts         # Claude API client with streaming
│   ├── tools/
│   │   ├── documents.ts      # Document listing tool
│   │   ├── prompts.ts         # Prompt management tools
│   │   └── execute.ts         # Analysis execution tool
│   └── types.ts              # Shared TypeScript types
├── prompts/
│   └── library.json          # Initial prompt library
└── package.json

Deployment to Azure

See the deployment section in the original plan for Azure App Service deployment instructions.

License

ISC

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured