article-mcp 0.2.2__tar.gz → 0.2.3__tar.gz
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.
- {article_mcp-0.2.2 → article_mcp-0.2.3}/CHANGELOG.md +68 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/CLAUDE.md +33 -28
- {article_mcp-0.2.2/src/article_mcp.egg-info → article_mcp-0.2.3}/PKG-INFO +21 -21
- {article_mcp-0.2.2 → article_mcp-0.2.3}/README.md +4 -4
- {article_mcp-0.2.2 → article_mcp-0.2.3}/pyproject.toml +19 -56
- article_mcp-0.2.2/tests/test_complete_http_client.py → article_mcp-0.2.3/scripts/manual/http_client_check.py +356 -356
- {article_mcp-0.2.2 → article_mcp-0.2.3}/scripts/simulate_cherry_studio.py +3 -9
- {article_mcp-0.2.2 → article_mcp-0.2.3}/scripts/test_fastmcp_compliance.py +3 -4
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/__init__.py +1 -1
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/cli.py +3 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/middleware/__init__.py +4 -8
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/resources/config_resources.py +4 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/api_utils.py +2 -3
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/arxiv_search.py +613 -575
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/easyscholar_service.py +344 -344
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/europe_pmc.py +2 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/html_to_markdown.py +1 -1
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/merged_results.py +1 -1
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/openalex_metrics_service.py +3 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/pubmed_search.py +3 -3
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/reference_service.py +322 -322
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/article_tools.py +7 -7
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/quality_tools.py +27 -14
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/reference_tools.py +3 -6
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/relation_tools.py +4 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/search_tools.py +3 -6
- {article_mcp-0.2.2 → article_mcp-0.2.3/src/article_mcp.egg-info}/PKG-INFO +21 -21
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp.egg-info/SOURCES.txt +2 -14
- article_mcp-0.2.3/src/article_mcp.egg-info/requires.txt +17 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_arxiv_async.py +418 -402
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_async_api_client.py +2 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_async_client_migration.py +1 -1
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_crossref_openalex_async.py +260 -263
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_pubmed_async.py +1 -1
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_cli.py +4 -2
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_fastmcp_api_fix.py +166 -165
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_tool_core.py +3 -3
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/utils/test_helpers.py +1 -1
- article_mcp-0.2.2/scripts/quick_test.py +0 -176
- article_mcp-0.2.2/scripts/run_all_tests.py +0 -108
- article_mcp-0.2.2/scripts/sync_version.py +0 -175
- article_mcp-0.2.2/scripts/test_architecture_fixes.py +0 -238
- article_mcp-0.2.2/scripts/test_complete_literature_analysis.py +0 -654
- article_mcp-0.2.2/scripts/test_fixed_api_integration.py +0 -509
- article_mcp-0.2.2/scripts/test_module_imports.py +0 -180
- article_mcp-0.2.2/scripts/test_performance.py +0 -443
- article_mcp-0.2.2/scripts/test_pytest_suite.py +0 -198
- article_mcp-0.2.2/scripts/test_search_performance.py +0 -367
- article_mcp-0.2.2/scripts/test_simple_imports.py +0 -194
- article_mcp-0.2.2/scripts/test_working_functions.py +0 -203
- article_mcp-0.2.2/src/article_mcp.egg-info/requires.txt +0 -17
- {article_mcp-0.2.2 → article_mcp-0.2.3}/LICENSE +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/MANIFEST.in +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/glama.json +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/scripts/clean_pytest_cache.py +0 -0
- /article_mcp-0.2.2/tests/test_relation_tools.py → /article_mcp-0.2.3/scripts/manual/relation_tools_check.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/setup.cfg +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/__main__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/middleware/logging.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/resources/__init__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/resources/journal_resources.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/__init__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/crossref_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/error_utils.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/mcp_config.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/openalex_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/services/similar_articles.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/__init__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp/tools/core/__init__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp.egg-info/dependency_links.txt +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp.egg-info/entry_points.txt +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/src/article_mcp.egg-info/top_level.txt +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/__init__.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/conftest.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/integration/test_mcp_integration.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/integration/test_real_api.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/integration/test_six_tools_integration.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/services/test_pmc_fulltext_conversion.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_cli_quality_services.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_cli_show_info.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_crossref_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_easyscholar_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_merged_results.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_openalex_metrics_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_openalex_service.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_performance_timer_naming.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_quality_tools_sorting.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_runtime_warning_fix.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_search_tools_improvements.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_services.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/test_six_tools.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_format_param.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_pmcid_normalization.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_pmcid_only.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_cache_concurrency.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_closure_services.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_quality_async_pure.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_reference_tools_async.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_relation_tools_async.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_relation_uses_reference.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/unit/tools/test_search_tools_async_integration.py +0 -0
- {article_mcp-0.2.2 → article_mcp-0.2.3}/tests/verification/test_fastmcp_async.py +0 -0
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# 版本更新说明
|
|
2
2
|
|
|
3
|
+
## v0.2.3 (2026-11-21) - 依赖全面升级 + MCP SDK 2.x 适配
|
|
4
|
+
|
|
5
|
+
### 核心修复 🔧
|
|
6
|
+
- **MCPError 导入兼容**: `from mcp import McpError` → `from fastmcp.exceptions import McpError`
|
|
7
|
+
- MCP SDK 2.x 将 `McpError` 更名为 `MCPError` 并移除顶层导出,直接从 `mcp` 导入会在启动时抛
|
|
8
|
+
`ImportError: cannot import name 'McpError' from 'mcp'`,导致 MCP server 进程直接退出
|
|
9
|
+
- fastmcp 2.13.0 与 4.2.4 均通过 `fastmcp.exceptions` 提供该名字,一处改动兼容两代
|
|
10
|
+
- **MCPError 构造方式适配**: MCP SDK 2.x 的签名为 `MCPError(code, message, data)`,不再是
|
|
11
|
+
`McpError(ErrorData(...))`;中间件与工具层的 5 处抛出点已同步更新(否则错误路径会抛 TypeError)
|
|
12
|
+
- **ToolAnnotations 字段改名**: `readOnlyHint`/`openWorldHint` → `read_only_hint`/`open_world_hint`
|
|
13
|
+
- 旧写法在 pydantic 下被静默丢弃,工具的只读/开放世界标注实际未生效
|
|
14
|
+
- **版本号漂移**: `cli.py` 硬编码的 `version="0.2.2"` 改为读取包内 `__version__`;
|
|
15
|
+
`tests/unit/test_cli.py` 的断言不再写死版本号
|
|
16
|
+
|
|
17
|
+
### 依赖升级 📦
|
|
18
|
+
- `fastmcp` 2.13.0 → **4.2.4**(配套 `mcp` 1.19.0 → **2.3.0**)
|
|
19
|
+
- `requests` → 2.34.2、`aiohttp` → 3.14.5、`urllib3` → 2.8.0、`markdownify` → 1.2.4、
|
|
20
|
+
`filelock` → 4.2.12、`python-dateutil` → 4.0.0
|
|
21
|
+
- 开发依赖:`pytest` → 9.2.0、`pytest-asyncio` → 1.5.0、`pytest-cov` → 7.1.0、
|
|
22
|
+
`ruff` → 0.17.6、`mypy` → 2.4.1、`pre-commit` → 4.7.0、`psutil` → 7.2.2
|
|
23
|
+
- `requires-python` 从 `>=3.10` 提升到 `>=3.11`(fastmcp 4.x 的下限),ruff/mypy 目标版本同步为 py311
|
|
24
|
+
- 依赖下界统一抬到"已验证通过的版本",避免再出现"包版本被 pin、依赖却浮动"导致的启动崩溃
|
|
25
|
+
|
|
26
|
+
### 测试与工具链 🧪
|
|
27
|
+
- FastMCP 4.x 将 `get_tools()` 更名为 `list_tools()`(返回列表而非字典),相关测试已同步
|
|
28
|
+
- 移除已过时的 `asyncio.TimeoutError` 别名用法(Python 3.11+ 已是内置 `TimeoutError`)
|
|
29
|
+
- `pre-commit` 的 ruff hook 升到 v0.17.6;CI action 升到 checkout@v6.0.1 / setup-python@v6.1.0
|
|
30
|
+
- 新增一次真实的 MCP 握手与工具调用验证(initialize / tools/list / tools/call,含错误路径)
|
|
31
|
+
|
|
32
|
+
### 功能缺陷修复 🐛
|
|
33
|
+
- **arXiv 日期过滤失效**: 关键词未整体加引号时,arXiv 的 search_query 解析器会把
|
|
34
|
+
`submittedDate:[... TO ...]` 约束丢掉,静默返回最新文献。同步与异步两条检索路径都改为
|
|
35
|
+
`all:"关键词"`,并替换掉关键词里自带的双引号
|
|
36
|
+
- **include_metrics 传字符串时的语义错误**: 单个指标名此前会被当作字符串做子串匹配,
|
|
37
|
+
现在统一规范化为列表
|
|
38
|
+
- **异常被 Mock 吞掉**: 测试里 `__aexit__ = AsyncMock()` 返回真值,会把 `async with`
|
|
39
|
+
内的异常整个抑制掉,导致"网络错误"用例走成了成功路径。已改为 `return_value=False`
|
|
40
|
+
|
|
41
|
+
### 补齐缺失的异步能力 ⚡
|
|
42
|
+
- 新增模块级 `search_async()`(arXiv),此前只有 `search_arxiv_async()` 与类方法,
|
|
43
|
+
测试因找不到入口而长期 skip
|
|
44
|
+
- 14 个长期 skip 的用例全部恢复执行(398 passed / 14 skipped → 412 passed / 0 skipped),
|
|
45
|
+
打真实 API 的用例统一标 `@pytest.mark.network`,CI 用 `-m "not network"` 排除
|
|
46
|
+
|
|
47
|
+
### 工程基建 🏗️
|
|
48
|
+
- **新增 CI**(`.github/workflows/ci.yml`):lint(ruff + mypy)、test(Python 3.11/3.12 矩阵)、
|
|
49
|
+
smoke(FastMCP 合规性,得分低于 80 失败)三个作业;原先只有 publish 与合规性两个 workflow,
|
|
50
|
+
测试与 lint 完全没有 CI 兜底
|
|
51
|
+
- **mypy 打通**: 清理 13 个类型错误(`mypy src` 现为 Success),并把 mypy 挂进 pre-commit 与 CI
|
|
52
|
+
- **配置单一来源**: 删掉 `pyproject.toml` 里与 `pytest.ini` / `mypy.ini` 重复的
|
|
53
|
+
`[tool.pytest.ini_options]` 与 `[tool.mypy]`,避免两处配置不一致
|
|
54
|
+
|
|
55
|
+
### 仓库清理 🧹
|
|
56
|
+
- `scripts/` 下 12 个一次性验证脚本删除(功能已被 pytest 套件覆盖),
|
|
57
|
+
保留合规性检查、客户端兼容性模拟与清理工具;需要本地服务/真实 API 的两个脚本移到
|
|
58
|
+
`scripts/manual/`
|
|
59
|
+
- 两个伪装成测试的手工脚本(HTTP 客户端、关系工具)从 `tests/` 移到 `scripts/manual/`
|
|
60
|
+
- 过程性文档 `API_Integration_Fix_Report.md`、`search_tools_integration_analysis.md` 归档到
|
|
61
|
+
`docs/archive/`
|
|
62
|
+
- `config://version` / `config://status` 资源改为读 `__version__`,消除版本号漂移;
|
|
63
|
+
配套的 `scripts/sync_version.py` 删除
|
|
64
|
+
- 文档同步:安装命令补 `filelock`/`urllib3` 与 Python 3.11+ 要求、
|
|
65
|
+
CLAUDE.md 的"6 个工具/兼容性 main.py"过时描述、PROJECT_STRUCTURE 目录树、测试命令
|
|
66
|
+
|
|
67
|
+
### 兼容性说明 ⚠️
|
|
68
|
+
- 本版本**要求 MCP SDK 2.x**(由 `fastmcp>=4.2.4` 约束),不再兼容 fastmcp 2.x
|
|
69
|
+
- `uv.lock` 已按新依赖重新生成,`uv sync` 即可得到一致环境
|
|
70
|
+
|
|
3
71
|
## v0.2.2 (2025-01-04) - 文档修正与代码质量提升
|
|
4
72
|
|
|
5
73
|
### 文档修正 📚
|
|
@@ -11,11 +11,11 @@ Article MCP is a high-performance literature search server based on FastMCP fram
|
|
|
11
11
|
The project follows a standard Python src layout with layered architecture:
|
|
12
12
|
|
|
13
13
|
- **CLI Layer** (`cli.py`): Main CLI entry point and MCP server creation via `create_mcp_server()`
|
|
14
|
-
- **Tool Layer** (`tools/core/`):
|
|
14
|
+
- **Tool Layer** (`tools/core/`): 5 core MCP tool registrations
|
|
15
15
|
- **Service Layer** (`services/`): API integrations using dependency injection pattern
|
|
16
16
|
- **Middleware Layer** (`middleware/`): Error handling, logging, and performance monitoring
|
|
17
17
|
- **Resource Layer** (`resources/`): MCP resources for config and journal data
|
|
18
|
-
- **
|
|
18
|
+
- **Entry Points** (`__main__.py`): `python -m article_mcp` 入口,转发到 `cli.py`
|
|
19
19
|
|
|
20
20
|
### The 5 Core Tools
|
|
21
21
|
|
|
@@ -53,11 +53,11 @@ Access global performance stats via `middleware.get_global_performance_stats()`.
|
|
|
53
53
|
|
|
54
54
|
### Environment Setup
|
|
55
55
|
```bash
|
|
56
|
-
# Install dependencies
|
|
57
|
-
uv sync
|
|
56
|
+
# Install dependencies (Python 3.11+)
|
|
57
|
+
uv sync --extra dev
|
|
58
58
|
|
|
59
59
|
# Or using pip
|
|
60
|
-
pip install fastmcp requests python-dateutil aiohttp markdownify
|
|
60
|
+
pip install "fastmcp>=4.2.4" requests python-dateutil urllib3 aiohttp markdownify filelock
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### Running the Server
|
|
@@ -68,9 +68,6 @@ uvx article-mcp server
|
|
|
68
68
|
# Local development - using new CLI
|
|
69
69
|
uv run python -m article_mcp server
|
|
70
70
|
|
|
71
|
-
# Compatibility through main.py (still works)
|
|
72
|
-
uv run main.py server
|
|
73
|
-
|
|
74
71
|
# Alternative transport modes
|
|
75
72
|
uv run python -m article_mcp server --transport stdio
|
|
76
73
|
uv run python -m article_mcp server --transport sse --host 0.0.0.0 --port 9000
|
|
@@ -79,24 +76,29 @@ uv run python -m article_mcp server --transport streamable-http --host 0.0.0.0 -
|
|
|
79
76
|
|
|
80
77
|
### Testing
|
|
81
78
|
```bash
|
|
82
|
-
#
|
|
83
|
-
uv run
|
|
79
|
+
# 全量测试
|
|
80
|
+
uv run pytest
|
|
81
|
+
|
|
82
|
+
# 跳过打真实外部 API 的用例(CI 用的就是这个)
|
|
83
|
+
uv run pytest -m "not network"
|
|
84
84
|
|
|
85
|
-
#
|
|
86
|
-
uv run
|
|
85
|
+
# 只跑单元测试
|
|
86
|
+
uv run pytest tests/unit/
|
|
87
87
|
|
|
88
|
-
#
|
|
89
|
-
uv run
|
|
88
|
+
# 单个用例
|
|
89
|
+
uv run pytest tests/unit/test_six_tools.py -k test_all_tools_registered
|
|
90
|
+
```
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
uv run
|
|
94
|
-
uv run
|
|
95
|
-
uv run
|
|
96
|
-
uv run python scripts/
|
|
92
|
+
### Quality Checks
|
|
93
|
+
```bash
|
|
94
|
+
uv run ruff check .
|
|
95
|
+
uv run ruff format --check .
|
|
96
|
+
uv run mypy src # 类型检查(CI 与 pre-commit 都会跑)
|
|
97
|
+
uv run python scripts/test_fastmcp_compliance.py # FastMCP 合规性(CI smoke 作业)
|
|
98
|
+
```
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
> `scripts/` 下只保留不属于测试套件的辅助脚本(合规性检查、客户端兼容性模拟、清理工具),
|
|
101
|
+
> 索引见 `scripts/README.md`。
|
|
100
102
|
pytest tests/unit/ # Unit tests only
|
|
101
103
|
pytest -m integration # Integration tests only
|
|
102
104
|
pytest -m "not slow" # Exclude slow tests
|
|
@@ -106,22 +108,25 @@ pytest tests/unit/test_six_tools.py # Test all 5 core tools (legacy filename)
|
|
|
106
108
|
### Code Quality
|
|
107
109
|
```bash
|
|
108
110
|
# Format code (Ruff formatter - 100x faster than black)
|
|
109
|
-
ruff format
|
|
111
|
+
uv run ruff format .
|
|
110
112
|
|
|
111
113
|
# Lint (Ruff linter - replaces flake8, isort)
|
|
112
|
-
ruff check
|
|
113
|
-
ruff check
|
|
114
|
+
uv run ruff check .
|
|
115
|
+
uv run ruff check . --fix # Auto-fix issues
|
|
114
116
|
|
|
115
117
|
# Type checking
|
|
116
|
-
mypy src
|
|
118
|
+
uv run mypy src
|
|
117
119
|
|
|
118
120
|
# All quality checks
|
|
119
|
-
ruff check
|
|
121
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy src
|
|
120
122
|
|
|
121
123
|
# Pre-commit hooks (install)
|
|
122
|
-
pre-commit install
|
|
124
|
+
uv run pre-commit install
|
|
123
125
|
```
|
|
124
126
|
|
|
127
|
+
> ruff 0.17 起会一并格式化 Markdown 里的 Python 代码块,因此 `ruff format .` 与
|
|
128
|
+
> CI 的 `ruff format --check .` 覆盖范围一致(含 `docs/`)。
|
|
129
|
+
|
|
125
130
|
### Package Management
|
|
126
131
|
```bash
|
|
127
132
|
python -m build # Build package
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: article-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Article MCP文献搜索服务器 - 基于Europe PMC、arXiv等多个数据源的学术文献搜索工具
|
|
5
5
|
Author-email: gqy20 <qingyu_ge@foxmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,32 +8,32 @@ Project-URL: Homepage, https://github.com/gqy20/article-mcp
|
|
|
8
8
|
Project-URL: Repository, https://github.com/gqy20/article-mcp
|
|
9
9
|
Project-URL: Issues, https://github.com/gqy20/article-mcp/issues
|
|
10
10
|
Keywords: mcp,literature,search,europe-pmc,arxiv,academic
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: fastmcp>=2.
|
|
15
|
-
Requires-Dist: requests>=2.
|
|
16
|
-
Requires-Dist: python-dateutil>=
|
|
17
|
-
Requires-Dist: urllib3>=
|
|
18
|
-
Requires-Dist: aiohttp>=3.
|
|
19
|
-
Requires-Dist: markdownify>=
|
|
20
|
-
Requires-Dist: filelock>=
|
|
14
|
+
Requires-Dist: fastmcp>=4.2.4
|
|
15
|
+
Requires-Dist: requests>=2.34.2
|
|
16
|
+
Requires-Dist: python-dateutil>=4.0.0
|
|
17
|
+
Requires-Dist: urllib3>=2.8.0
|
|
18
|
+
Requires-Dist: aiohttp>=3.14.5
|
|
19
|
+
Requires-Dist: markdownify>=1.2.4
|
|
20
|
+
Requires-Dist: filelock>=4.2.12
|
|
21
21
|
Provides-Extra: dev
|
|
22
|
-
Requires-Dist: pytest>=
|
|
23
|
-
Requires-Dist: pytest-asyncio>=
|
|
24
|
-
Requires-Dist: pytest-cov>=
|
|
25
|
-
Requires-Dist: ruff>=0.
|
|
26
|
-
Requires-Dist: mypy>=
|
|
27
|
-
Requires-Dist: types-requests; extra == "dev"
|
|
28
|
-
Requires-Dist: pre-commit>=
|
|
29
|
-
Requires-Dist: psutil>=
|
|
22
|
+
Requires-Dist: pytest>=9.2.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=1.5.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.17.6; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy>=2.4.1; extra == "dev"
|
|
27
|
+
Requires-Dist: types-requests>=2.33.0.20261030; extra == "dev"
|
|
28
|
+
Requires-Dist: pre-commit>=4.7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: psutil>=7.2.2; extra == "dev"
|
|
30
30
|
Dynamic: license-file
|
|
31
31
|
|
|
32
32
|
# Article MCP 文献搜索服务器
|
|
33
33
|
|
|
34
34
|
[](https://glama.ai/mcp/servers/@gqy20/article-mcp)
|
|
35
35
|
|
|
36
|
-
基于 FastMCP
|
|
36
|
+
基于 FastMCP v4.2+(MCP SDK 2.x)的异步文献搜索工具,集成 Europe PMC、PubMed、arXiv、CrossRef、OpenAlex 等数据源。
|
|
37
37
|
|
|
38
38
|
## 快速开始
|
|
39
39
|
|
|
@@ -41,10 +41,10 @@ Dynamic: license-file
|
|
|
41
41
|
# 安装
|
|
42
42
|
uvx article-mcp
|
|
43
43
|
|
|
44
|
-
#
|
|
44
|
+
# 或本地开发(需要 Python 3.11+)
|
|
45
45
|
git clone https://github.com/gqy20/article-mcp.git && cd article-mcp
|
|
46
|
-
uv sync
|
|
47
|
-
uv run
|
|
46
|
+
uv sync --extra dev
|
|
47
|
+
uv run article-mcp server
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## 配置
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://glama.ai/mcp/servers/@gqy20/article-mcp)
|
|
4
4
|
|
|
5
|
-
基于 FastMCP
|
|
5
|
+
基于 FastMCP v4.2+(MCP SDK 2.x)的异步文献搜索工具,集成 Europe PMC、PubMed、arXiv、CrossRef、OpenAlex 等数据源。
|
|
6
6
|
|
|
7
7
|
## 快速开始
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
# 安装
|
|
11
11
|
uvx article-mcp
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# 或本地开发(需要 Python 3.11+)
|
|
14
14
|
git clone https://github.com/gqy20/article-mcp.git && cd article-mcp
|
|
15
|
-
uv sync
|
|
16
|
-
uv run
|
|
15
|
+
uv sync --extra dev
|
|
16
|
+
uv run article-mcp server
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "article-mcp"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "Article MCP文献搜索服务器 - 基于Europe PMC、arXiv等多个数据源的学术文献搜索工具"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "gqy20", email = "qingyu_ge@foxmail.com"}
|
|
7
7
|
]
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
license = "MIT"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
11
|
keywords = ["mcp", "literature", "search", "europe-pmc", "arxiv", "academic"]
|
|
12
12
|
dependencies = [
|
|
13
|
-
"fastmcp>=2.
|
|
14
|
-
"requests>=2.
|
|
15
|
-
"python-dateutil>=
|
|
16
|
-
"urllib3>=
|
|
17
|
-
"aiohttp>=3.
|
|
18
|
-
"markdownify>=
|
|
19
|
-
"filelock>=
|
|
13
|
+
"fastmcp>=4.2.4",
|
|
14
|
+
"requests>=2.34.2",
|
|
15
|
+
"python-dateutil>=4.0.0",
|
|
16
|
+
"urllib3>=2.8.0",
|
|
17
|
+
"aiohttp>=3.14.5",
|
|
18
|
+
"markdownify>=1.2.4",
|
|
19
|
+
"filelock>=4.2.12",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
[project.urls]
|
|
@@ -29,26 +29,26 @@ article-mcp = "article_mcp.cli:main"
|
|
|
29
29
|
|
|
30
30
|
[project.optional-dependencies]
|
|
31
31
|
dev = [
|
|
32
|
-
"pytest>=
|
|
33
|
-
"pytest-asyncio>=
|
|
34
|
-
"pytest-cov>=
|
|
32
|
+
"pytest>=9.2.0",
|
|
33
|
+
"pytest-asyncio>=1.5.0",
|
|
34
|
+
"pytest-cov>=7.1.0",
|
|
35
35
|
# Ruff: 替代 black + isort + flake8
|
|
36
|
-
"ruff>=0.
|
|
36
|
+
"ruff>=0.17.6",
|
|
37
37
|
# 类型检查
|
|
38
|
-
"mypy>=
|
|
39
|
-
"types-requests",
|
|
38
|
+
"mypy>=2.4.1",
|
|
39
|
+
"types-requests>=2.33.0.20261030",
|
|
40
40
|
# Pre-commit hooks
|
|
41
|
-
"pre-commit>=
|
|
42
|
-
"psutil>=
|
|
41
|
+
"pre-commit>=4.7.0",
|
|
42
|
+
"psutil>=7.2.2"
|
|
43
43
|
]
|
|
44
44
|
|
|
45
45
|
[build-system]
|
|
46
|
-
requires = ["setuptools>=
|
|
46
|
+
requires = ["setuptools>=84.2.1", "wheel>=0.48.0"]
|
|
47
47
|
build-backend = "setuptools.build_meta"
|
|
48
48
|
|
|
49
49
|
# Ruff: 替代 black + isort + flake8
|
|
50
50
|
[tool.ruff]
|
|
51
|
-
target-version = "
|
|
51
|
+
target-version = "py311"
|
|
52
52
|
line-length = 100
|
|
53
53
|
|
|
54
54
|
# Ruff 格式化配置 (替代 black)
|
|
@@ -91,43 +91,6 @@ known-first-party = ["article_mcp", "tests"]
|
|
|
91
91
|
|
|
92
92
|
# mypy per-file ignores (通过 comments 实现,见各文件)
|
|
93
93
|
|
|
94
|
-
[tool.mypy]
|
|
95
|
-
python_version = "3.10"
|
|
96
|
-
explicit_package_bases = true
|
|
97
|
-
ignore_missing_imports = true
|
|
98
|
-
exclude = [
|
|
99
|
-
"build",
|
|
100
|
-
"dist",
|
|
101
|
-
".eggs",
|
|
102
|
-
"src/article_mcp/services/similar_articles.py",
|
|
103
|
-
]
|
|
104
|
-
# 放宽类型检查(逐步修复中)
|
|
105
|
-
warn_return_any = false
|
|
106
|
-
warn_unused_configs = false
|
|
107
|
-
disallow_untyped_defs = false
|
|
108
|
-
disallow_incomplete_defs = false
|
|
109
|
-
check_untyped_defs = false
|
|
110
|
-
disallow_untyped_decorators = false
|
|
111
|
-
no_implicit_optional = false
|
|
112
|
-
warn_redundant_casts = false
|
|
113
|
-
warn_unused_ignores = false
|
|
114
|
-
warn_no_return = false
|
|
115
|
-
warn_unreachable = false
|
|
116
|
-
strict_equality = false
|
|
117
|
-
|
|
118
|
-
[tool.pytest.ini_options]
|
|
119
|
-
minversion = "7.0"
|
|
120
|
-
addopts = "-ra -q --strict-markers --strict-config"
|
|
121
|
-
testpaths = ["tests"]
|
|
122
|
-
python_files = ["test_*.py"]
|
|
123
|
-
python_classes = ["Test*"]
|
|
124
|
-
python_functions = ["test_*"]
|
|
125
|
-
markers = [
|
|
126
|
-
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
127
|
-
"integration: marks tests as integration tests",
|
|
128
|
-
"unit: marks tests as unit tests",
|
|
129
|
-
]
|
|
130
|
-
|
|
131
94
|
[tool.coverage.run]
|
|
132
95
|
source = ["src"]
|
|
133
96
|
omit = [
|