yapi-mcp 0.1.0__tar.gz → 0.1.2__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.
Files changed (66) hide show
  1. {yapi_mcp-0.1.0 → yapi_mcp-0.1.2}/.gitignore +56 -53
  2. {yapi_mcp-0.1.0 → yapi_mcp-0.1.2}/LICENSE +21 -21
  3. yapi_mcp-0.1.2/PKG-INFO +174 -0
  4. yapi_mcp-0.1.2/README.md +144 -0
  5. {yapi_mcp-0.1.0 → yapi_mcp-0.1.2}/pyproject.toml +69 -52
  6. yapi_mcp-0.1.2/src/yapi_mcp/__init__.py +5 -0
  7. yapi_mcp-0.1.2/src/yapi_mcp/__main__.py +6 -0
  8. {yapi_mcp-0.1.0/src → yapi_mcp-0.1.2/src/yapi_mcp}/config.py +48 -48
  9. yapi_mcp-0.1.2/src/yapi_mcp/server.py +185 -0
  10. {yapi_mcp-0.1.0/src → yapi_mcp-0.1.2/src/yapi_mcp}/tools/__init__.py +1 -1
  11. {yapi_mcp-0.1.0/src → yapi_mcp-0.1.2/src/yapi_mcp}/yapi/__init__.py +1 -1
  12. yapi_mcp-0.1.2/src/yapi_mcp/yapi/client.py +259 -0
  13. {yapi_mcp-0.1.0/src → yapi_mcp-0.1.2/src/yapi_mcp}/yapi/errors.py +43 -21
  14. {yapi_mcp-0.1.0/src → yapi_mcp-0.1.2/src/yapi_mcp}/yapi/models.py +61 -60
  15. yapi_mcp-0.1.0/.claude/commands/analyze.md +0 -101
  16. yapi_mcp-0.1.0/.claude/commands/clarify.md +0 -158
  17. yapi_mcp-0.1.0/.claude/commands/constitution.md +0 -73
  18. yapi_mcp-0.1.0/.claude/commands/implement.md +0 -56
  19. yapi_mcp-0.1.0/.claude/commands/plan.md +0 -43
  20. yapi_mcp-0.1.0/.claude/commands/specify.md +0 -21
  21. yapi_mcp-0.1.0/.claude/commands/tasks.md +0 -62
  22. yapi_mcp-0.1.0/.claude/settings.local.json +0 -16
  23. yapi_mcp-0.1.0/.env.example +0 -13
  24. yapi_mcp-0.1.0/.github/CICD_FEATURES.md +0 -83
  25. yapi_mcp-0.1.0/.github/CODE_OF_CONDUCT.md +0 -46
  26. yapi_mcp-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +0 -78
  27. yapi_mcp-0.1.0/.github/ISSUE_TEMPLATE/config.yml +0 -8
  28. yapi_mcp-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +0 -65
  29. yapi_mcp-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +0 -40
  30. yapi_mcp-0.1.0/.github/dependabot.yml +0 -27
  31. yapi_mcp-0.1.0/.github/workflows/README.md +0 -146
  32. yapi_mcp-0.1.0/.github/workflows/ci.yml +0 -93
  33. yapi_mcp-0.1.0/.github/workflows/release.yml +0 -57
  34. yapi_mcp-0.1.0/.specify/memory/constitution.md +0 -50
  35. yapi_mcp-0.1.0/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
  36. yapi_mcp-0.1.0/.specify/scripts/powershell/common.ps1 +0 -136
  37. yapi_mcp-0.1.0/.specify/scripts/powershell/create-new-feature.ps1 +0 -117
  38. yapi_mcp-0.1.0/.specify/scripts/powershell/setup-plan.ps1 +0 -61
  39. yapi_mcp-0.1.0/.specify/scripts/powershell/update-agent-context.ps1 +0 -433
  40. yapi_mcp-0.1.0/.specify/templates/agent-file-template.md +0 -23
  41. yapi_mcp-0.1.0/.specify/templates/plan-template.md +0 -219
  42. yapi_mcp-0.1.0/.specify/templates/spec-template.md +0 -116
  43. yapi_mcp-0.1.0/.specify/templates/tasks-template.md +0 -127
  44. yapi_mcp-0.1.0/CICD_FILES_ADDED.md +0 -123
  45. yapi_mcp-0.1.0/CICD_SETUP.md +0 -259
  46. yapi_mcp-0.1.0/CLAUDE.md +0 -25
  47. yapi_mcp-0.1.0/CONTRIBUTING.md +0 -208
  48. yapi_mcp-0.1.0/PKG-INFO +0 -394
  49. yapi_mcp-0.1.0/README.md +0 -377
  50. yapi_mcp-0.1.0/specs/001-model-context-protocol/contracts/mcp-tools.schema.json +0 -182
  51. yapi_mcp-0.1.0/specs/001-model-context-protocol/data-model.md +0 -343
  52. yapi_mcp-0.1.0/specs/001-model-context-protocol/plan.md +0 -269
  53. yapi_mcp-0.1.0/specs/001-model-context-protocol/quickstart.md +0 -362
  54. yapi_mcp-0.1.0/specs/001-model-context-protocol/research.md +0 -285
  55. yapi_mcp-0.1.0/specs/001-model-context-protocol/spec.md +0 -128
  56. yapi_mcp-0.1.0/specs/001-model-context-protocol/tasks.md +0 -146
  57. yapi_mcp-0.1.0/src/__init__.py +0 -1
  58. yapi_mcp-0.1.0/src/server.py +0 -148
  59. yapi_mcp-0.1.0/src/yapi/client.py +0 -206
  60. yapi_mcp-0.1.0/tests/__init__.py +0 -1
  61. yapi_mcp-0.1.0/tests/test_config.py +0 -123
  62. yapi_mcp-0.1.0/tests/test_error_handling.py +0 -140
  63. yapi_mcp-0.1.0/tests/test_tools_contract.py +0 -129
  64. yapi_mcp-0.1.0/tests/test_yapi_client.py +0 -181
  65. yapi_mcp-0.1.0/uv.lock +0 -1316
  66. yapi_mcp-0.1.0/validate_server.py +0 -89
