1. Conduid
  2. AI
  3. Pkulaw MCP Router
MCP server · AI

Pkulaw MCP Router

Merge multiple PKULAW MCP sub-services into one local MCP server.

37Low

Scored 5 months ago · breakdown

About Pkulaw MCP Router

Pkulaw MCP Router is an MCP server in the AI category: merge multiple PKULAW MCP sub-services into one local MCP server.

Install

Claude Code
claude mcp add pkulaw-mcp-router -- npx -y pkulaw-mcp-router
npx
npx -y pkulaw-mcp-router

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Pkulaw MCP Router

Powered by Claude · Grounded in docs

I know everything about Pkulaw MCP Router. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

pkulaw-mcp-router

中文说明|English README

把多个北大法宝 MCP 子服务聚合成一个本地 MCP 入口。

npm

  • npm: https://www.npmjs.com/package/pkulaw-mcp-router

项目简介

北大法宝目前把不少 MCP 能力拆成了多个独立服务地址。
这种做法便于平台按产品、权限和业务线管理,但对终端用户并不友好:

  • 同一个 token,往往需要重复配置多个 MCP 服务
  • 很多服务之间的差别,主要只是 URL 的最后一段
  • 客户端被迫承担了不必要的配置复杂度

pkulaw-mcp-router 的目标很简单:

在不改动上游服务的前提下,把多个北大法宝远程 MCP 子服务重新聚合成一个本地 MCP 服务。

这样,客户端只需要连接一个入口,模型就可以在一个统一工具箱里按需调用工具。

设计理念

  • 不替代上游:保留北大法宝原有 MCP 服务形态
  • 本地做聚合:把拆散的服务重新还原成统一入口
  • 把复杂度留在适配层:客户端仍然只接一个 MCP
  • 保持透明:服务发现、可用性探测、工具映射都可以检查
  • 采用主流实现方式:基于 npm、TypeScript 和 @modelcontextprotocol/sdk

功能

  • 抓取 https://mcp.pkulaw.com/apis 的公开目录
  • 访问各子页 Swagger,提取真实服务地址
  • 探测当前 token 实际可用的子服务
  • 聚合多个远程 MCP 工具
  • 通过一个本地 stdio MCP 服务统一暴露
  • 自动处理工具重名冲突

安装

方式一:通过 npx 直接使用

发布到 npm 后,可直接运行:

npx -y pkulaw-mcp-router@latest serve --config /path/to/pkulaw-mcp-router.toml

方式二:全局安装

npm install -g pkulaw-mcp-router
pkulaw-mcp-router serve --config /path/to/pkulaw-mcp-router.toml

方式三:从源码运行

git clone https://github.com/Liu8Can/pkulaw-mcp-router.git
cd pkulaw-mcp-router
npm install
npm run build
node dist/index.js serve --config ./config.example.toml

配置

先设置环境变量:

export PKULAW_MCP_TOKEN="your-token"

Windows PowerShell:

$env:PKULAW_MCP_TOKEN="your-token"

默认示例配置:

  • config.example.toml

完整示例配置:

  • catalog/pkulaw-services.full.example.toml

常用命令

抓取公开目录

npm run discover

探测当前配置里的服务是否可用

npm run inspect -- --config ./config.example.toml

构建

npm run build

启动本地聚合 MCP

node dist/index.js serve --config ./config.example.toml

MCP 客户端配置示例

下面的例子适用于支持 stdio MCP 的客户端。

npx 方式

{
  "mcpServers": {
    "pkulaw-unified": {
      "command": "npx",
      "args": [
        "-y",
        "pkulaw-mcp-router@latest",
        "serve",
        "--config",
        "/path/to/pkulaw-mcp-router.toml"
      ],
      "env": {
        "PKULAW_MCP_TOKEN": "your-token"
      }
    }
  }
}

全局安装方式

{
  "mcpServers": {
    "pkulaw-unified": {
      "command": "pkulaw-mcp-router",
      "args": [
        "serve",
        "--config",
        "/path/to/pkulaw-mcp-router.toml"
      ],
      "env": {
        "PKULAW_MCP_TOKEN": "your-token"
      }
    }
  }
}

Codex 配置示例

[mcp_servers.pkulaw_unified]
type = "stdio"
command = "npx"
args = [
  "-y",
  "pkulaw-mcp-router@latest",
  "serve",
  "--config",
  "/path/to/pkulaw-mcp-router.toml"
]

[mcp_servers.pkulaw_unified.env]
PKULAW_MCP_TOKEN = "your-token"

项目结构

  • src/:TypeScript 源码
  • config.example.toml:默认示例配置
  • catalog/pkulaw-services.generated.json:抓取到的公开目录
  • catalog/pkulaw-services.full.example.toml:完整服务配置示例

说明

  • 服务可用性取决于当前 token 对应的北大法宝订阅权限
  • inspect 的结果就是当前真实可用状态
  • 路由器只聚合实际可连接的服务

维护与发布

后续版本发布流程见:

  • RELEASE.md

License

MIT

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Pkulaw MCP Router

How do I install Pkulaw MCP Router?

Run claude mcp add pkulaw-mcp-router -- npx -y pkulaw-mcp-router, then add the server to your MCP client's configuration.

Is Pkulaw MCP Router safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Pkulaw MCP Router still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.