lucius-mcp 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

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 (39) hide show
  1. lucius_mcp-0.4.0.dist-info/METADATA +124 -0
  2. {lucius_mcp-0.3.0.dist-info → lucius_mcp-0.4.0.dist-info}/RECORD +38 -29
  3. src/client/__init__.py +6 -0
  4. src/client/client.py +271 -7
  5. src/client/exceptions.py +23 -0
  6. src/client/generated/README.md +18 -0
  7. src/client/generated/__init__.py +2 -0
  8. src/client/generated/api/__init__.py +1 -0
  9. src/client/generated/api/integration_controller_api.py +5285 -0
  10. src/client/generated/docs/IntegrationControllerApi.md +1224 -0
  11. src/services/__init__.py +9 -1
  12. src/services/custom_field_value_service.py +301 -0
  13. src/services/integration_service.py +205 -0
  14. src/services/launch_service.py +29 -1
  15. src/services/shared_step_service.py +34 -17
  16. src/services/test_case_service.py +269 -37
  17. src/services/test_layer_service.py +11 -0
  18. src/tools/__init__.py +19 -1
  19. src/tools/create_custom_field_value.py +38 -0
  20. src/tools/create_test_case.py +32 -2
  21. src/tools/delete_custom_field_value.py +57 -0
  22. src/tools/delete_test_case.py +5 -4
  23. src/tools/delete_test_layer.py +17 -4
  24. src/tools/delete_test_layer_schema.py +17 -4
  25. src/tools/launches.py +86 -0
  26. src/tools/link_shared_step.py +18 -12
  27. src/tools/list_custom_field_values.py +72 -0
  28. src/tools/list_integrations.py +77 -0
  29. src/tools/search.py +3 -3
  30. src/tools/shared_steps.py +23 -8
  31. src/tools/unlink_shared_step.py +19 -5
  32. src/tools/update_custom_field_value.py +55 -0
  33. src/tools/update_test_case.py +67 -2
  34. src/tools/update_test_layer.py +15 -4
  35. src/tools/update_test_layer_schema.py +16 -5
  36. lucius_mcp-0.3.0.dist-info/METADATA +0 -297
  37. {lucius_mcp-0.3.0.dist-info → lucius_mcp-0.4.0.dist-info}/WHEEL +0 -0
  38. {lucius_mcp-0.3.0.dist-info → lucius_mcp-0.4.0.dist-info}/entry_points.txt +0 -0
  39. {lucius_mcp-0.3.0.dist-info → lucius_mcp-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,297 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: lucius-mcp
3
- Version: 0.3.0
4
- Summary: Allure TestOps MCP Server
5
- Project-URL: Homepage, https://github.com/ivanostanin/lucius-mcp
6
- Project-URL: Documentation, https://github.com/ivanostanin/lucius-mcp#readme
7
- Project-URL: Repository, https://github.com/ivanostanin/lucius-mcp.git
8
- Project-URL: Issues, https://github.com/ivanostanin/lucius-mcp/issues
9
- Project-URL: Changelog, https://github.com/ivanostanin/lucius-mcp/blob/main/CHANGELOG.md
10
- Project-URL: Releases, https://github.com/ivanostanin/lucius-mcp/releases
11
- Author-email: Ivan Ostanin <ivan@ostanin.me>
12
- License-Expression: Apache-2.0
13
- License-File: LICENSE
14
- Keywords: allure,allure-testops,fastmcp,mcp,mcp-server,model-context-protocol,testops
15
- Classifier: Development Status :: 4 - Beta
16
- Classifier: Environment :: Console
17
- Classifier: Intended Audience :: Developers
18
- Classifier: Natural Language :: English
19
- Classifier: Operating System :: OS Independent
20
- Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.14
22
- Classifier: Topic :: Software Development
23
- Classifier: Topic :: Software Development :: Quality Assurance
24
- Classifier: Topic :: Software Development :: Testing
25
- Classifier: Topic :: Utilities
26
- Classifier: Typing :: Typed
27
- Requires-Python: >=3.14
28
- Requires-Dist: fastmcp>=2.14.4
29
- Requires-Dist: httpx>=0.28.1
30
- Requires-Dist: pydantic-settings>=2.12.0
31
- Requires-Dist: pydantic>=2.12.5
32
- Requires-Dist: python-dateutil>=2.9.0.post0
33
- Requires-Dist: python-json-logger>=2.0.7
34
- Requires-Dist: rich>=13.7.0
35
- Requires-Dist: starlette==0.52.1
36
- Requires-Dist: uvicorn>=0.40.0
37
- Requires-Dist: wsproto>=1.3.2
38
- Provides-Extra: dev
39
- Requires-Dist: allure-pytest>=2.15.3; extra == 'dev'
40
- Requires-Dist: faker>=40.1.2; extra == 'dev'
41
- Requires-Dist: mypy>=1.19.1; extra == 'dev'
42
- Requires-Dist: openapi-generator-cli>=7.19.0; extra == 'dev'
43
- Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
44
- Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
45
- Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
46
- Requires-Dist: pytest-mock>=3.15.1; extra == 'dev'
47
- Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
48
- Requires-Dist: pytest>=9.0.2; extra == 'dev'
49
- Requires-Dist: respx>=0.22.0; extra == 'dev'
50
- Requires-Dist: ruff>=0.14.14; extra == 'dev'
51
- Requires-Dist: twine>=6.2.0; extra == 'dev'
52
- Description-Content-Type: text/markdown
53
-
54
- # Lucius MCP Server
55
-
56
- A Model Context Protocol (MCP) server for Allure TestOps, built with `FastMCP` and `Starlette`.
57
-
58
- ## 🚀 Features
59
-
60
- - **FastMCP Integration**: Leverages the FastMCP framework for efficient tool and resource management.
61
- - **Starlette Mounting**: Mounted as a Starlette application for robust HTTP handling and easy extension.
62
- - **Structured Logging**: JSON-formatted logging with automatic secret masking (powered by `src/utils/logger.py`).
63
- - **Global Error Handling**: User-friendly "Agent Hint" error responses optimized for LLM consumption (powered by `src/utils/error.py`).
64
- - **Type Safety**: Fully typed codebase checked with `mypy --strict`.
65
- - **Quality Assurance**: Linting and formatting with `ruff`.
66
-
67
- ## ⚙️ Configuration
68
-
69
- The server can be configured using environment variables or a `.env` file.
70
-
71
- | Variable | Description | Default |
72
- | :--- | :--- |:-----------------------------|
73
- | `ALLURE_ENDPOINT` | Allure TestOps Base URL | `https://demo.testops.cloud` |
74
- | `ALLURE_PROJECT_ID` | Default Project ID | `None` |
75
- | `ALLURE_API_TOKEN` | Allure API Token | `None` |
76
- | `LOG_LEVEL` | Logging level | `INFO` |
77
- | `HOST` | Host to bind the server to | `127.0.0.1` |
78
- | `PORT` | Port to bind the server to | `8000` |
79
- | `MCP_MODE` | Running mode: `http` or `stdio` | `stdio` |
80
-
81
- ## 🛠️ Installation
82
-
83
- This project uses `uv` for dependency management.
84
-
85
- 1. **Install `uv`** (if not already installed):
86
- ```bash
87
- curl -LsSf https://astral.sh/uv/install.sh | sh
88
- ```
89
-
90
- 2. **Clone the repository**:
91
- ```bash
92
- git clone https://github.com/lucius-mcp/lucius-mcp.git
93
- cd lucius-mcp
94
- ```
95
-
96
- 3. **Install dependencies**:
97
- ```bash
98
- uv sync
99
- ```
100
-
101
- ## 🏃 Usage
102
-
103
- ### Add to Claude Code (MCP)
104
-
105
- 1. **Add the MCP**:
106
- ```bash
107
- claude mcp add testops-mcp --transport stdio \
108
- --env ALLURE_ENDPOINT=https://your-testops.example \
109
- --env ALLURE_PROJECT_ID=123 \
110
- --env ALLURE_API_TOKEN=your_token \
111
- --env MCP_MODE=stdio \
112
- -- uvx --from lucius-mcp start
113
- ```
114
-
115
- ### Running via Claude Desktop (One-Click Install)
116
-
117
- The easiest way to use Lucius in Claude Desktop is via the `.mcpb` bundle:
118
-
119
- 1. **Download** the latest `lucius-mcp-x.y.z.mcpb` from the [GitHub Releases](https://github.com/lucius-mcp/lucius-mcp/releases).
120
- 2. **Open** the file with Claude Desktop (macOS or Windows).
121
- 3. **Approve** the installation in the dialog.
122
- 4. **Configure** your Allure TestOps credentials in the provided fields.
123
-
124
- ### Running via Stdio
125
-
126
- For integration with MCP clients (like Claude Code) using standard input/output.
127
-
128
- ```bash
129
- uv run start
130
- ```
131
-
132
- Or
133
-
134
- ```bash
135
- MCP_MODE=stdio uv run start
136
- ```
137
-
138
-
139
- ### Running via HTTP
140
-
141
- Starts the server with hot-reloading enabled (default port: 8000).
142
-
143
- ```bash
144
- MCP_MODE=http uv run start
145
- ```
146
-
147
- Or customizing host and port:
148
-
149
- ```bash
150
- HOST=0.0.0.0 PORT=9000 uv run start
151
- ```
152
-
153
- ### Local Workflow Testing (act)
154
-
155
- To run GitHub Actions locally using `nektos/act`:
156
-
157
- 1. **Install `act`**:
158
- ```bash
159
- brew install act
160
- ```
161
-
162
- 2. **Run a workflow**:
163
- ```bash
164
- # Run a specific workflow (e.g., CI)
165
- act -W .github/workflows/pr-quality-gate.yml
166
- ```
167
-
168
- > **Note**: The `--artifact-server-path` flag is required to handle artifact uploads/downloads locally. Artifacts will be stored in `.artifacts/`.
169
-
170
- ## 📦 Packaging (MCPB)
171
-
172
- Lucius supports the [MCP Bundle (MCPB)](https://github.com/modelcontextprotocol/mcpb) format for easy distribution.
173
-
174
- ### Building for Claude Desktop
175
-
176
- To build a `.mcpb` bundle locally:
177
-
178
- 1. **Install Node.js** (v20+ recommended).
179
- 2. **Install the mcpb CLI**:
180
- ```bash
181
- npm install -g @anthropic-ai/mcpb
182
- ```
183
- 3. **Run the build script**:
184
- ```bash
185
- ./deployment/scripts/build-mcpb.sh
186
- ```
187
- The versioned bundles will be available in the `dist/` directory:
188
- - `lucius-mcp-<version>-uv.mcpb`
189
- - `lucius-mcp-<version>-python.mcpb`
190
-
191
- ### Manifests
192
-
193
- Bundle manifests live in `deployment/mcpb/`:
194
- - `manifest.uv.json`
195
- - `manifest.python.json`
196
-
197
- ### Validation
198
-
199
- Validate each manifest against the code:
200
-
201
- ```bash
202
- python deployment/scripts/validate_mcpb.py uv
203
- python deployment/scripts/validate_mcpb.py python
204
- ```
205
-
206
- ### UV Runtime
207
-
208
- The `uv` bundle uses the `uv` runtime type, which means:
209
- - Dependencies are defined in `pyproject.toml` and `uv.lock`.
210
- - Claude Desktop will automatically manage the Python environment and dependencies for the user.
211
- - No local Python installation is required for the end-user.
212
-
213
-
214
- ## 🧪 Testing
215
-
216
- Run the test suite using `pytest`:
217
-
218
- ```bash
219
- uv run pytest
220
- ```
221
-
222
- ### End-to-End (E2E) Tests
223
-
224
- E2E tests verify the integration with a real Allure TestOps instance. They are isolated in `tests/e2e/` and strictly separated from unit/integration tests.
225
-
226
- **Prerequisites:**
227
-
228
- 1. **Sandbox Environment**: Access to a non-production Allure TestOps instance.
229
- 2. **Configuration**: Create `.env.test` from `.env.test.example`:
230
- ```bash
231
- cp .env.test.example .env.test
232
- ```
233
-
234
- **Running E2E Tests:**
235
-
236
- ```bash
237
- # Load environment variables from .env.test
238
- uv run --env-file .env.test pytest tests/e2e/
239
- ```
240
-
241
- ```bash
242
- # Run e2e tests in parallel mode
243
- uv run --env-file .env.test pytest tests/e2e/ -n auto --dist loadfile
244
- ```
245
-
246
-
247
- **Troubleshooting E2E Failures:**
248
-
249
- * **401 Unauthorized**: Check `ALLURE_API_TOKEN`. It might be expired.
250
- * **403 Forbidden**: Ensure `ALLURE_PROJECT_ID` exists and the user has Write access.
251
- * **Connection Errors**: Verify `ALLURE_ENDPOINT` is reachable and uses HTTPS.
252
- * **Flaky Tests**: Tests use unique IDs to avoid collisions, but network issues can occur. Rerunning usually fixes transient issues.
253
-
254
- ## 🛠️ Development
255
-
256
- ### Regenerating API Client
257
-
258
- To maintain spec-fidelity while keeping the client lightweight, we use a 2-step process:
259
- 1. **Filter Spec**: `scripts/filter_openapi.py` reduces the massive OpenAPI spec to only the essential controllers (Test Cases, Shared Steps, Projects).
260
- 2. **Generate Client**: `openapi-generator-cli` builds the client from the filtered spec.
261
-
262
- - **Generated Client (`src/client/generated/`)**: Auto-generated `ApiClient`, API controllers, and Pydantic v2 models.
263
- - **Client Facade (`src/client/client.py`)**: `AllureClient` wrapper that handles authentication, error mapping, and helper methods.
264
- - **Model Facade (`src/client/models/`)**: Re-exports generated models for simplified import paths and logical grouping.
265
-
266
- **To regenerate the client after updating the spec:**
267
-
268
- ```bash
269
- ./scripts/generate_testops_api_client.sh
270
- ```
271
-
272
- > **Note**: Do not manually edit files in `src/client/generated/`.
273
-
274
- ## 🧹 Quality Checks
275
-
276
- **Formatting**:
277
- ```bash
278
- uv run ruff format .
279
- ```
280
-
281
- **Linting**:
282
- ```bash
283
- uv run ruff check src/
284
- ```
285
-
286
- **Type Checking**:
287
- ```bash
288
- uv run mypy --strict src/
289
- ```
290
-
291
- ## Release process
292
- 1. Bump version in `pyproject.toml`.
293
- 2. Run `uv sync --all-extras` to update dependencies.
294
- 3. Write release notes in `CHANGELOG.md`.
295
- 4. Commit changes.
296
- 5. Create a tag with the new version.
297
- 6. Push commits and tags.