@@ -1,53 +1,56 @@
1
- # Python
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
- *.so
6
- .Python
7
- build/
8
- develop-eggs/
9
- dist/
10
- downloads/
11
- eggs/
12
- .eggs/
13
- lib/
14
- lib64/
15
- parts/
16
- sdist/
17
- var/
18
- wheels/
19
- *.egg-info/
20
- .installed.cfg
21
- *.egg
22
- MANIFEST
23
-
24
- # Virtual environments
25
- venv/
26
- ENV/
27
- env/
28
- .venv
29
-
30
- # Testing
31
- .pytest_cache/
32
- .coverage
33
- htmlcov/
34
- .tox/
35
- .hypothesis/
36
-
37
- # IDEs
38
- .vscode/
39
- .idea/
40
- *.swp
41
- *.swo
42
- *~
43
-
44
- # Environment variables (NEVER commit credentials!)
45
- .env
46
-
47
- # OS files
48
- .DS_Store
49
- Thumbs.db
50
-
51
- # MCP specific
52
- fastmcp.json
53
- *.log
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ venv/
26
+ ENV/
27
+ env/
28
+ .venv
29
+
30
+ # Testing
31
+ .pytest_cache/
32
+ .coverage
33
+ htmlcov/
34
+ .tox/
35
+ .hypothesis/
36
+
37
+ # IDEs
38
+ .vscode/
39
+ .idea/
40
+ *.swp
41
+ *.swo
42
+ *~
43
+
44
+ # Environment variables (NEVER commit credentials!)
45
+ .env
46
+
47
+ # OS files
48
+ .DS_Store
49
+ Thumbs.db
50
+
51
+ # MCP specific
52
+ fastmcp.json
53
+ *.log
54
+
55
+ pypi-token.txt
56
+ .ace-tool/
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 YApi MCP Server Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 YApi MCP Server Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: yapi-mcp
3
+ Version: 0.1.2
4
+ Summary: Model Context Protocol server for YApi 1.12.0 API management platform
5
+ Project-URL: Homepage, https://github.com/geq1fan/yapi-mcp
6
+ Project-URL: Repository, https://github.com/geq1fan/yapi-mcp
7
+ Project-URL: Issues, https://github.com/geq1fan/yapi-mcp/issues
8
+ Author: YApi MCP Team
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,fastmcp,mcp,model-context-protocol,yapi
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: fastmcp>=2.0.0
22
+ Requires-Dist: httpx>=0.27.0
23
+ Requires-Dist: pydantic-settings>=2.0.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
26
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
27
+ Requires-Dist: respx>=0.21.0; extra == 'dev'
28
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # YApi MCP Server
32
+
33
+ [![Python Version](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
34
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
35
+ [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
36
+
37
+ 基于 [YApi 1.12.0](https://github.com/YMFE/yapi) 接口管理平台的 Model Context Protocol (MCP) 服务器。
38
+
39
+ 使开发者能够在支持 MCP 的 IDE 和编辑器(Claude Code、Cursor 等)中直接搜索、查看、创建和更新 YApi 接口定义,无需离开开发环境。
40
+
41
+ ## 功能特性
42
+
43
+ - 🔍 **搜索接口**: 通过标题、路径或描述查找 API 端点
44
+ - 📖 **查看定义**: 获取完整的接口规范,包括请求/响应结构
45
+ - ➕ **创建接口**: 向 YApi 项目添加新的 API 定义
46
+ - ✏️ **更新接口**: 修改现有接口配置
47
+ - 🔐 **Cookie 认证**: 基于会话的安全认证
48
+ - ⚡ **异步性能**: 基于 httpx 实现高效的并发操作
49
+
50
+ ## 环境要求
51
+
52
+ - Python 3.11 或更高版本
53
+ - YApi 1.12.0 实例(可通过 HTTP/HTTPS 访问)
54
+ - 有效的 YApi 认证 cookies
55
+
56
+ ## 配置
57
+
58
+ ### 1. 获取 YApi Cookies
59
+
60
+ 1. 在浏览器中登录 YApi 实例
61
+ 2. 打开开发者工具(F12)
62
+ 3. 导航到 **Application** → **Cookies**(Chrome) 或 **Storage** → **Cookies**(Firefox)
63
+ 4. 复制以下 cookie 值:
64
+ - `_yapi_token` (必需)
65
+ - `_yapi_uid` (必需)
66
+ - `ZYBIPSCAS` (可选,仅某些自定义部署需要)
67
+
68
+ ### 2. 配置 MCP
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "yapi": {
74
+ "command": "uvx",
75
+ "args": ["--from", "/path/to/yapi-mcp", "yapi-mcp"],
76
+ "env": {
77
+ "YAPI_SERVER_URL": "https://your-yapi-instance.com",
78
+ "YAPI_TOKEN": "your_token",
79
+ "YAPI_UID": "your_uid"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ > **注意**: 如果你的 YApi 部署需要额外的 CAS 认证,添加 `"YAPI_CAS": "your_cas_value"` 到 `env` 中。
87
+
88
+ ## 开发
89
+
90
+ ### 运行测试
91
+
92
+ ```bash
93
+ # 安装开发依赖
94
+ pip install -e ".[dev]"
95
+
96
+ # 运行所有测试
97
+ pytest
98
+
99
+ # 运行并显示覆盖率
100
+ pytest --cov=src --cov-report=term-missing
101
+
102
+ # 运行特定测试文件
103
+ pytest tests/test_config.py
104
+ ```
105
+
106
+ ### 代码质量
107
+
108
+ ```bash
109
+ # 格式化代码
110
+ ruff format
111
+
112
+ # 代码检查
113
+ ruff check
114
+
115
+ # 自动修复检查问题
116
+ ruff check --fix
117
+ ```
118
+
119
+ ### 项目结构
120
+
121
+ ```
122
+ yapi-mcp/
123
+ ├── src/
124
+ │ ├── server.py # MCP 服务器入口点
125
+ │ ├── config.py # 配置模型
126
+ │ ├── yapi/
127
+ │ │ ├── client.py # YApi API 客户端
128
+ │ │ ├── models.py # Pydantic 数据模型
129
+ │ │ └── errors.py # 错误映射
130
+ │ └── tools/ # MCP 工具(在 server.py 中注册)
131
+ ├── tests/ # 测试套件
132
+ ├── specs/ # 设计文档
133
+ ├── pyproject.toml # 项目配置
134
+ ├── .env.example # 环境变量模板
135
+ └── README.md # 本文件
136
+ ```
137
+
138
+ ## 贡献
139
+
140
+ 欢迎贡献! 我们非常感谢各种形式的贡献,包括但不限于:
141
+
142
+ - 🐛 报告 Bug
143
+ - ✨ 建议新功能
144
+ - 📝 改进文档
145
+ - 💻 提交代码
146
+
147
+ 在开始贡献之前,请阅读我们的[贡献指南](CONTRIBUTING.md)。
148
+
149
+ ### 快速开始
150
+
151
+ 1. Fork 本仓库
152
+ 2. 创建功能分支 (`git checkout -b feature/amazing-feature`)
153
+ 3. 提交更改 (`git commit -m 'feat: 添加惊人的功能'`)
154
+ 4. 推送到分支 (`git push origin feature/amazing-feature`)
155
+ 5. 创建 Pull Request
156
+
157
+ ### 代码质量要求
158
+
159
+ - ✅ 所有测试通过: `pytest`
160
+ - ✅ 代码已格式化: `ruff format`
161
+ - ✅ 无检查错误: `ruff check`
162
+ - ✅ 新功能包含测试
163
+
164
+ 详细信息请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
165
+
166
+ ## 许可证
167
+
168
+ 本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
169
+
170
+ ## 相关项目
171
+
172
+ - [YApi](https://github.com/YMFE/yapi) - API 管理平台
173
+ - [fastmcp](https://github.com/jlowin/fastmcp) - Python MCP 框架
174
+ - [Model Context Protocol](https://modelcontextprotocol.io/) - MCP 规范
@@ -0,0 +1,144 @@
1
+ # YApi MCP Server
2
+
3
+ [![Python Version](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
4
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
+ [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
6
+
7
+ 基于 [YApi 1.12.0](https://github.com/YMFE/yapi) 接口管理平台的 Model Context Protocol (MCP) 服务器。
8
+
9
+ 使开发者能够在支持 MCP 的 IDE 和编辑器(Claude Code、Cursor 等)中直接搜索、查看、创建和更新 YApi 接口定义,无需离开开发环境。
10
+
11
+ ## 功能特性
12
+
13
+ - 🔍 **搜索接口**: 通过标题、路径或描述查找 API 端点
14
+ - 📖 **查看定义**: 获取完整的接口规范,包括请求/响应结构
15
+ - ➕ **创建接口**: 向 YApi 项目添加新的 API 定义
16
+ - ✏️ **更新接口**: 修改现有接口配置
17
+ - 🔐 **Cookie 认证**: 基于会话的安全认证
18
+ - ⚡ **异步性能**: 基于 httpx 实现高效的并发操作
19
+
20
+ ## 环境要求
21
+
22
+ - Python 3.11 或更高版本
23
+ - YApi 1.12.0 实例(可通过 HTTP/HTTPS 访问)
24
+ - 有效的 YApi 认证 cookies
25
+
26
+ ## 配置
27
+
28
+ ### 1. 获取 YApi Cookies
29
+
30
+ 1. 在浏览器中登录 YApi 实例
31
+ 2. 打开开发者工具(F12)
32
+ 3. 导航到 **Application** → **Cookies**(Chrome) 或 **Storage** → **Cookies**(Firefox)
33
+ 4. 复制以下 cookie 值:
34
+ - `_yapi_token` (必需)
35
+ - `_yapi_uid` (必需)
36
+ - `ZYBIPSCAS` (可选,仅某些自定义部署需要)
37
+
38
+ ### 2. 配置 MCP
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "yapi": {
44
+ "command": "uvx",
45
+ "args": ["--from", "/path/to/yapi-mcp", "yapi-mcp"],
46
+ "env": {
47
+ "YAPI_SERVER_URL": "https://your-yapi-instance.com",
48
+ "YAPI_TOKEN": "your_token",
49
+ "YAPI_UID": "your_uid"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ > **注意**: 如果你的 YApi 部署需要额外的 CAS 认证,添加 `"YAPI_CAS": "your_cas_value"` 到 `env` 中。
57
+
58
+ ## 开发
59
+
60
+ ### 运行测试
61
+
62
+ ```bash
63
+ # 安装开发依赖
64
+ pip install -e ".[dev]"
65
+
66
+ # 运行所有测试
67
+ pytest
68
+
69
+ # 运行并显示覆盖率
70
+ pytest --cov=src --cov-report=term-missing
71
+
72
+ # 运行特定测试文件
73
+ pytest tests/test_config.py
74
+ ```
75
+
76
+ ### 代码质量
77
+
78
+ ```bash
79
+ # 格式化代码
80
+ ruff format
81
+
82
+ # 代码检查
83
+ ruff check
84
+
85
+ # 自动修复检查问题
86
+ ruff check --fix
87
+ ```
88
+
89
+ ### 项目结构
90
+
91
+ ```
92
+ yapi-mcp/
93
+ ├── src/
94
+ │ ├── server.py # MCP 服务器入口点
95
+ │ ├── config.py # 配置模型
96
+ │ ├── yapi/
97
+ │ │ ├── client.py # YApi API 客户端
98
+ │ │ ├── models.py # Pydantic 数据模型
99
+ │ │ └── errors.py # 错误映射
100
+ │ └── tools/ # MCP 工具(在 server.py 中注册)
101
+ ├── tests/ # 测试套件
102
+ ├── specs/ # 设计文档
103
+ ├── pyproject.toml # 项目配置
104
+ ├── .env.example # 环境变量模板
105
+ └── README.md # 本文件
106
+ ```
107
+
108
+ ## 贡献
109
+
110
+ 欢迎贡献! 我们非常感谢各种形式的贡献,包括但不限于:
111
+
112
+ - 🐛 报告 Bug
113
+ - ✨ 建议新功能
114
+ - 📝 改进文档
115
+ - 💻 提交代码
116
+
117
+ 在开始贡献之前,请阅读我们的[贡献指南](CONTRIBUTING.md)。
118
+
119
+ ### 快速开始
120
+
121
+ 1. Fork 本仓库
122
+ 2. 创建功能分支 (`git checkout -b feature/amazing-feature`)
123
+ 3. 提交更改 (`git commit -m 'feat: 添加惊人的功能'`)
124
+ 4. 推送到分支 (`git push origin feature/amazing-feature`)
125
+ 5. 创建 Pull Request
126
+
127
+ ### 代码质量要求
128
+
129
+ - ✅ 所有测试通过: `pytest`
130
+ - ✅ 代码已格式化: `ruff format`
131
+ - ✅ 无检查错误: `ruff check`
132
+ - ✅ 新功能包含测试
133
+
134
+ 详细信息请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
135
+
136
+ ## 许可证
137
+
138
+ 本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
139
+
140
+ ## 相关项目
141
+
142
+ - [YApi](https://github.com/YMFE/yapi) - API 管理平台
143
+ - [fastmcp](https://github.com/jlowin/fastmcp) - Python MCP 框架
144
+ - [Model Context Protocol](https://modelcontextprotocol.io/) - MCP 规范
@@ -1,52 +1,69 @@
1
- [project]
2
- name = "yapi-mcp"
3
- version = "0.1.0"
4
- description = "Model Context Protocol server for YApi 1.12.0 API management platform"
5
- authors = [{ name = "YApi MCP Team" }]
6
- readme = "README.md"
7
- requires-python = ">=3.11"
8
- dependencies = [
9
- "fastmcp>=2.0.0",
10
- "httpx>=0.27.0",
11
- "pydantic-settings>=2.0.0",
12
- ]
13
-
14
- [project.optional-dependencies]
15
- dev = [
16
- "pytest>=8.0.0",
17
- "pytest-asyncio>=0.23.0",
18
- "respx>=0.21.0",
19
- "ruff>=0.4.0",
20
- ]
21
-
22
- [project.scripts]
23
- yapi-mcp = "server:main"
24
-
25
- [build-system]
26
- requires = ["hatchling"]
27
- build-backend = "hatchling.build"
28
-
29
- [tool.pytest.ini_options]
30
- asyncio_mode = "auto"
31
- testpaths = ["tests"]
32
- python_files = ["test_*.py"]
33
- python_classes = ["Test*"]
34
- python_functions = ["test_*"]
35
-
36
- [tool.ruff]
37
- line-length = 100
38
- target-version = "py311"
39
-
40
- [tool.ruff.lint]
41
- select = ["E", "F", "W", "I", "N", "UP", "ANN", "S", "B", "A", "C4", "DTZ", "T10", "EM", "ISC", "ICN", "G", "PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SIM", "TID", "TCH", "ARG", "PTH", "PD", "PGH", "PL", "TRY", "FLY", "NPY", "PERF", "RUF"]
42
- ignore = ["ANN101", "ANN102", "S101", "PLR0913"]
43
-
44
- [tool.ruff.format]
45
- quote-style = "double"
46
- indent-style = "space"
47
-
48
- [tool.hatch.build.targets.wheel]
49
- packages = ["src"]
50
-
51
- [tool.hatch.build.targets.wheel.sources]
52
- src = ""
1
+ [project]
2
+ name = "yapi-mcp"
3
+ version = "0.1.2"
4
+ description = "Model Context Protocol server for YApi 1.12.0 API management platform"
5
+ authors = [{ name = "YApi MCP Team" }]
6
+ readme = "README.md"
7
+ license = { text = "MIT" }
8
+ requires-python = ">=3.11"
9
+ keywords = ["mcp", "yapi", "api", "model-context-protocol", "fastmcp"]
10
+ classifiers = [
11
+ "Development Status :: 4 - Beta",
12
+ "Intended Audience :: Developers",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Topic :: Software Development :: Libraries :: Python Modules",
19
+ ]
20
+ dependencies = [
21
+ "fastmcp>=2.0.0",
22
+ "httpx>=0.27.0",
23
+ "pydantic-settings>=2.0.0",
24
+ ]
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/geq1fan/yapi-mcp"
28
+ Repository = "https://github.com/geq1fan/yapi-mcp"
29
+ Issues = "https://github.com/geq1fan/yapi-mcp/issues"
30
+
31
+ [project.optional-dependencies]
32
+ dev = [
33
+ "pytest>=8.0.0",
34
+ "pytest-asyncio>=0.23.0",
35
+ "respx>=0.21.0",
36
+ "ruff>=0.4.0",
37
+ ]
38
+
39
+ [project.scripts]
40
+ yapi-mcp = "yapi_mcp:main"
41
+
42
+ [build-system]
43
+ requires = ["hatchling"]
44
+ build-backend = "hatchling.build"
45
+
46
+ [tool.pytest.ini_options]
47
+ asyncio_mode = "auto"
48
+ testpaths = ["tests"]
49
+ python_files = ["test_*.py"]
50
+ python_classes = ["Test*"]
51
+ python_functions = ["test_*"]
52
+
53
+ [tool.ruff]
54
+ line-length = 100
55
+ target-version = "py311"
56
+
57
+ [tool.ruff.lint]
58
+ select = ["E", "F", "W", "I", "N", "UP", "ANN", "S", "B", "A", "C4", "DTZ", "T10", "EM", "ISC", "ICN", "G", "PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SIM", "TID", "TCH", "ARG", "PTH", "PD", "PGH", "PL", "TRY", "FLY", "NPY", "PERF", "RUF"]
59
+ ignore = ["ANN101", "ANN102", "S101", "PLR0913"]
60
+
61
+ [tool.ruff.format]
62
+ quote-style = "double"
63
+ indent-style = "space"
64
+
65
+ [tool.hatch.build.targets.wheel]
66
+ packages = ["src/yapi_mcp"]
67
+
68
+ [tool.hatch.build.targets.sdist]
69
+ include = ["src/yapi_mcp"]
@@ -0,0 +1,5 @@
1
+ """YApi MCP Server - Model Context Protocol adapter for YApi."""
2
+
3
+ from yapi_mcp.server import main, mcp
4
+
5
+ __all__ = ["main", "mcp"]
@@ -0,0 +1,6 @@
1
+ """Entry point for running yapi-mcp as a module: python -m yapi_mcp."""
2
+
3
+ from yapi_mcp.server import main
4
+
5
+ if __name__ == "__main__":
6
+ main()