Cerebra Legal MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cerebra Legal MCP Server analyze this non-compete clause for enforceability in California"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cerebra Legal MCP Server
An enterprise-grade MCP server for legal reasoning and analysis based on the "think" tool concept from Anthropic's engineering blog.
Overview
Cerebra Legal provides three powerful tools for legal reasoning and analysis:
legal_think - A structured legal reasoning tool that helps analyze complex legal issues with domain-specific guidance and templates.
legal_ask_followup_question - A specialized tool for asking follow-up questions in legal contexts with domain-specific options.
legal_attempt_completion - A tool for presenting legal analysis results with proper structure and citation formatting.
The server automatically detects legal domains (ANSC contestation, consumer protection, contract analysis) and provides domain-specific guidance, templates, and feedback.
Related MCP server: Codebase Intelligence MCP Server
Features
Domain Detection: Automatically identifies the legal domain of the analysis
Domain-Specific Guidance: Provides tailored guidance for different legal domains
Structured Templates: Offers domain-specific templates for legal analysis
Citation Formatting: Properly formats legal citations
Thought Quality Analysis: Provides feedback on legal reasoning quality
Revision Support: Allows for revising previous thoughts
Installation
# Clone the repository
git clone https://github.com/yoda-digital/mcp-cerebra-legal-server.git
cd mcp-cerebra-legal-server
# Install dependencies
npm install
# Build the project
npm run buildUsage
Running the Server
npm startTesting the Server
The repository includes a test client that demonstrates how to interact with the server:
# Make the test client executable
chmod +x test-client.js
# Run the test client
./test-client.jsThe test client will:
Start the server
Send a tools/list request to get available tools
Send a legal_think request with a sample thought
Display the server's responses
Adding to Claude
To add the server to Claude, update your MCP settings file with the following configuration:
For VSCode Extension
Edit the file at ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json:
{
"mcpServers": {
"cerebra-legal": {
"command": "node",
"args": ["/path/to/mcp-cerebra-legal-server/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}For Claude Desktop App
Edit the file at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your platform:
{
"mcpServers": {
"cerebra-legal": {
"command": "node",
"args": ["/path/to/mcp-cerebra-legal-server/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}Using the Tools in Claude
Once the server is added to Claude, you can use the tools in your conversations:
System Prompt Integration
For optimal AI interaction with these legal tools, it's essential to include proper guidance in the system prompt. These tools follow the same AI → Human interaction model as standard Cline tools but with domain-specific enhancements.
The system prompt should include detailed documentation for each tool:
## legal_think
Description: A structured legal reasoning tool that helps analyze complex legal issues with domain-specific guidance and templates. This tool enables step-by-step legal analysis with feedback on reasoning quality.
Parameters:
- thought: (required) The current legal reasoning step
- thoughtNumber: (required) Current thought number in sequence
- totalThoughts: (required) Estimated total thoughts needed
- nextThoughtNeeded: (required) Whether another thought step is needed
- category: (optional) Legal domain category (auto-detected if not provided)
- references: (optional) Array of legal references
- isRevision: (optional) Whether this revises previous thinking
- revisesThoughtNumber: (optional) Which thought is being reconsidered
- requestGuidance: (optional) Whether to request domain-specific guidance
- requestTemplate: (optional) Whether to request a domain-specific template
Usage:
<legal_think>
<thought>Your legal reasoning step here</thought>
<thoughtNumber>Current thought number</thoughtNumber>
<totalThoughts>Estimated total thoughts</totalThoughts>
<nextThoughtNeeded>true or false</nextThoughtNeeded>
<category>Legal domain (optional)</category>
<references>Array of references (optional)</references>
<isRevision>true or false (optional)</isRevision>
<revisesThoughtNumber>Thought number being revised (optional)</revisesThoughtNumber>
<requestGuidance>true or false (optional)</requestGuidance>
<requestTemplate>true or false (optional)</requestTemplate>
</legal_think>
## legal_ask_followup_question
Description: Ask the user a legal domain-specific question to gather additional information needed to complete the task. This tool enhances the standard ask_followup_question with legal domain detection, terminology formatting, and domain-specific suggested options.
Parameters:
- question: (required) The question to ask the user. This will be automatically enhanced with appropriate legal terminology.
- options: (optional) An array of 2-5 options for the user to choose from. If not provided, domain-specific options will be automatically suggested.
- context: (optional) Additional context to help with domain detection and question formatting.
Usage:
<legal_ask_followup_question>
<question>Your question here</question>
<options>
Array of options here (optional), e.g. ["Option 1", "Option 2", "Option 3"]
</options>
<context>Additional context to help with domain detection (optional)</context>
</legal_ask_followup_question>
## legal_attempt_completion
Description: Present the result of your work to the user with proper legal structure and formatting. This tool enhances the standard attempt_completion with legal domain detection, document structuring, and citation formatting.
Parameters:
- result: (required) The result of the task. This will be automatically formatted with proper legal structure.
- command: (optional) A CLI command to execute to show a live demo of the result to the user.
- context: (optional) Additional context to help with domain detection and result formatting.
Usage:
<legal_attempt_completion>
<result>
Your final result description here
</result>
<command>Command to demonstrate result (optional)</command>
<context>Additional context to help with domain detection (optional)</context>
</legal_attempt_completion>This guidance ensures the AI understands:
These are specialized versions of standard tools
They maintain the same AI → Human interaction flow
They have additional capabilities and parameters
How to properly format the tool calls
Without this guidance, the AI might not fully leverage the domain-specific capabilities built into these tools.
1. Using legal_think
The legal_think tool helps you analyze complex legal issues with structured thinking:
I need to analyze an ANSC contestation where a claimant argues that technical specifications in a tender were too restrictive.Claude will use the legal_think tool to:
Detect the legal domain (ANSC contestation)
Provide domain-specific guidance
Offer a structured template for analysis
Give feedback on the quality of legal reasoning
Support revision of previous thoughts
2. Using legal_ask_followup_question
When Claude needs more information to complete a legal analysis:
What specific provisions of the technical specifications are being challenged?Claude will use the legal_ask_followup_question tool to:
Format the question with appropriate legal terminology
Provide domain-specific options for the user to choose from
Detect the legal domain for context-aware questioning
3. Using legal_attempt_completion
When Claude is ready to present the final legal analysis:
Based on my analysis, the technical specifications requiring "minimum 5 years experience" appear disproportionate and likely violate Article 33(2) of Law 131/2015 on public procurement.Claude will use the legal_attempt_completion tool to:
Format the conclusion with proper legal structure
Extract and format legal citations
Organize the analysis into clear sections
Provide a professional legal document format
Tool Input Schemas
legal_think
{
"thought": "Analyzing ANSC contestation where claimant argues technical specifications were too restrictive.",
"thoughtNumber": 1,
"totalThoughts": 5,
"nextThoughtNeeded": true,
"category": "ansc_contestation", // Optional, auto-detected if not provided
"references": ["Law 131/2015", "ANSC Decision #12345"], // Optional
"isRevision": false, // Optional
"revisesThoughtNumber": null, // Optional
"requestGuidance": true, // Optional
"requestTemplate": true // Optional
}legal_ask_followup_question
{
"question": "What specific provisions of the technical specifications are being challenged?",
"options": [ // Optional, auto-generated if not provided
"Are you challenging the experience requirements?",
"Are you challenging the technical capacity requirements?",
"Are you challenging the financial requirements?",
"Are you challenging the certification requirements?"
],
"context": "ANSC contestation regarding procurement of IT equipment" // Optional
}legal_attempt_completion
{
"result": "Based on the analysis of ANSC contestation #12345, the technical specifications requiring 'minimum 5 years experience' appear disproportionate and likely violate Article 33(2) of Law 131/2015 on public procurement.",
"command": null, // Optional
"context": "ANSC contestation analysis" // Optional
}Architecture
The server is built with a modular architecture:
Domain Detector: Identifies the legal domain of the analysis
Legal Knowledge Base: Provides domain-specific guidance and templates
Citation Formatter: Formats legal citations properly
Tool Implementations: Handles the logic for each tool
Development
Project Structure
mcp-cerebra-legal-server/
├── src/
│ ├── shared/ # Shared components
│ │ ├── DomainDetector.ts
│ │ ├── LegalKnowledgeBase.ts
│ │ ├── CitationFormatter.ts
│ │ └── types.ts
│ ├── tools/ # Tool implementations
│ │ ├── LegalThinkTool.ts
│ │ ├── LegalAskFollowupQuestionTool.ts
│ │ └── LegalAttemptCompletionTool.ts
│ ├── utils/ # Utilities
│ │ └── logger.ts
│ └── index.ts # Main server entry point
├── build/ # Compiled JavaScript
├── test-client.js # Test client
├── package.json
└── tsconfig.jsonBuilding
npm run buildTesting
# Run the test client
./test-client.jsRepository
This project is available on GitHub at: https://github.com/yoda-digital/mcp-cerebra-legal-server
References
The "think" tool: Enabling Claude to stop and think in complex tool use situations - Anthropic Engineering Blog
License
MIT
Available Tools
3 toolslegal_ask_followup_questionB
A specialized tool for asking follow-up questions in legal contexts. This tool helps gather additional information needed for legal analysis by formulating precise questions with domain-specific options.
When to use this tool:
When you need additional information to complete a legal analysis
When clarification is needed on specific legal points
When gathering evidence or documentation for a legal case
When exploring alternative legal interpretations
Key features:
Automatic detection of legal domains
Domain-specific question suggestions
Legal terminology formatting
Structured options for efficient information gathering
Inputs: question (required), options, context.
legal_attempt_completionB
A specialized tool for presenting legal analysis results and conclusions. This tool formats legal conclusions with proper structure, extracts and formats citations, and provides a professional legal document format.
When to use this tool:
When presenting the final results of a legal analysis
When summarizing legal findings and recommendations
When providing a structured legal opinion
When concluding a legal reasoning process
Key features:
Automatic detection of legal domains
Proper legal document formatting
Citation extraction and formatting
Structured sections for clear communication
Inputs: result (required), command, context.
legal_thinkA
A powerful tool for structured legal reasoning that helps analyze complex legal issues. This tool provides domain-specific guidance and templates for different legal areas including ANSC contestations, consumer protection, and contract analysis.
When to use this tool:
Breaking down complex legal problems into structured steps
Analyzing legal requirements and compliance
Verifying that all elements of a legal test are addressed
Building comprehensive legal arguments with proper citations
Key features:
Automatic detection of legal domains
Domain-specific guidance and templates
Support for legal citations and references
Revision capabilities for refining legal arguments
Thought quality feedback
Inputs: thought (required), thoughtNumber (required), totalThoughts (required), nextThoughtNeeded (required), +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: legal_think is for structured reasoning and analysis, legal_ask_followup_question is for gathering additional information, and legal_attempt_completion is for presenting final conclusions. The descriptions reinforce these distinct roles with no overlap in core functionality.
All tools follow a consistent 'legal_' prefix with descriptive action names (think, ask_followup_question, attempt_completion), using snake_case uniformly. This pattern makes the tool set predictable and easy to navigate.
With only 3 tools, the set feels thin for a legal analysis domain, potentially lacking operations like document retrieval, case law lookup, or specific legal research functions. While the tools cover reasoning, questioning, and completion, the scope suggests more tools might be needed for comprehensive legal workflows.
The tool set is severely incomplete for legal analysis, missing essential operations such as accessing legal databases, retrieving statutes or case law, validating citations, or drafting legal documents. The existing tools focus only on internal reasoning and presentation, leaving significant gaps that would hinder an agent's ability to perform thorough legal tasks.
Maintenance
Related MCP Connectors
B2B, GovCon & LegalTech MCP server for live RFPs, contract parsing, compliance & proposal tools.
MCP server for FCA Handbook compliance analysis with verbatim citations.
Hybrid human + AI expertise for faster, trusted answers and decisions via MCP Server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA specialized MCP server for Argentine legal professionals, enabling legal research, document processing, case analysis, and practice management through integration with official Argentine legal databases.8MIT
- AlicenseNot gradedqualityDmaintenanceA production-grade MCP server providing advanced code intelligence capabilities such as semantic search, dependency analysis, and natural language Q&A across multiple programming languages.MIT
- AlicenseAqualityDmaintenanceMCP server providing comprehensive Korean legal data access (laws, precedents, regulations, ordinances) with citation verification, temporal comparison, impact graphs, and legal research workflows.103,196 npmMIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server for Indian legal work that enables case-law research with verified citations, limitation and deadline calculations, legal document drafting, matter tracking, and contract search.1Apache 2.0