npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

accurlex-mcp-server

v0.5.0

Published

Remote MCP (Streamable HTTP, protocol 2026-07-28) for accurLex Chinese legal AI - config generator, tool schemas and integration examples

Downloads

99

Readme

accurLex MCP Server

npm version License: MIT

accurLex 知法(accurlex.com)的 远程 MCP 服务:一次配置,让 Cursor、Claude Code、Codex、VS Code 等 AI 客户端直接调用中国法律能力——法律问答、法条检索、合同审查、法律文书生成。

本服务是 Streamable HTTP(MCP 协议 2026-07-28)远程端点,不需要本地安装服务端;API Key 在 开放平台控制台 创建。


快速开始

1. 创建 API Key

  1. 打开 accurLex 开放平台控制台 并登录
  2. 创建一个 API Key(ak_live_ 开头),勾选需要的权限(scope)
  3. 只把 Key 放在服务端环境变量或客户端密钥管理中,不要提交到公开仓库

2. 配置客户端

以 Cursor / Claude Code / VS Code 的 .mcp.json 为例:

{
  "mcpServers": {
    "accurlex": {
      "type": "http",
      "url": "https://accurlex.com/mcp/stream",
      "headers": {
        "Authorization": "Bearer ak_live_YOUR_API_KEY"
      }
    }
  }
}

也可以直接用本包生成配置:

# JSON(Cursor / Claude Code / VS Code)
npx accurlex-mcp-server --key ak_live_YOUR_API_KEY

# TOML(Codex CLI)
npx accurlex-mcp-server --key ak_live_YOUR_API_KEY --format toml

更多客户端配置见 docs/client-configs.md。

3. 开始使用

配置完成后刷新工具列表,向 AI 提问,例如:

  • “根据《民法典》分析一下违约金过高能否请求调整?”
  • “审查这份合同的付款条款和违约责任”
  • “帮我起草一份民事起诉状”

端点与协议

| 项目 | 值 | |---|---| | 端点 | POST https://accurlex.com/mcp/stream | | 协议 | MCP 2026-07-28,Streamable HTTP(无状态,不需要会话 ID) | | 认证 | 请求头 Authorization: Bearer ak_live_... | | 请求体 | 单条 JSON-RPC 2.0 消息,最大 2MB | | 流式 | Accept 含 text/event-stream 时返回 SSE,否则单条 JSON |

请求头

| 头 | 说明 | |---|---| | MCP-Protocol-Version | 2026-07-28 | | Mcp-Method | 与 body 的 method 一致,如 tools/call | | Mcp-Name | tools/call 必填,与 body.params.name 一致 | | Accept | application/json, text/event-stream |

工具

| 工具 | 必填参数 | 计费 | |---|---|---| | accurlex_legal_qa | question | deep 免费(每日 100 次,≤10000 字符);expert 付费 5 点(≤30000 字符) | | accurlex_law_search | prompt | deep 免费(每日 100 次,≤10000 字符);expert 促销期免费(≤30000 字符,限时免费至 2026-10-15),到期自动恢复付费 5 点 | | accurlex_contract_review | contract_text + standpoint | 付费 10 点(合计 ≤30000 字符) | | accurlex_document_draft | document_type + facts | 付费 10 点(合计 ≤30000 字符) | | accurlex_account_usage | 无 | 免费,不消耗点数 |

完整 JSON Schema 见 schemas/tools.json,调用示例见 examples/。

调用示例

server/discover(协议协商):

curl -sS -X POST https://accurlex.com/mcp/stream \
  -H "Authorization: Bearer ak_live_YOUR_API_KEY" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: server/discover" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'

tools/call(deep 免费法律问答):

curl -sS -X POST https://accurlex.com/mcp/stream \
  -H "Authorization: Bearer ak_live_YOUR_API_KEY" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: tools/call" \
  -H "Mcp-Name: accurlex_legal_qa" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"accurlex_legal_qa","arguments":{"question":"合同约定的违约金过高时,可以请求法院调整吗?","mode":"deep"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'

JavaScript 与 Python 示例见 examples/。

计费与额度

  • 与 accurLex REST API 共用同一套 API Key、scope、每日免费额度与点数计费
  • 免费调用也写入用量台账(0 点);付费调用失败自动退款
  • 服务端无状态、不提供请求级去重;客户端应避免自动重试付费工具调用
  • SSE 连接断开即取消:计费后断连自动退款,计费前断连不扣费

支持范围

  • 支持 2026-07-28 及之后的 MCP 协议版本(Streamable HTTP / 无状态)
  • 旧版 initialize 握手(2024/2025)与旧版 stdio 包不兼容,已退役

许可

MIT License,见 LICENSE。