Cerebra Legal MCP Server

Cerebra Legal MCP サーバー

Anthropic のエンジニアリング ブログの「think」ツール コンセプトに基づいた、法的推論および分析用のエンタープライズ グレードの MCP サーバーです。

概要

Cerebra Legal は、法的推論と分析のための 3 つの強力なツールを提供します。

  1. legal_think - ドメイン固有のガイダンスとテンプレートを使用して複雑な法的問題を分析するのに役立つ構造化された法的推論ツール。
  2. legal_ask_followup_question - ドメイン固有のオプションを使用して、法的な文脈でフォローアップの質問をするための専用ツール。
  3. legal_attempt_completion - 適切な構造と引用形式で法的分析結果を提示するためのツール。

サーバーは、法的ドメイン (ANSC の異議申し立て、消費者保護、契約分析) を自動的に検出し、ドメイン固有のガイダンス、テンプレート、およびフィードバックを提供します。

特徴

  • ドメイン検出: 分析の法的ドメインを自動的に識別します
  • 分野別ガイダンス:さまざまな法的分野に合わせたガイダンスを提供します
  • 構造化テンプレート: 法的分析のためのドメイン固有のテンプレートを提供します
  • 引用フォーマット: 法的な引用を適切にフォーマットします
  • 思考の質の分析:法的推論の質に関するフィードバックを提供する
  • 修正サポート: 以前の考えを修正できます

インストール

# 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

テスト クライアントは次のことを実行します。

  1. サーバーを起動する
  2. 利用可能なツールを取得するには、ツール/リストリクエストを送信してください
  3. サンプルの考えを添えてlegal_thinkリクエストを送信してください
  4. サーバーの応答を表示する

クロードに追加

サーバーを 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 は次のことを理解できるようになります。

  1. これらは標準ツールの特殊バージョンです
  2. AI→人間のインタラクションフローは同じままです
  3. 追加の機能とパラメータがあります
  4. ツール呼び出しを適切にフォーマットする方法

このガイダンスがなければ、AI はこれらのツールに組み込まれているドメイン固有の機能を十分に活用できない可能性があります。

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の異議申し立て)
  • ドメイン固有のガイダンスを提供する
  • 分析のための構造化されたテンプレートを提供する
  • 法的推論の質に関するフィードバックを与える
  • 以前の考えの修正をサポートする

クロードが法的な分析を完了するためにさらに情報を必要とする場合:

What specific provisions of the technical specifications are being challenged?

Claude は legal_ask_followup_question ツールを使用して次のことを行います。

  • 適切な法律用語を使用して質問をフォーマットする
  • ユーザーが選択できるドメイン固有のオプションを提供する
  • コンテキスト認識質問のための法的ドメインを検出する

クロードが最終的な法的分析を発表する準備ができたら、次のようになります。

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から入手できます。

参考文献

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

法的推論と分析のための専門ツールを提供し、法的ドメインを自動的に検出し、ドメイン固有のガイダンス、テンプレート、引用フォーマットを提供するエンタープライズ グレードの MCP サーバーです。

  1. Overview
    1. Features
      1. Installation
        1. Usage
          1. Running the Server
          2. Testing the Server
          3. Adding to Claude
          4. Using the Tools in Claude
          5. System Prompt Integration
          6. Tool Input Schemas
        2. Architecture
          1. Development
            1. Project Structure
            2. Building
            3. Testing
          2. Repository
            1. References
              1. License
                ID: xzzvuvljs9