Devnors Data MCP Server
一个 API Key,让 Claude / Cursor 等 AI 助手直接调用 Devnors Data 的高质量数据(法律等多领域官方权威数据,每条出处可回溯)。
安装
PyPI 正式发布进行中(打
mcp-v*tag 触发,见 docs/RELEASE.md)。发布后:
pip install devnors-mcp
发布前可用源码安装(从仓库根目录,MCP 依赖 SDK):
pip install -e ./sdk -e ./mcp_server
在 Claude Desktop / Cursor 接入
在 MCP 配置(Claude Desktop 的 claude_desktop_config.json 或 Cursor 的 ~/.cursor/mcp.json)加入:
{
"mcpServers": {
"devnors-data": {
"command": "devnors-mcp",
"env": {
"DEVNORS_API_KEY": "devnors_sk_live_xxx"
}
}
}
}
填入 API Key 即可,其余由 Agent 自己操作:它会先用 list_capabilities 自发现能调什么、怎么调、出错怎么办,再按需检索。
API Key 在 开发者控制台 创建。
环境变量
| 变量 | 必填 | 说明 |
|---|---|---|
DEVNORS_API_KEY |
是 | API Key(devnors_sk_...),控制台创建 |
DEVNORS_DATA_BASE_URL |
否 | 覆盖服务地址,默认 https://data.devnors.com(私有化/自测时用) |
提供的工具
| 工具 | 说明 |
|---|---|
list_capabilities |
自发现:拉取 /capabilities.json,返回可调 domain/type、filters、字段、示例、错误码 |
legal_case_search |
检索裁判文书(官方公开,出处可回溯) |
legal_law_search |
检索现行法律法规条文 |
data_query |
统一入口:任意 domain + type + filters 查询 |
计费与错误处理
按次调用计费,成功返回含 units(消耗 tokens)与 request_id。失败返回结构化错误,Agent 可据此自纠:
code |
含义 | retryable |
建议动作 |
|---|---|---|---|
unauthorized |
Key 无效/缺失 | 否 | 检查 DEVNORS_API_KEY |
insufficient_balance |
余额不足 | 否 | 前往控制台充值 |
rate_limited |
触发限流 | 是 | 按 Retry-After 退避后重试 |
invalid_capability |
domain/type 无效 | 否 | 用 list_capabilities 查可用组合 |
not_implemented |
该域规划中 | 否 | 改用 live 域 |
unavailable / upstream_error |
上游暂不可用 | 是 | 短暂退避后重试 |
retryable=是 的错误(429/5xx)由底层 SDK 自动有界退避重试,MCP 层不再叠加;重试耗尽仍失败才回传上表错误。
故障排查
- 报
unauthorized:确认DEVNORS_API_KEY已设且未吊销;控制台可重建 Key。 - 连接超时/
unavailable:确认能访问DEVNORS_DATA_BASE_URL(默认公网data.devnors.com);私有化部署需显式设置该变量。 - 报障对账:把错误里的
request_id提供给支持,可精确定位单次调用。
Metadata
Release files for devnors-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devnors_mcp-0.1.0.tar.gz | 7.5 kB | Without provenance | Details for devnors_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devnors_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for devnors_mcp-0.1.0-py3-none-any.whl |
Total release size: 14.5 kB
Release files / devnors_mcp-0.1.0.tar.gz
| Download URL | devnors_mcp-0.1.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2abceea00bf859c93eda490fe3f24159a20a654a5cf7610d4df81a159ec114b2
|
|
BLAKE2b-256 checksum How to use checksums |
a129bcfcdc2bae82dccdd1d5db037e2f399eef58ca2be5e5ee8d49ab32db68c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / devnors_mcp-0.1.0-py3-none-any.whl
| Download URL | devnors_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb657543813058bedf15e3c583312a99d79d56f9307bb0f1fcbfb5f9a21b63a7
|
|
BLAKE2b-256 checksum How to use checksums |
af5c3f2cd64318cc79f2a875298571c6f53bd1dc8c59644c01ebb6c278a4ac63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for devnors-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.