accurlex-mcp-server 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -1,8 +1,8 @@
1
1
  ACCURLEX_PROXY_BASE_URL=https://accurlex.com
2
2
  ACCURLEX_API_BASE_URL=https://accurlex.com/index.php
3
3
 
4
- # Fill in after running accurlex_login tool, or manually from the website.
5
- # JWT token is valid for 7 days.
4
+ # Required for all query tools (legal QA, contract review, drafting).
5
+ # Register at https://accurlex.com to get your phone-number account.
6
6
  ACCURLEX_BILLING_PHONE=
7
7
  ACCURLEX_BEARER_TOKEN=
8
8
 
package/README.md CHANGED
@@ -30,7 +30,8 @@ accurLex MCP Server 是一个面向中国法律工作流的 MCP 服务,支持
30
30
  "args": ["-y", "accurlex-mcp-server"],
31
31
  "env": {
32
32
  "ACCURLEX_PROXY_BASE_URL": "https://accurlex.com",
33
- "ACCURLEX_API_BASE_URL": "https://accurlex.com/index.php"
33
+ "ACCURLEX_API_BASE_URL": "https://accurlex.com/index.php",
34
+ "ACCURLEX_BILLING_PHONE": "你的注册手机号"
34
35
  }
35
36
  }
36
37
  }
@@ -48,6 +49,12 @@ accurLex MCP Server 是一个面向中国法律工作流的 MCP 服务,支持
48
49
  "args": ["-y", "accurlex-mcp-server"],
49
50
  "env": {
50
51
  "ACCURLEX_PROXY_BASE_URL": "https://accurlex.com",
52
+ "ACCURLEX_API_BASE_URL": "https://accurlex.com/index.php",
53
+ "ACCURLEX_BILLING_PHONE": "你的注册手机号"
54
+ }
55
+ }
56
+ }
57
+ }
51
58
  "ACCURLEX_API_BASE_URL": "https://accurlex.com/index.php"
52
59
  }
53
60
  }
@@ -71,30 +78,32 @@ accurLex MCP Server 是一个面向中国法律工作流的 MCP 服务,支持
71
78
 
72
79
  ### 3. 验证安装
73
80
 
74
- 在 AI 对话中发送以下消息测试(免费,无需登录):
81
+ 在 AI 对话中发送以下消息测试(免费配额,需已配置 `ACCURLEX_BILLING_PHONE`):
75
82
 
76
83
  > "劳动合同试用期最长不能超过多久?"
77
84
 
78
85
  如果 AI 调用了 `accurlex_legal_qa` 工具并返回了法律分析,说明安装成功。
79
86
 
80
- ### 4. 配置登录信息(使用更多能力前)
87
+ ### 4. 配置登录信息(账户查询、付费功能)
88
+
89
+ 使用前,请先到 https://accurlex.com 注册账号,将手机号填入客户端配置的 `ACCURLEX_BILLING_PHONE` 字段。
81
90
 
82
- 如果你需要账户查询,或希望通过登录流程获取当前账号的配置值,可以在 AI 对话中说:
91
+ 如果需要账户查询,可在 AI 对话中说:
83
92
 
84
93
  > "帮我登录 accurLex,手机号 138xxxx1234,密码 xxx"
85
94
 
86
- 登录成功后,将返回的 `ACCURLEX_BEARER_TOKEN` 和 `ACCURLEX_BILLING_PHONE` 添加到客户端配置的 `env` 字段中,然后重启客户端。
95
+ 登录成功后,将返回的 `ACCURLEX_BEARER_TOKEN` 添加到客户端配置的 `env` 字段中,然后重启客户端。
87
96
 
88
97
  说明:
89
98
 
90
- - `accurlex_get_account_status` 需要 `ACCURLEX_BEARER_TOKEN`
91
- - expert 问答、合同审查、法律文书生成按当前实现需要 `ACCURLEX_BILLING_PHONE`
99
+ - `ACCURLEX_BILLING_PHONE` 是注册手机号,所有工具(login/extract 除外)均需要
100
+ - `ACCURLEX_BEARER_TOKEN` JWT 令牌,`accurlex_get_account_status` 需要
92
101
 
93
102
  ## 可用功能
94
103
 
95
104
  | 功能 | 工具名 | 计费 | 预期耗时 |
