Law Office SQLite MCP Server

by asirulnik
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Powers the law office database that handles client data, case management, billable time tracking, and invoice generation with specialized legal tools for proper documentation and billing validation

律师事务所 SQLite MCP 服务器

用于律师事务所数据库管理的模型上下文协议 (MCP) 服务器实现,专门用于客户记录、案件归档、时间跟踪和发票管理。

概述

该服务器为律师事务所提供专门的数据库接口,用于:

  • 管理客户和事务记录
  • 跟踪案件档案条目(文件、通讯、笔记)
  • 记录计费时间,并提供与案件活动相关的证据链接
  • 创建并验证客户发票
  • 执行业务规则以确保正确合法的计费

特征

核心数据库操作

  • 标准 SQL 操作(SELECT、INSERT、UPDATE、DELETE)
  • 表管理和架构信息
  • 通过execute_script工具进行多语句事务和批量操作

专业法律工具

  • record_case_entry :向案件档案添加文档
  • record_billable_time :记录时间并提供适当的证据
  • get_unbilled_time :按客户或事项跟踪未开票工作
  • create_invoice :生成新的客户发票
  • add_billing_to_invoice :将时间条目与发票关联
  • check_invoice_validity :验证发票是否存在账单冲突
  • submit_invoice :完成客户提交的发票

数据库架构

  • 客户和事务管理
  • 案卷文献系统
  • 全面的计费和发票工作流程
  • 自动时间戳管理
  • 重叠时间条目的冲突检测

安装

先决条件

  • Python 3.10 或更高版本(推荐 Python 3.11+) 。请使用python3.11 --version (或类似命令)进行检查。如有需要,请使用系统的包管理器进行安装(例如,在 macOS 上brew install python@3.11 )。
  • uv :一个快速的 Python 软件包安装程序。通过astral.sh安装( curl -LsSf https://astral.sh/uv/install.sh | sh )。
  • SQLite3 (通常预装在 macOS/Linux 上)。
  • Git(用于克隆)。

设置说明

  1. 克隆存储库:
    git clone <repository_url> # Replace with your repo URL cd mcp-law-office-db # Or your repository directory name
  2. 创建并激活虚拟环境(使用 Python 3.10+ 解释器):
    # Replace python3.11 with your specific version (e.g., python3.10) python3.11 -m venv .venv source .venv/bin/activate
    (您应该在终端提示符的开头看到(.venv)
  3. 升级 pip(可选但建议):
    python3 -m pip install --upgrade pip
  4. 使用uv安装依赖项:( 这将安装mcp及其附加组件,以及pydantic
    uv pip install "mcp[cli]" "pydantic>=2.0.0"
  5. 以可编辑模式安装项目包:
    pip install -e .
  6. 初始化数据库:( 此脚本设置 SQLite 模式)
    python setup_law_office.py
    (根据提示可选择添加样本数据)

用法

手动启动服务器(用于测试)

确保您的虚拟环境处于活动状态( source .venv/bin/activate )并运行:

python run_server.py --db-path ./database/law_office.db

Claude 桌面集成(推荐)

  1. 找到您的claude_desktop_config.json文件。
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. **添加或修改此服务器的mcpServers条目。**<absolute_path_to_repo>替换为您克隆仓库的完整路径(例如, /Users/andrewsirulnik/claude_mcp_servers/mcp-law-office-db )。
    { "mcpServers": { "law-office_db": { "command": "<absolute_path_to_repo>/.venv/bin/python3", "args": [ "<absolute_path_to_repo>/run_server.py", "--db-path", "<absolute_path_to_repo>/database/law_office.db" ], "cwd": "<absolute_path_to_repo>" } // Add other servers here if needed } // Other Claude Desktop settings... }
  3. 保存配置文件。
  4. **重启 Claude Desktop。**服务器现在应该可以在 MCP 集成菜单中使用了。
-
security - not tested
F
license - not found
-
quality - not tested

用于律师事务所数据库管理的模型上下文协议服务器,可跟踪客户、案件、计费时间和发票。

  1. Overview
    1. Features
      1. Core Database Operations
      2. Specialized Legal Tools
      3. Database Schema
    2. Installation
      1. Prerequisites
      2. Setup Instructions
    3. Usage
      1. Starting the Server Manually (for testing)
    4. Claude Desktop Integration (Recommended)
      ID: f7p3c7cic3