MCP Hub
Back to servers

LegalForge MCP Server

Enables the generation of professional, jurisdiction-specific legal documents like privacy policies, terms of service, and cookie policies. It allows users to produce structured HTML legal content by providing specific parties, terms, and service configurations to an AI-driven tool.

glama
Updated
Feb 8, 2026

LegalForge MCP Server

Model Context Protocol (MCP) server for generating professional legal documents using AI.

Features

  • Privacy Policy - GDPR/CCPA compliant privacy policies
  • Terms of Service - Comprehensive terms for your website/app
  • Cookie Policy - Detailed cookie policies with consent info

Installation

npm install
npm run build

Configuration

Set your Anthropic API key:

export ANTHROPIC_API_KEY=sk-ant-...

Usage

Claude Desktop

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

{
  "mcpServers": {
    "legalforge": {
      "command": "node",
      "args": ["/path/to/legalforge-mcp/dist/index.js"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Programmatic

echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"generate_legal_document","arguments":{"documentType":"privacy","parties":[{"name":"Acme Inc","role":"company","email":"legal@acme.com"}],"terms":{"websiteUrl":"https://acme.com","siteName":"Acme","services":"Google Analytics, Stripe, Intercom"},"jurisdiction":"California, USA"}}}' | node dist/index.js

Tool: generate_legal_document

Inputs

ParameterTypeRequiredDescription
documentType"privacy" | "terms" | "cookie"Type of legal document
partiesParty[]Parties involved (company, users)
termsRecord<string, string>Document configuration
jurisdictionstringLegal jurisdiction

Party Object

FieldTypeRequiredDescription
namestringParty name
role"company" | "user" | "provider"Role
addressstring-Physical address
emailstring-Contact email

Terms Object

KeyDescription
websiteUrlWebsite URL
siteNameDisplay name for the site
servicesComma-separated list of services/technologies

Output

Returns HTML document content (starting from <h2> tags).

Example

const result = await mcpClient.callTool("generate_legal_document", {
  documentType: "privacy",
  parties: [
    {
      name: "TechStartup Inc",
      role: "company",
      email: "privacy@techstartup.com"
    }
  ],
  terms: {
    websiteUrl: "https://techstartup.com",
    siteName: "TechStartup",
    services: "Google Analytics, Stripe, AWS, Intercom"
  },
  jurisdiction: "European Union"
});

console.log(result.content[0].text); // HTML privacy policy

Development

npm run dev  # Run with tsx (hot reload)
npm run build  # Compile TypeScript
npm start  # Run compiled version

Template Usage

This MCP server serves as a template for building other MCP servers. Key patterns:

  1. Tool registration with Zod schemas for validation
  2. Prompt engineering with structured templates
  3. Error handling with proper MCP error responses
  4. Clean TypeScript setup with ESM modules

License

MIT

Reviews

No reviews yet

Sign in to write a review