hamravesh-mcp 0.1.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/ENDPOINTS.md ADDED
@@ -0,0 +1,245 @@
1
+ # Hamravesh Console API — فهرست کامل Endpointها
2
+
3
+ > همراه `HAMRAVESH-API.md` بخوان (آنجا base URL، احراز هویت و هدرها توضیح داده شده).
4
+ > `{paas}` = نام محصول (دارکوب = `darkube`). `{id}` = شناسه‌ی منبع. `{app_id}` = شناسه‌ی اپ دیتابیس.
5
+ > همه روی base `https://api.hamravesh.com` با هدر `Authorization` + `X-Organization`.
6
+ > ستون Methods نشان‌دهنده‌ی متدهای دیده‌شده روی همان مسیر است.
7
+
8
+ ## Auth & Users
9
+
10
+ | Methods | Path |
11
+ |---|---|
12
+ | POST | `/api/v1/token/` |
13
+ | POST | `/api/v1/token/refresh/` |
14
+ | GET, POST, DELETE | `/api/v1/apikeys/` , `/api/v1/apikeys/{id}/` |
15
+ | GET | `/api/v2/users/profile` (پروفایل + لیست سازمان‌ها/کلاسترها/بودجه) |
16
+ | PUT | `/api/v2/users/profile` , `/api/v1/users/profile` |
17
+ | GET | `/api/v1/2fa/status/` , `/api/v1/2fa/setup/` |
18
+ | POST | `/api/v1/2fa/enable/` , `/api/v1/2fa/disable/` |
19
+ | GET | `/api/v1/account/available_clusters/` |
20
+ | POST | `/api/v1/account/cluster/cluster_ingress_host_name/` |
21
+ | POST | `/api/v1/oauth/auth/` |
22
+ | GET | `/api/v1/oauth/authorization_request/?oauth_provider={id}` |
23
+ | POST | `/api/v1/users/change_password/` , `/api/v1/users/forget_password/` , `/api/v1/users/reset_password/` |
24
+ | GET | `/api/v1/users/check_email/?email=` , `/api/v1/users/check_org_name/?org_name=` , `/api/v1/users/check_username/?username=` |
25
+ | POST | `/api/v1/users/onboard/` , `/api/v1/users/verify_mobile/` , `/api/v1/users/send_verification_sms/` |
26
+ | POST | `/api/v2/users/register_user/` , `/api/v2/users/update_email/` , `/api/v2/users/verify_email/` , `/api/v2/users/verify_mobile/` , `/api/v2/users/verify_mobile_national_id/` |
27
+
28
+ ## PaaS / Darkube apps ({paas} = darkube)
29
+
30
+ | Methods | Path |
31
+ |---|---|
32
+ | POST | `/api/v1/{paas}/apps/` |
33
+ | GET | `/api/v1/{paas}/apps/?limit=400&offset=0&fields=id,namespace,cluster,state,name,creation_method,is_deployable,log_aggregation_config` |
34
+ | GET, PATCH, PUT, DELETE | `/api/v1/{paas}/apps/{id}/` |
35
+ | GET | `/api/v1/{paas}/apps/{id}/alerts/` |
36
+ | GET | `/api/v1/{paas}/apps/{id}/app_containers/` |
37
+ | POST | `/api/v1/{paas}/apps/{id}/app_files/` |
38
+ | GET | `/api/v1/{paas}/apps/{id}/app_log/?from_index=&to_index=&reference_index=&pod_name=&container_name=&previous=` |
39
+ | GET | `/api/v1/{paas}/apps/{id}/available_upgrades/` |
40
+ | GET | `/api/v1/{paas}/apps/{id}/certificate_status/` |
41
+ | POST | `/api/v1/{paas}/apps/{id}/check_repo/` |
42
+ | GET | `/api/v1/{paas}/apps/{id}/manifests/` |
43
+ | POST | `/api/v1/{paas}/apps/{id}/migrate/` |
44
+ | GET | `/api/v1/{paas}/apps/{id}/operations/?type=version_upgrade&type=version_rollback` |
45
+ | GET, POST, DELETE | `/api/v1/{paas}/apps/{id}/plugins/` |
46
+ | GET | `/api/v1/{paas}/apps/{id}/read_all_vault_secret_envs/` |
47
+ | POST | `/api/v1/{paas}/apps/{id}/read_vault_secret_env/` , `/api/v1/{paas}/apps/{id}/read_vault_secret/` |
48
+ | POST | `/api/v1/{paas}/apps/{id}/reinstall/` |
49
+ | POST | `/api/v1/{paas}/apps/{id}/restart/` |
50
+ | GET | `/api/v1/{paas}/apps/{id}/rollback_version/` |
51
+ | POST | `/api/v1/{paas}/apps/{id}/ssl_certificate_records/` |
52
+ | POST | `/api/v1/{paas}/apps/{id}/suggestions/` |
53
+ | POST | `/api/v1/{paas}/apps/{id}/upgrade_version/` |
54
+ | POST | `/api/v1/{paas}/apps/check_dns_records/` , `/api/v1/{paas}/apps/check_subdomain/` |
55
+ | POST | `/api/v1/{paas}/apps/docker_compose/` , `/api/v1/{paas}/apps/schedule_info/` |
56
+ | GET | `/api/v1/{paas}/build/{id}/` , `/api/v1/{paas}/build/{id}/retry/` |
57
+ | POST | `/api/v1/{paas}/build/{id}/stop/` |
58
+ | GET | `/api/v1/{paas}/build/app/{id}/?limit=&offset=` |
59
+ | GET | `/api/v1/{paas}/build/build_last_commit/?app_id={id}&deploy=true` (تریگر دیپلوی) |
60
+ | GET | `/api/v1/{paas}/certificates/` , `/api/v1/{paas}/certificates/?cluster_id=` |
61
+ | GET, POST | `/api/v1/{paas}/deploy_contexts/` |
62
+ | GET, PUT, DELETE | `/api/v1/{paas}/deploy_contexts/{id}/` |
63
+ | POST | `/api/v1/{paas}/github/branches/` , `/api/v1/{paas}/gitlab/branches/` |
64
+ | GET | `/api/v1/{paas}/github/installed/` , `/api/v1/{paas}/github/repos/` , `/api/v1/{paas}/gitlab/installed/` , `/api/v1/{paas}/gitlab/repos/` |
65
+ | GET | `/api/v1/{paas}/kubeconfig/generate/` |
66
+ | POST | `/api/v1/{paas}/license/confluence/` , `/license/jira/` , `/license/jirasm/` , `/license/plugin/` |
67
+ | POST | `/api/v1/{paas}/logs/loki/` |
68
+ | POST | `/api/v1/{paas}/namespaces/` |
69
+ | GET | `/api/v1/{paas}/namespaces/{id}/` |
70
+ | GET, POST | `/api/v1/{paas}/nodepools/` |
71
+ | GET | `/api/v1/{paas}/nodes/?cluster_id=` |
72
+ | POST | `/api/v1/{paas}/nodes/create_and_join/` , `/nodes/increase_disk_size/` , `/nodes/join/` |
73
+ | GET | `/api/v1/{paas}/permissions/` |
74
+ | GET, PUT | `/api/v1/{paas}/permissions/app/{id}/` , `/api/v1/{paas}/permissions/user/{id}/` |
75
+ | GET | `/api/v1/{paas}/plans/` , `/api/v1/{paas}/plans/disk/` |
76
+ | POST | `/api/v1/{paas}/plans/calculator/` |
77
+ | GET | `/api/v1/{paas}/security_scans/?app_id=&limit=&offset=` , `/security_scans/{id}/` , `/security_scans/summary/` , `/security_scans/scan_image/?app_id=` |
78
+ | GET | `/api/v1/{paas}/stateless_apps/{id}/generate_cicd_scripts` , `/generate_gitlabci_jobs/` , `/history/?start_time=&end_time=` , `/secret/?secret_fields=` |
79
+ | POST | `/api/v1/{paas}/stateless_apps/sync_apps_data/` |
80
+ | GET, DELETE | `/api/v1/{paas}/template/` |
81
+
82
+ ### Darkube (سراسری / دیتابیس‌محور)
83
+ | Methods | Path |
84
+ |---|---|
85
+ | GET | `/api/v1/darkube/apps/{id}/app_pvc_backups/` , `/backup/` , `/backup/operations/` , `/backup/statistics/` |
86
+ | POST | `/api/v1/darkube/apps/{id}/backup/download_information/` , `/backup/trigger_backup/` , `/backup/trigger_restore/` , `/compatible_plan/` |
87
+ | GET | `/api/v1/darkube/certificates` |
88
+ | PUT | `/api/v1/darkube/database/user/{id}` , `/api/v1/darkube/promote-to-master/{id}` |
89
+ | GET, POST | `/api/v1/darkube/loadbalancers/` |
90
+ | GET, PUT, DELETE | `/api/v1/darkube/loadbalancers/{id}` , `/api/v1/darkube/loadbalancers/{id}/` |
91
+ | POST | `/api/v1/darkube/loadbalancers/{id}/redeploy_apps/` |
92
+ | GET | `/api/v1/darkube/nses/?cluster_id=` |
93
+ | GET | `/api/v1/darkube/pgbadger/report/{id}/?report_address=` , `/report/list/{id}/?year=&month=` , `/summary/{id}/?report_address=` |
94
+ | POST | `/api/v1/darkube/postgres_standby/check` |
95
+ | GET | `/api/v1/darkube/pvcs/?namespace_name=&cluster_id=` |
96
+ | POST | `/api/v1/darkube/pvcs/defrag/` , `/pvcs/migrate/?pvc_name=&dst_size=&namespace_name=` , `/pvcs/restore_pvc_backup/` , `/pvcs/sync/` |
97
+ | PUT | `/api/v1/darkube/apps/update_from_cli/` (دیپلوی رسمی با deploy token — base: `api.console.hamravesh.ir`) |
98
+
99
+ ## DBaaS (databases)
100
+
101
+ | Methods | Path |
102
+ |---|---|
103
+ | GET | `/dbaas/api/v1/account/available_clusters/` |
104
+ | GET, POST | `/dbaas/api/v1/app/database/` |
105
+ | GET, PUT, DELETE | `/dbaas/api/v1/app/database/{app_id}/` |
106
+ | GET | `/dbaas/api/v1/app/database/{app_id}/certificate/` |
107
+ | POST | `/dbaas/api/v1/app/database/{app_id}/external_access/` , `/internal_access/` , `/shutdown/` , `/start/` |
108
+ | GET | `/dbaas/api/v1/app/database/{app_id}/logs/?end_time=&start_time=&limit=` |
109
+ | POST | `/dbaas/api/v1/app/database/{id}/promote/` , `/database/compatibility_check/` , `/database/readonly-cluster/` |
110
+ | GET, PUT | `/dbaas/api/v1/app/database/config/{app_id}/` |
111
+ | GET, POST | `/dbaas/api/v1/app/db/database/{app_id}/` |
112
+ | DELETE | `/dbaas/api/v1/app/db/database/{app_id}/{id}/` |
113
+ | GET | `/dbaas/api/v1/app/insight/{app_id}?start_time=&end_time=&metric_option=` |
114
+ | GET, PUT | `/dbaas/api/v1/app/permissions/database/{app_id}/` |
115
+ | GET, POST, DELETE | `/dbaas/api/v1/app/pghero/{app_id}` |
116
+ | GET | `/dbaas/api/v1/app/pitr_information/{app_id}` , `/app/restore/range/{app_id}/` |
117
+ | GET | `/dbaas/api/v1/app/plans/` , `/app/plans/calculator/?is_managed=&is_on_premise=&cpu=&ram=&disk=&num_of_standbys=` |
118
+ | GET, POST | `/dbaas/api/v1/app/pools/database/{app_id}/` |
119
+ | PUT, DELETE | `/dbaas/api/v1/app/pools/database/{app_id}/{id}/` |
120
+ | GET, POST | `/dbaas/api/v1/app/query-analysis/{app_id}/...` (`/is-active/` , `/activate/` , `/report/`) |
121
+ | GET | `/dbaas/api/v1/app/secrets/?secret_path=` |
122
+ | GET, POST | `/dbaas/api/v1/app/user/database/{app_id}/` |
123
+ | DELETE | `/dbaas/api/v1/app/user/database/{app_id}/{id}/` |
124
+ | PUT | `/dbaas/api/v1/app/user/database/{app_id}/{id}/change_password/` |
125
+ | GET | `/dbaas/api/v1/app/backups/{app_id}/` , `/list/` , `/operations/` , `/snapshots/` , `/statistics/` |
126
+ | POST | `/dbaas/api/v1/app/backups/{app_id}/download_info/` , `/trigger_backup/` |
127
+ | GET | `/dbaas/api/v1/pgbadger/report/{id}/` , `/report/list/{id}/` , `/summary/{id}/` |
128
+ | GET | `/api/v1/services/?kind=postgres|mysql|mongo|redis|minio` (سرویس‌های قابل اتصال) |
129
+
130
+ ## Container Registry
131
+
132
+ | Methods | Path |
133
+ |---|---|
134
+ | GET, POST | `/api/v1/registry/` |
135
+ | DELETE | `/api/v1/registry/{id}/` |
136
+ | POST | `/api/v1/registry/{id}/change_password/` , `/read_vault_secret/` |
137
+ | GET | `/api/v1/registry/{id}/list_repositories/?offset=&limit=10` , `/storage_usage` |
138
+ | POST | `/api/v1/registry/{id}/list_repository_digests/` , `/delete_digests/` , `/delete_repository/` , `/delete_tags/` |
139
+ | GET, POST | `/api/v1/registry-gc-strategies/` |
140
+ | PUT, DELETE | `/api/v1/registry-gc-strategies/{id}` , `/{id}/` |
141
+
142
+ ## Monitoring & Logging
143
+
144
+ | Methods | Path |
145
+ |---|---|
146
+ | GET, POST | `/api/v1/datasources/` |
147
+ | GET, DELETE | `/api/v1/datasources/{id}/` , `/api/v1/datasources/{id}` |
148
+ | POST | `/api/v1/datasources/{id}/users/` |
149
+ | GET, POST | `/api/v1/dazzle/metric-datasources/` |
150
+ | DELETE | `/api/v1/dazzle/metric-datasources/{id}/` |
151
+ | GET | `/api/v1/dazzle/metric-datasource-plans/` |
152
+ | POST | `/api/v1/dazzle/metric-datasources/{id}/read_vault_secret/` |
153
+ | GET, POST | `/api/v1/hamartia/datasources/` |
154
+ | DELETE | `/api/v1/hamartia/datasources/{id}/` |
155
+ | GET, POST | `/api/v1/hamartia/datasources/{id}/pipelines/` |
156
+ | DELETE | `/api/v1/hamartia/datasources/{id}/pipelines/?pipeline_id=` |
157
+ | POST | `/api/v1/hamartia/datasources/{id}/read_vault_secret/` |
158
+ | GET | `/api/v1/hamartia/plans/` |
159
+ | GET, POST | `/api/v1/logstorage/loki/` |
160
+ | GET, PUT, DELETE | `/api/v1/logstorage/loki/{id}/` |
161
+ | GET | `/api/v1/logstorage/custom/` |
162
+ | POST | `/api/v1/loki/usages/` |
163
+ | GET | `/api/v1/zones/` , `/api/v1/zones/?controller_loki_service=` |
164
+ | GET | `/api/v1/plans/?zone_name=` , `/api/v1/plans/?zone_name=&controller_loki_service=` |
165
+ | GET | `/api/v1/query_range/` , `/api/v1/app/insight/query_range/` |
166
+
167
+ ## Marketplace / SaaS (one-click apps)
168
+
169
+ | Methods | Path |
170
+ |---|---|
171
+ | GET | `/api/v1/app/products/` , `/{id}/` , `/{id}/plans/` , `/{id}/details/` , `/{id}/available_versions/` , `/{id}/sidebar_links/` , `/{id}/support/` |
172
+ | GET, POST | `/api/v1/app/saas/` |
173
+ | GET, PUT, DELETE | `/api/v1/app/saas/{id}/` |
174
+ | GET | `/api/v1/app/saas/{id}/available_upgrades/` , `/containers/` , `/pod_status/` , `/version_rollback/` , `/list_performed_upgrades/` |
175
+ | GET | `/api/v1/app/saas/{id}/get_last_workflow_status/` , `/get_last_workflow_progress_detail/` , `/check_dns_records/` |
176
+ | POST | `/api/v1/app/saas/{id}/restart/` , `/check_upgrade_compatibility/` , `/shown_field/` , `/ssl_certificate_records/` , `/set_ssl_challenge_type/` |
177
+ | POST | `/api/v1/app/saas/{id}/enable_filebrowser/` , `/disable_filebrowser/` , `/backup/trigger_backup/` , `/backup/trigger_restore/` , `/backup/download_info/` |
178
+ | GET | `/api/v1/app/saas/{id}/backup/` , `/backup/operations?backup_id=` |
179
+ | PUT | `/api/v1/app/saas/{id}/version_upgrade/` |
180
+ | POST | `/api/v1/app/saas/set_ssl_challenge_dns01/` , `/api/v1/app/license/{id}/` |
181
+ | GET | `/api/v1/app/products/{id}/plans/` , `/api/v1/app/tags/` , `/api/v1/app/insight/resource_limits/{id}/` |
182
+
183
+ ## Organizations & Members
184
+
185
+ | Methods | Path |
186
+ |---|---|
187
+ | PUT | `/api/v1/organizations/{id}/edit` |
188
+ | GET, PUT | `/api/v1/organizations/{id}/members` (GET لیست اعضا، PUT ویرایش نقش/دعوت) |
189
+ | GET | `/api/v1/organizations/{id}/transfer-status` |
190
+ | POST | `/api/v1/organizations/{id}/initiate-transfer` , `/accept-transfer` , `/reject-transfer` , `/cancel-transfer` , `/leave` |
191
+ | POST, DELETE | `/api/v1/organizations/{id}/enforce-2fa/` |
192
+ | POST | `/api/v1/organizations/join_by_token` |
193
+
194
+ ## Billing & Financial
195
+
196
+ | Methods | Path |
197
+ |---|---|
198
+ | GET | `/api/v1/billing/billing-accounts/{id}/` |
199
+ | GET | `/api/v1/billing/wallets/` , `/wallet-transactions/` , `/wallet-transactions/{id}/receipt/` |
200
+ | GET | `/api/v1/billing/financial_transactions/` , `/{id}/receipt/` |
201
+ | POST | `/api/v1/billing/financial_transactions/self_reporting_transaction/` |
202
+ | GET | `/api/v1/billing/invoices/` , `/{id}/` , `/{id}/export/` , `/official_invoices/` |
203
+ | POST | `/api/v1/billing/invoices/export_report/` , `/invoices/invoice_settings/` |
204
+ | GET | `/api/v1/billing/plans` , `/reserved-resources/` , `/bank-accounts/` |
205
+ | POST | `/api/v1/billing/payment/request` , `/billbillak/history/` , `/giftcodes/use/` |
206
+
207
+ ## Sentry (error tracking)
208
+
209
+ | Methods | Path |
210
+ |---|---|
211
+ | GET, POST | `/api/v1/sentry/sentrys/` |
212
+ | GET, PATCH, DELETE | `/api/v1/sentry/sentrys/{id}/` |
213
+ | GET | `/api/v1/sentry/{id}/plans` , `/api/v1/sentry/{id}/subscription-status/` , `/api/v1/lazarus/sentry-plans` |
214
+
215
+ ## Notifications & Alerts
216
+
217
+ | Methods | Path |
218
+ |---|---|
219
+ | GET | `/api/v1/notifications/all_list/?limit=&offset=` |
220
+ | GET | `/api/v1/notifications/mark-all-as-read/` , `/api/v1/notifications/announcements/{id}/` |
221
+ | GET, POST | `/api/v1/viper/alert_routes/` |
222
+ | DELETE | `/api/v1/viper/alert_routes/{id}/` |
223
+ | GET | `/api/v1/viper/alert_rules/` , `/api/v1/viper/alertmanager/alerts/` , `/api/v1/viper/notices` |
224
+ | GET | `/notifications/alerts/api/alerts/` , `/notifications/alerts/api/alerts/{id}/` |
225
+ | GET, POST | `/notifications/alerts/api/organization-id-alert-routers/` |
226
+
227
+ ## Backup (سرویس بکاپ سراسری)
228
+
229
+ | Methods | Path |
230
+ |---|---|
231
+ | GET | `/api/v1/backups/backups?fields=...` |
232
+ | POST | `/api/v1/backups/backups/` |
233
+ | GET | `/api/v1/backups/backups/{id}/snapshots/` , `/clones/` , `/restores/` |
234
+ | GET | `/api/v1/backups/org_plans` , `/api/v1/backups/prices` |
235
+ | POST | `/api/v1/backups/snapshots/{id}/clone/` , `/restore/` |
236
+ | GET | `/api/v1/backups/snapshots/{id}/url/` |
237
+ | GET | `/api/v1/backups/storage_destinations/` |
238
+ | POST | `/api/v1/backups/storage_destinations/{id}/change_password/` , `/read_vault_secret/` |
239
+
240
+ ## Clusters & API Keys (متفرقه)
241
+
242
+ | Methods | Path |
243
+ |---|---|
244
+ | POST | `/api/v1/clusters/` |
245
+ | GET, POST, DELETE | `/api/v1/apikeys/` , `/api/v1/apikeys/{id}/` |
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohammad Bakhtari (محمد باختری)
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.
package/LIVE-STATUS.md ADDED
@@ -0,0 +1,79 @@
1
+ # Hamravesh — وضعیت زندهٔ endpoint ها (با حساب admin روی wgcup)
2
+
3
+ > نتیجه‌ی تست واقعی ۲۱۳ درخواست با حساب `oosmajid@gmail.com` (نقش admin در wgcup)، تاریخ 2026-06-13.
4
+ > `200/204`=کار می‌کند | `400`=پارامتر/بدنه لازم دارد | `404`=این امکان برای این سازمان روشن نیست یا مسیر فرق دارد |
5
+ > `500`=خطای سمت سرور هم‌روش | `405`=متد اشتباه (مثلاً GET روی مسیری که فقط POST است).
6
+
7
+ | Status | Method | Path |
8
+ |---|---|---|
9
+ | 200 | GET | `/api/v1/2fa/status/` |
10
+ | 404 | GET | `/api/v1/account/available_clusters/` |
11
+ | 200 | GET | `/api/v1/announcements/` |
12
+ | 200 | GET | `/api/v1/apikeys/` |
13
+ | 200 | POST | `/api/v1/apikeys/` |
14
+ | 204 | DELETE | `/api/v1/apikeys/{id}/` |
15
+ | 404 | GET | `/api/v1/app/products/` |
16
+ | 404 | GET | `/api/v1/app/saas/` |
17
+ | 404 | GET | `/api/v1/app/tags/` |
18
+ | 404 | GET | `/api/v1/backups/backups` |
19
+ | 404 | GET | `/api/v1/backups/org_plans` |
20
+ | 404 | GET | `/api/v1/backups/storage_destinations/` |
21
+ | 400 | GET | `/api/v1/billing/bank-accounts/` |
22
+ | 200 | GET | `/api/v1/billing/billing-accounts/{id}/` |
23
+ | 200 | GET | `/api/v1/billing/financial_transactions/` |
24
+ | 200 | GET | `/api/v1/billing/invoices/` |
25
+ | 404 | GET | `/api/v1/billing/plans` |
26
+ | 404 | GET | `/api/v1/billing/reserved-resources/` |
27
+ | 200 | GET | `/api/v1/billing/wallets/` |
28
+ | 200 | GET | `/api/v1/darkube/apps/` |
29
+ | 200 | GET | `/api/v1/darkube/apps/{id}/` |
30
+ | 200 | GET | `/api/v1/darkube/apps/{id}/alerts/` |
31
+ | 200 | GET | `/api/v1/darkube/apps/{id}/app_containers/` |
32
+ | 404 | GET | `/api/v1/darkube/apps/{id}/app_pvc_backups/` |
33
+ | 500 | GET | `/api/v1/darkube/apps/{id}/available_upgrades/` |
34
+ | 404 | GET | `/api/v1/darkube/apps/{id}/backup/` |
35
+ | 400 | GET | `/api/v1/darkube/apps/{id}/backup/operations/` |
36
+ | 400 | GET | `/api/v1/darkube/apps/{id}/backup/statistics/` |
37
+ | 200 | GET | `/api/v1/darkube/apps/{id}/certificate_status/` |
38
+ | 200 | GET | `/api/v1/darkube/apps/{id}/manifests/` |
39
+ | 200 | GET | `/api/v1/darkube/apps/{id}/operations/` |
40
+ | 200 | GET | `/api/v1/darkube/apps/{id}/plugins/` |
41
+ | 200 | GET | `/api/v1/darkube/apps/{id}/read_all_vault_secret_envs/` |
42
+ | 404 | GET | `/api/v1/darkube/apps/{id}/rollback_version/` |
43
+ | 405 | GET | `/api/v1/darkube/apps/{id}/suggestions/` |
44
+ | 200 | GET | `/api/v1/darkube/build/app/{id}/` |
45
+ | 200 | GET | `/api/v1/darkube/certificates/` |
46
+ | 200 | GET | `/api/v1/darkube/deploy_contexts/` |
47
+ | 200 | GET | `/api/v1/darkube/github/installed/` |
48
+ | 200 | GET | `/api/v1/darkube/github/repos/` |
49
+ | 200 | GET | `/api/v1/darkube/gitlab/installed/` |
50
+ | 400 | GET | `/api/v1/darkube/loadbalancers/` |
51
+ | 404 | GET | `/api/v1/darkube/nodepools/` |
52
+ | 500 | GET | `/api/v1/darkube/permissions/` |
53
+ | 200 | GET | `/api/v1/darkube/plans/` |
54
+ | 200 | GET | `/api/v1/darkube/plans/disk/` |
55
+ | 200 | GET | `/api/v1/darkube/template/` |
56
+ | 404 | GET | `/api/v1/datasources/` |
57
+ | 200 | GET | `/api/v1/dazzle/metric-datasource-plans/` |
58
+ | 200 | GET | `/api/v1/dazzle/metric-datasources/` |
59
+ | 200 | GET | `/api/v1/hamartia/datasources/` |
60
+ | 500 | GET | `/api/v1/hamartia/plans/` |
61
+ | 404 | GET | `/api/v1/logstorage/custom/` |
62
+ | 404 | GET | `/api/v1/logstorage/loki/` |
63
+ | 200 | GET | `/api/v1/notifications/all_list/` |
64
+ | 200 | GET | `/api/v1/organizations/{id}/members` |
65
+ | 200 | GET | `/api/v1/registry-gc-strategies/` |
66
+ | 200 | GET | `/api/v1/registry/` |
67
+ | 200 | GET | `/api/v1/registry/{id}/list_repositories/` |
68
+ | 200 | GET | `/api/v1/registry/{id}/storage_usage` |
69
+ | 404 | GET | `/api/v1/sentry/sentrys/` |
70
+ | 404 | GET | `/api/v1/services/` |
71
+ | 200 | GET | `/api/v1/viper/alert_routes/` |
72
+ | 200 | GET | `/api/v1/viper/alert_rules/` |
73
+ | 200 | GET | `/api/v1/viper/alertmanager/alerts/` |
74
+ | 200 | GET | `/api/v1/viper/notices` |
75
+ | 404 | GET | `/api/v1/zones/` |
76
+ | 200 | GET | `/api/v2/users/profile` |
77
+ | 200 | GET | `/dbaas/api/v1/account/available_clusters/` |
78
+ | 200 | GET | `/dbaas/api/v1/app/database/` |
79
+ | 200 | GET | `/dbaas/api/v1/app/plans/` |
package/README.md ADDED
@@ -0,0 +1,188 @@
1
+ # hamravesh-mcp
2
+
3
+ > کنترلِ کنسولِ **هم‌روش / دارکوب** از داخلِ هر کلاینتِ MCP (مثل Claude) — بدونِ پنل، بدونِ کلیک.
4
+ > Control the **Hamravesh / Darkube** console from any MCP client (Claude, etc.) — no panel, no clicking.
5
+
6
+ [![npm version](https://img.shields.io/npm/v/hamravesh-mcp.svg)](https://www.npmjs.com/package/hamravesh-mcp)
7
+ [![CI](https://github.com/bakhtarimohammad/hamravesh-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/bakhtarimohammad/hamravesh-mcp/actions/workflows/ci.yml)
8
+ [![license](https://img.shields.io/npm/l/hamravesh-mcp.svg)](./LICENSE)
9
+ [![node](https://img.shields.io/node/v/hamravesh-mcp.svg)](https://nodejs.org)
10
+
11
+ سرورِ [MCP](https://modelcontextprotocol.io) که به دستیارِ هوشِ مصنوعی اجازه می‌دهد اپ‌های [هم‌روش](https://hamravesh.com) (دارکوب) را مستقیم از طریقِ API داخلیِ کنسول مدیریت کند: دیدن و بررسیِ اپ‌ها، لاگ، ری‌استارت، دیپلوی، اسکیل، تغییرِ env، مدیریتِ دیتابیس/رجیستری/صورتحساب — و صدا زدنِ هر endpointِ دیگر.
12
+
13
+ A [Model Context Protocol](https://modelcontextprotocol.io) server that lets an AI assistant manage your [Hamravesh](https://hamravesh.com) (Darkube) apps directly via the console's internal API: list & inspect apps, view logs, restart, redeploy, scale, edit env vars, manage databases, registries, billing — and call any other endpoint.
14
+
15
+ > ⚠️ **غیررسمی.** این ابزار از API داخلیِ کنسولِ هم‌روش (`api.hamravesh.com`) استفاده می‌کند که عمومی/مستند نیست و ممکن است بدونِ اطلاع تغییر کند.
16
+ > **Unofficial.** Uses Hamravesh's internal console API (`api.hamravesh.com`), which is not a public/documented API and may change without notice.
17
+
18
+ ---
19
+
20
+ ## فارسی
21
+
22
+ ### امکانات
23
+
24
+ - 🔑 **دو روشِ ورود** — یا **کلید API** (هدرِ `Authorization: Api-Key …`، توصیه‌شده) یا **ایمیل/رمز** (JWT با تمدیدِ خودکار).
25
+ - 🧰 **۲۱ ابزار** — خواندنی (اپ‌ها، لاگ، کانتینرها، منیفست، بیلدها، دیتابیس، رجیستری، صورتحساب، کلیدها)، نوشتنی (ری‌استارت، دیپلوی، اسکیل، روشن/خاموش، تغییرِ env، ساخت/حذفِ اپ، ساخت/حذفِ کلید) و یک ابزارِ جوکر به‌نامِ `hamravesh_request` برای هر endpoint.
26
+ - 🔒 **پیش‌فرض امن** — نوشتن و حذف تا وقتی خودت روشن نکنی **خاموش‌اند**. ابزارِ جوکر روی میزبانِ هم‌روش قفل است (بدونِ SSRF) و رازها از پیامِ خطا پاک می‌شوند.
27
+ - 📦 **بدونِ build، یک وابستگی** — ESMِ ساده، فقط `@modelcontextprotocol/sdk`.
28
+
29
+ ### گرفتنِ کلید API
30
+
31
+ در پنلِ هم‌روش: **تنظیماتِ سازمان ← امنیت ← API Keys ← یک کلید بساز.** (یا به‌جایش ایمیل/رمز بده — جدولِ پایین.)
32
+
33
+ ### شروعِ سریع
34
+
35
+ با **Claude، Cursor، VS Code، Windsurf** و هر کلاینتِ MCP کار می‌کند. نیازی به نصبِ سراسری نیست — `npx` خودش موقعِ اجرا دانلودش می‌کند.
36
+
37
+ **🪄 روشِ A — بدونِ کدنویسی (بذار Claude خودش انجامش دهد).** اگر همه‌کارت را با Claude انجام می‌دهی، فقط بگو:
38
+
39
+ > «MCP هم‌روش (`hamravesh-mcp`) را برایم نصب و تنظیم کن. کلیدِ APIم این است: `…` و سازمانم `…`.»
40
+
41
+ Claude خودش نصب و تنظیمش می‌کند. تمام.
42
+
43
+ **⌨️ روشِ B — Claude Code، یک خط:**
44
+
45
+ ```bash
46
+ claude mcp add hamravesh --env HAMRAVESH_API_KEY=کلیدت --env HAMRAVESH_ORG=سازمانت -- npx -y hamravesh-mcp
47
+ ```
48
+
49
+ **📝 روشِ C — فایلِ پیکربندی** (`claude_desktop_config.json` یا `.mcp.json`ِ پروژه):
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "hamravesh": {
55
+ "command": "npx",
56
+ "args": ["-y", "hamravesh-mcp"],
57
+ "env": {
58
+ "HAMRAVESH_API_KEY": "کلیدِ تو",
59
+ "HAMRAVESH_ORG": "نامِ سازمان"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### متغیرهای محیطی
67
+
68
+ | متغیر | لازم؟ | توضیح |
69
+ |---|---|---|
70
+ | `HAMRAVESH_API_KEY` | یکی از این دو | کلید API (توصیه‌شده). |
71
+ | `HAMRAVESH_EMAIL` + `HAMRAVESH_PASSWORD` | یکی از این دو | ایمیل/رمز (JWT). اگر 2FA داری `HAMRAVESH_OTP`. |
72
+ | `HAMRAVESH_ORG` | توصیه‌شده | سازمانِ پیش‌فرض (مثل `wgcup`)؛ در هر ابزار قابلِ تغییر. |
73
+ | `HAMRAVESH_BASE` | نه | پیش‌فرض `https://api.hamravesh.com`. |
74
+ | `HAMRAVESH_ALLOW_WRITE` | نه | `1` برای فعال‌کردنِ ابزارهای نوشتن (پیش‌فرض خاموش). |
75
+ | `HAMRAVESH_ALLOW_DELETE` | نه | `1` برای فعال‌کردنِ ابزارهای حذف (پیش‌فرض خاموش). |
76
+
77
+ ### ایمنی
78
+
79
+ به‌صورتِ پیش‌فرض فقط **خواندن** مجاز است؛ هیچ تغییری روی سرویسِ زنده رخ نمی‌دهد. برای تغییر/حذف باید فلگ‌های بالا را روی `1` بگذاری. این یعنی امکان ندارد دستیار اشتباهی چیزی را خراب کند.
80
+
81
+ ### ابزارها
82
+
83
+ **خواندنی (همیشه روشن):** `hamravesh_whoami`، `hamravesh_list_apps`، `hamravesh_get_app`، `hamravesh_app_containers`، `hamravesh_app_logs`، `hamravesh_app_manifests`، `hamravesh_app_builds`، `hamravesh_list_databases`، `hamravesh_list_registries`، `hamravesh_billing`، `hamravesh_list_apikeys`
84
+
85
+ **نوشتنی (نیازمندِ `ALLOW_WRITE=1`):** `hamravesh_restart_app`، `hamravesh_redeploy_app`، `hamravesh_scale_app`، `hamravesh_set_app_enabled`، `hamravesh_update_app_envs`، `hamravesh_create_app`، `hamravesh_create_apikey`، و `hamravesh_delete_app`/`hamravesh_delete_apikey` (نیازمندِ `ALLOW_DELETE=1`)
86
+
87
+ **جوکر:** `hamravesh_request` — هر متد/مسیر (GET آزاد؛ نوشتن/حذف تابعِ فلگ‌ها).
88
+
89
+ ### مرجع
90
+
91
+ - [`ENDPOINTS.md`](ENDPOINTS.md) — کاتالوگِ دسته‌بندی‌شده.
92
+ - [`WRITE-ENDPOINTS.md`](WRITE-ENDPOINTS.md) — شکلِ بدنهٔ همهٔ ۱۶۲ درخواستِ نوشتنی.
93
+ - [`LIVE-STATUS.md`](LIVE-STATUS.md) — وضعیتِ زندهٔ هر endpoint با حسابِ admin.
94
+ - [`ENDPOINTS-RAW.txt`](ENDPOINTS-RAW.txt) — لیستِ خامِ همهٔ ۵۷۸ آدرس (متد+مسیر).
95
+
96
+ ### توسعه
97
+
98
+ ```bash
99
+ npm ci
100
+ npm test # بدونِ شبکه: ابزارها و محافظِ نوشتن را چک می‌کند
101
+ ```
102
+
103
+ ---
104
+
105
+ ## English
106
+
107
+ ### Features
108
+
109
+ - 🔑 **Two auth modes** — a stable **API key** (`Authorization: Api-Key …`, recommended) or **email/password** (JWT with auto-refresh).
110
+ - 🧰 **21 tools** — read (apps, logs, containers, manifests, builds, databases, registries, billing, api-keys), write (restart, redeploy, scale, enable/disable, update env, create/delete app, create/delete api-key), plus a generic `hamravesh_request` escape hatch for any endpoint.
111
+ - 🔒 **Safe by default** — write and delete operations are **disabled** unless you explicitly turn them on. The generic tool is host-locked (no SSRF) and secrets are redacted from error messages.
112
+ - 📦 **Zero build, one dependency** — plain ESM, only `@modelcontextprotocol/sdk`.
113
+
114
+ ### Get an API key
115
+
116
+ In the Hamravesh panel: **Organization settings → Security → API Keys → create one.** (Or use email/password instead — see the table below.)
117
+
118
+ ### Quick start
119
+
120
+ Works with **Claude, Cursor, VS Code, Windsurf** and any MCP client. No global install — `npx` fetches it on demand.
121
+
122
+ **🪄 Option A — No coding (let Claude do it).** If you do everything through Claude, just tell it:
123
+
124
+ > *"Set up the `hamravesh-mcp` MCP server for me. My Hamravesh API key is `…` and my org is `…`."*
125
+
126
+ Claude installs it and writes the config for you. Done.
127
+
128
+ **⌨️ Option B — Claude Code, one line:**
129
+
130
+ ```bash
131
+ claude mcp add hamravesh --env HAMRAVESH_API_KEY=your-key --env HAMRAVESH_ORG=your-org -- npx -y hamravesh-mcp
132
+ ```
133
+
134
+ **📝 Option C — config file** (Claude Desktop `claude_desktop_config.json`, or a project `.mcp.json`):
135
+
136
+ ```json
137
+ {
138
+ "mcpServers": {
139
+ "hamravesh": {
140
+ "command": "npx",
141
+ "args": ["-y", "hamravesh-mcp"],
142
+ "env": {
143
+ "HAMRAVESH_API_KEY": "your-api-key",
144
+ "HAMRAVESH_ORG": "your-org-name"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### Environment variables
152
+
153
+ | Variable | Required | Description |
154
+ |---|---|---|
155
+ | `HAMRAVESH_API_KEY` | one of these | API key (recommended). |
156
+ | `HAMRAVESH_EMAIL` + `HAMRAVESH_PASSWORD` | one of these | Email/password (JWT). `HAMRAVESH_OTP` if 2FA. |
157
+ | `HAMRAVESH_ORG` | recommended | Default organization (e.g. `wgcup`); per-call overridable. |
158
+ | `HAMRAVESH_BASE` | no | Defaults to `https://api.hamravesh.com`. |
159
+ | `HAMRAVESH_ALLOW_WRITE` | no | `1` to enable write tools (default off). |
160
+ | `HAMRAVESH_ALLOW_DELETE` | no | `1` to enable delete tools (default off). |
161
+
162
+ ### Tools
163
+
164
+ **Read (always on):** `hamravesh_whoami`, `hamravesh_list_apps`, `hamravesh_get_app`, `hamravesh_app_containers`, `hamravesh_app_logs`, `hamravesh_app_manifests`, `hamravesh_app_builds`, `hamravesh_list_databases`, `hamravesh_list_registries`, `hamravesh_billing`, `hamravesh_list_apikeys`
165
+
166
+ **Write (need `ALLOW_WRITE=1`):** `hamravesh_restart_app`, `hamravesh_redeploy_app`, `hamravesh_scale_app`, `hamravesh_set_app_enabled`, `hamravesh_update_app_envs`, `hamravesh_create_app`, `hamravesh_create_apikey`, `hamravesh_delete_app`/`hamravesh_delete_apikey` (need `ALLOW_DELETE=1`)
167
+
168
+ **Generic:** `hamravesh_request` — any method/path (GET free; write/delete follow the flags).
169
+
170
+ ### Reference
171
+
172
+ - [`ENDPOINTS.md`](ENDPOINTS.md) — categorized endpoint catalog.
173
+ - [`WRITE-ENDPOINTS.md`](WRITE-ENDPOINTS.md) — request-body shapes for all 162 write endpoints.
174
+ - [`LIVE-STATUS.md`](LIVE-STATUS.md) — live status of each endpoint with an admin account.
175
+ - [`ENDPOINTS-RAW.txt`](ENDPOINTS-RAW.txt) — raw list of all 578 method+path pairs.
176
+
177
+ ### Develop
178
+
179
+ ```bash
180
+ npm ci
181
+ npm test # network-free: checks tools + write guard
182
+ ```
183
+
184
+ ---
185
+
186
+ ## مجوز / License
187
+
188
+ [MIT](./LICENSE) © محمد باختری — Mohammad Bakhtari