home / mcp / legalforge mcp server

LegalForge MCP Server

Provides an MCP interface to generate privacy, terms, and cookie policies using AI.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "automatikstudio-legalforge-mcp": {
      "command": "node",
      "args": [
        "/path/to/legalforge-mcp/dist/index.js"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

LegalForge MCP Server enables you to generate professional legal documents such to privacy policies, terms of service, and cookie policies by leveraging AI. This server-focused setup lets you integrate automated document generation into your workflows via an MCP client, keeping configurations explicit and secure while delivering HTML outputs ready for embedding into your site or app.

How to use

You will run the MCP server locally or in your environment and connect to it with a compatible MCP client. Use the available tool to generate a legal document by providing the document type, involved parties, site configuration, and jurisdiction. The server will return an HTML document beginning with header sections that you can render in your application.

How to install

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Set your API key for the AI provider before starting the server. You will supply the key via an environment variable to enable the server to generate documents.

Additional notes

Starting the MCP server requires running the runtime command shown in the local development setup. The server exposes a programmatic and desktop integration path that you can leverage from your client. Ensure your environment has Node.js and npm installed, and that you have a valid AI API key configured in your environment before launching.

Security and configuration tips

- Keep your API key secure. Do not commit it to code repositories. Use environment management to supply the key at runtime.

- Validate inputs from clients to prevent malformed documents. Use the built-in tool validation to ensure required fields are present.

Examples and usage scenarios

Create a privacy policy for a company operating in the European Union with a given set of services and a specified site name. Pass the company name, role, and contact email, along with the site URL, site name, and a comma-separated list of services.

Available tools

generate_legal_document

Generates an HTML document for a specified legal type (privacy, terms, or cookie) using provided party details, website configuration, and jurisdiction. Returns an HTML snippet starting with <h2> tags for embedding.