Cerebra Legal MCP Server
Cerebra Legal MCP サーバー
Anthropic のエンジニアリング ブログの「think」ツール コンセプトに基づいた、法的推論および分析用のエンタープライズ グレードの MCP サーバーです。
概要
Cerebra Legal は、法的推論と分析のための 3 つの強力なツールを提供します。
legal_think - ドメイン固有のガイダンスとテンプレートを使用して複雑な法的問題を分析するのに役立つ構造化された法的推論ツール。
legal_ask_followup_question - ドメイン固有のオプションを使用して、法的な文脈でフォローアップの質問をするための専用ツール。
legal_attempt_completion - 適切な構造と引用形式で法的分析結果を提示するためのツール。
サーバーは、法的ドメイン (ANSC の異議申し立て、消費者保護、契約分析) を自動的に検出し、ドメイン固有のガイダンス、テンプレート、およびフィードバックを提供します。
Related MCP server: Codebase Intelligence MCP Server
特徴
ドメイン検出: 分析の法的ドメインを自動的に識別します
分野別ガイダンス:さまざまな法的分野に合わせたガイダンスを提供します
構造化テンプレート: 法的分析のためのドメイン固有のテンプレートを提供します
引用フォーマット: 法的な引用を適切にフォーマットします
思考の質の分析:法的推論の質に関するフィードバックを提供する
修正サポート: 以前の考えを修正できます
インストール
# 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 build使用法
サーバーの実行
npm startサーバーのテスト
リポジトリには、サーバーと対話する方法を示すテスト クライアントが含まれています。
# Make the test client executable
chmod +x test-client.js
# Run the test client
./test-client.jsテスト クライアントは次のことを実行します。
サーバーを起動する
利用可能なツールを取得するには、ツール/リストリクエストを送信してください
サンプルの考えを添えてlegal_thinkリクエストを送信してください
サーバーの応答を表示する
クロードに追加
サーバーを Claude に追加するには、次の構成で MCP 設定ファイルを更新します。
VSCode拡張機能の場合
~/.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": []
}
}
}Claudeデスクトップアプリ用
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) またはプラットフォーム上の同等のファイルを編集します。
{
"mcpServers": {
"cerebra-legal": {
"command": "node",
"args": ["/path/to/mcp-cerebra-legal-server/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}クロードのツールを使う
サーバーが Claude に追加されると、会話でツールを使用できるようになります。
システムプロンプト統合
これらの法的ツールとAIの最適なインタラクションを実現するには、システムプロンプトに適切なガイダンスを含めることが不可欠です。これらのツールは、標準的なClineツールと同じAI→人間インタラクションモデルに準拠していますが、ドメイン固有の機能強化が加えられています。
システム プロンプトには、各ツールの詳細なドキュメントが含まれている必要があります。
## 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>このガイダンスにより、AI は次のことを理解できるようになります。
これらは標準ツールの特殊バージョンです
AI→人間のインタラクションフローは同じままです
追加の機能とパラメータがあります
ツール呼び出しを適切にフォーマットする方法
このガイダンスがなければ、AI はこれらのツールに組み込まれているドメイン固有の機能を十分に活用できない可能性があります。
1. legal_think の使用
legal_think ツールは、構造化された思考で複雑な法的問題を分析するのに役立ちます。
I need to analyze an ANSC contestation where a claimant argues that technical specifications in a tender were too restrictive.Claude は legal_think ツールを使用して次のことを行います。
法的ドメインの検出(ANSCの異議申し立て)
ドメイン固有のガイダンスを提供する
分析のための構造化されたテンプレートを提供する
法的推論の質に関するフィードバックを与える
以前の考えの修正をサポートする
2. legal_ask_followup_question の使用
クロードが法的な分析を完了するためにさらに情報を必要とする場合:
What specific provisions of the technical specifications are being challenged?Claude は legal_ask_followup_question ツールを使用して次のことを行います。
適切な法律用語を使用して質問をフォーマットする
ユーザーが選択できるドメイン固有のオプションを提供する
コンテキスト認識質問のための法的ドメインを検出する
3. legal_attempt_completion の使用
クロードが最終的な法的分析を発表する準備ができたら、次のようになります。
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 は legal_attempt_completion ツールを使用して次のことを行います。
適切な法的構造で結論をフォーマットする
法的引用の抽出とフォーマット
分析を明確なセクションに整理する
プロフェッショナルな法的文書フォーマットを提供する
ツール入力スキーマ
法律上の考え方
{
"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
}法的質問のフォローアップ
{
"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
}法的試みの完了
{
"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
}建築
サーバーはモジュラー アーキテクチャで構築されています。
ドメイン検出器: 分析の法的ドメインを識別します
法律知識ベース: 分野固有のガイダンスとテンプレートを提供します
引用フォーマッタ:法的な引用を適切にフォーマットします
ツール実装:各ツールのロジックを処理します
発達
プロジェクト構造
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.json建物
npm run buildテスト
# Run the test client
./test-client.jsリポジトリ
このプロジェクトは、GitHub のhttps://github.com/yoda-digital/mcp-cerebra-legal-serverから入手できます。
参考文献
ライセンス
マサチューセッツ工科大学
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
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | The legal question to ask the user | |
| options | No | An array of 2-5 options for the user to choose from (optional) | |
| context | No | Additional context about the legal issue (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It lists 'Key features' like 'Automatic detection of legal domains' and 'Legal terminology formatting,' which hint at functionality, but fails to disclose critical behavioral traits such as whether this tool modifies data, requires specific permissions, has rate limits, or what the output looks like. For a tool with no annotations, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections ('When to use this tool,' 'Key features'), making it easy to scan. It's appropriately sized with no redundant sentences, though it could be slightly more concise by integrating some points. Every sentence adds value, such as explaining domain-specific options.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (legal domain tool with 3 parameters, no annotations, no output schema), the description is partially complete. It covers purpose and usage well but lacks details on behavioral aspects and output. Without annotations or an output schema, the description should do more to explain what happens when the tool is invoked, but it provides enough context for basic use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters (question, options, context) with descriptions. The description adds no additional meaning beyond the schema, such as examples or usage tips for parameters. The baseline score of 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as 'asking follow-up questions in legal contexts' and 'gather additional information needed for legal analysis,' which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like legal_attempt_completion or legal_think, leaving some ambiguity about when to choose this tool over alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes a 'When to use this tool' section with four clear scenarios (e.g., 'When you need additional information to complete a legal analysis'), providing explicit guidance on appropriate contexts. It lacks explicit exclusions or comparisons to sibling tools, but the scenarios are well-defined and helpful.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The legal analysis result or conclusion | |
| command | No | A CLI command to execute (optional) | |
| context | No | Additional context about the legal issue (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but provides minimal behavioral disclosure. It mentions formatting features but doesn't address permissions needed, whether it modifies data, rate limits, error conditions, or what the output looks like. For a tool with 3 parameters and no output schema, this leaves significant gaps in understanding how the tool actually behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (purpose, usage guidelines, key features) and efficiently communicates core information. While slightly verbose in listing multiple 'when to use' examples, each sentence adds value and the overall length is appropriate for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters, no annotations, and no output schema, the description provides adequate purpose and usage context but lacks sufficient behavioral details. It explains what the tool does and when to use it, but doesn't adequately address how it works, what permissions are needed, or what the output format will be. This leaves gaps for a tool that presumably generates formatted legal documents.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds no specific information about parameter usage, relationships, or examples beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting, though the description could have explained how parameters interact with the formatting features mentioned.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'presenting legal analysis results and conclusions' with specific functions like formatting, citation extraction, and document structuring. It distinguishes from sibling tools (legal_ask_followup_question, legal_think) by focusing on final presentation rather than analysis or questioning, though it doesn't explicitly name these alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'When to use this tool' section provides clear context: presenting final results, summarizing findings, providing structured opinions, and concluding legal reasoning. It implicitly distinguishes from siblings by focusing on completion rather than intermediate steps, but doesn't explicitly state when NOT to use it or name specific alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | The main legal reasoning content | |
| category | No | Category of legal reasoning (optional, will be auto-detected if not provided) | |
| references | No | References to laws, regulations, precedents, or previous thoughts (optional) | |
| isRevision | No | Whether this thought revises a previous legal reasoning (optional) | |
| revisesThoughtNumber | No | The thought number being revised (if isRevision is true) | |
| requestGuidance | No | Set to true to receive domain-specific legal guidance | |
| requestTemplate | No | Set to true to receive a template for this type of legal reasoning | |
| thoughtNumber | Yes | Current thought number | |
| totalThoughts | Yes | Estimated total thoughts needed | |
| nextThoughtNeeded | Yes | Whether another thought step is needed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions key features like automatic domain detection, guidance/templates, citation support, revision capabilities, and thought quality feedback, which gives useful context about how the tool behaves. However, it doesn't address important behavioral aspects like whether this is a read-only analysis tool or if it modifies data, what permissions might be needed, or any rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (purpose, when to use, key features) and each sentence adds value. It's appropriately sized for a complex tool with 10 parameters, though the 'Key features' section could be more concise as some items overlap with earlier content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex legal reasoning tool with 10 parameters and no annotations or output schema, the description provides good purpose and usage context but has significant gaps. It doesn't explain what the tool outputs (no output schema), doesn't address behavioral constraints, and while it mentions legal domains, it doesn't fully explain how the complex parameter set works together for the reasoning process.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 10 parameters thoroughly. The description doesn't add any specific parameter information beyond what's in the schema - it mentions general capabilities like domain detection and revision, but doesn't explain how parameters like 'category' or 'isRevision' relate to these features. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as 'structured legal reasoning that helps analyze complex legal issues' and mentions specific legal domains like ANSC contestations, consumer protection, and contract analysis. It distinguishes itself from siblings by focusing on reasoning rather than follow-up questions or completion attempts, though it doesn't explicitly contrast with them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'When to use this tool' section provides clear guidance on four specific scenarios like breaking down complex legal problems and analyzing legal requirements. It doesn't mention when NOT to use it or explicitly name sibling tools as alternatives, but the context is well-defined for legal reasoning tasks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
- First observed
legal_ask_followup_question - First observed
legal_attempt_completion - First observed
legal_think
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
Hybrid human + AI expertise for faster, trusted answers and decisions via MCP Server.
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
AI governance MCP server for EU AI Act compliance and jurisdiction verification
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
- AlicenseAqualityCmaintenanceMCP server providing comprehensive Korean legal data access (laws, precedents, regulations, ordinances) with citation verification, temporal comparison, impact graphs, and legal research workflows.103,567 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