96
105
  |------|--------|------|---------|
97
- | 法律问答(免费) | `accurlex_legal_qa` (deep) | 免费 | 10-30 秒 |
106
+ | 法律问答(免费配额,需注册) | `accurlex_legal_qa` (deep) | 免费 | 10-30 秒 |
98
107
  | 法律问答(专业) | `accurlex_legal_qa` (expert) | 扣点 | 10-30 秒 |
99
108
  | 合同审查 | `accurlex_contract_review` | 扣点 | 1-3 分钟 |
100
109
  | 法律文书生成 | `accurlex_draft_document` | 扣点 | 1-2 分钟 |
@@ -110,7 +119,7 @@ accurLex MCP Server 是一个面向中国法律工作流的 MCP 服务,支持
110
119
  | 问题 | 解决方案 |
111
120
  |------|---------|
112
121
  | 工具未出现在 AI 对话中 | 确认配置文件路径正确(VS Code 必须在工作区**根目录**的 `.vscode/settings.json`),然后重启客户端 |
113
- | `tool_unavailable` 错误 | 环境变量未设置,检查 `env` 字段中的 `ACCURLEX_PROXY_BASE_URL` 和 `ACCURLEX_API_BASE_URL` |
122
+ | `tool_unavailable` 错误 | 环境变量未设置,检查 `env` 字段中的 `ACCURLEX_PROXY_BASE_URL`、`ACCURLEX_API_BASE_URL`、`ACCURLEX_BILLING_PHONE` |
114
123
  | `ENOENT` / `npx` 找不到 | Node.js 未安装或未在 PATH 中,Windows 上尝试将 `command` 改为 `npx.cmd` |
115
124
  | 合同审查“超时” | 合同审查正常需要 1-3 分钟,请耐心等待 |
116
125
  | JWT 令牌过期 | 重新调用 `accurlex_login`,更新配置中的 `ACCURLEX_BEARER_TOKEN`,重启客户端 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurlex-mcp-server",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "MCP server for accurLex Chinese legal AI — legal Q&A, contract review, law lookup, document drafting",
6
6
  "keywords": ["mcp", "legal", "chinese-law", "contract-review", "accurlex", "ai"],
@@ -9,7 +9,7 @@
9
9
  "homepage": "https://accurlex.com",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://github.com/accurlex/accurlex-mcp-server.git"
12
+ "url": "git+https://github.com/MrPunchLeoanrdo/accurlex-mcp-server.git"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=18"
package/src/index.js CHANGED
@@ -46,7 +46,7 @@ const tools = [
46
46
  type: 'string',
47
47
  enum: ['deep', 'expert'],
48
48
  default: 'deep',
49
- description: 'deep is free/basic mode. expert is paid mode.',
49
+ description: 'deep = free query quota, requires registered account (ACCURLEX_BILLING_PHONE). expert = paid mode, costs points.',
50
50
  },
51
51
  history: {
52
52
  type: 'array',
@@ -185,11 +185,8 @@ async function handleLegalQa(args) {
185
185
  stream: true,
186
186
  };
187
187
 
188
- const headers = { 'Content-Type': 'application/json' };
189
- if (mode === 'expert') {
190
- assertConfigured(BILLING_PHONE, 'ACCURLEX_BILLING_PHONE is required for expert mode');
191
- headers['X-Billing-Phone'] = BILLING_PHONE;
192
- }
188
+ assertConfigured(BILLING_PHONE, 'ACCURLEX_BILLING_PHONE is required. Register at https://accurlex.com to get your account.');
189
+ const headers = { 'Content-Type': 'application/json', 'X-Billing-Phone': BILLING_PHONE };
193
190
 
194
191
  const rawText = await postJsonToRoute(route, payload, headers);
195
192
  const events = extractAccurlexEvents(rawText);
@@ -312,7 +309,7 @@ async function handleGetAccountStatus() {
312
309
  res_point: toInt(user.res_point),
313
310
  vip_point: toInt(user.vip_point),
314
311
  capabilities: {
315
- deep_qa: true,
312
+ deep_qa: Boolean(BILLING_PHONE),
316
313
  expert_qa: Boolean(BILLING_PHONE),
317
314
  contract_review: Boolean(BILLING_PHONE),
318
315
  draft_document: Boolean(BILLING_PHONE),