Skip to main content
Glama
oranger07
by oranger07

mcp-law-server

审计法规智能检索 MCP Server —— 面向审计 Agent 的法规/条款/审计事项检索与核实服务。

Milvus 向量检索(法规名 / 条款 / 审计事项)+ MySQL 关系查询(层级 / 分类)+ Agent 核实

技术栈

选型

语言 / 运行时

Python 3.12

包管理 / 构建

uv + hatchling(src-layout)

MCP 框架

FastMCP(HTTP transport,uvicorn/ASGI)

MySQL 访问

SQLAlchemy 2.x async + asyncmy(双库:MAIN / TOOLS)

向量库

Milvus(pymilvus),库 sys_law_title

Embedding

BGE-large-zh-v1.5,1024 维(本地 FlagEmbedding 推理,按需安装)

配置

pydantic-settings + .env

编排(平台侧)

Hermes YAML workflow + Agent prompts(hermes/,非 Python)

Related MCP server: hivelaw

目录结构

mcp_law_server/
├── pyproject.toml            # 元数据 / 依赖 / 入口 / 工具配置
├── .env.example              # 环境变量模板(复制为 .env 填写)
├── Makefile                  # 常用命令封装
├── src/mcp_law_server/       # ── 应用代码(src-layout,可 pip install -e .)──
│   ├── main.py               # 入口
│   ├── config/               # 配置层(无内部依赖)—— settings 单例
│   ├── models/               # 数据模型层(仅依赖 config)—— enums / schemas / errors
│   ├── db/                   # MySQL 数据访问层 —— connection + 4 个 DAO
│   ├── vector/               # Milvus 向量访问层 —— client + 3 个 search
│   ├── embedding/            # Embedding 服务层 —— bge_embedder
│   ├── cache/                # 缓存层 —— registry_cache
│   ├── tools/                # MCP 工具层 —— 9 个 tool handler(核心业务)
│   └── server/               # MCP Server 注册与启动 —— mcp_app
├── hermes/                   # ── Hermes 编排(平台侧,YAML + prompts,非 Python)──
├── scripts/                  # ── 运维脚本(向量化入库 / 阈值校准 / 数据探查)──
└── tests/                    # ── 测试(db / vector / tools / integration)──

依赖方向(从下到上,禁止反向引用): config → models → {db, vector, embedding, cache} → tools → server → main

快速开始

# 1. 安装核心 + 开发依赖(uv 会自动准备 Python 3.12 解释器)
uv sync

# 2. (按需)安装 ML 依赖(FlagEmbedding / torch,体积较大)
uv sync --extra ml

# 3. 配置环境变量
cp .env.example .env          # 然后编辑 .env 填写真实值

# 4. 启动 MCP HTTP server
uv run mcp-law-server         # 等价:make run

Windows 若未安装 make,直接用上面的 uv 命令即可,Makefile 仅做封装。

常用命令

命令

说明

make sync / uv sync

安装核心 + 开发依赖

make sync-ml

额外安装 ML 依赖

make run

启动 MCP server

make test

运行测试

make lint / make format / make typecheck

代码质量

make clean

清理缓存与 venv

环境变量

.env.example,字段与 src/mcp_law_server/config/settings.py 一一对应。

Install Server
F
license - not found
B
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oranger07/mcp_law_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server