@hanzo/platform-mcp 1.4.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/LICENSE +13 -0
- package/README.md +534 -0
- package/build/http-server.js +286 -0
- package/build/index.js +35 -0
- package/build/mcp/tools/application/applicationCleanQueues.js +23 -0
- package/build/mcp/tools/application/applicationCreate.js +39 -0
- package/build/mcp/tools/application/applicationDelete.js +21 -0
- package/build/mcp/tools/application/applicationDeploy.js +21 -0
- package/build/mcp/tools/application/applicationMarkRunning.js +23 -0
- package/build/mcp/tools/application/applicationMove.js +22 -0
- package/build/mcp/tools/application/applicationOne.js +26 -0
- package/build/mcp/tools/application/applicationReadAppMonitoring.js +26 -0
- package/build/mcp/tools/application/applicationReadTraefikConfig.js +26 -0
- package/build/mcp/tools/application/applicationRedeploy.js +23 -0
- package/build/mcp/tools/application/applicationRefreshToken.js +23 -0
- package/build/mcp/tools/application/applicationReload.js +22 -0
- package/build/mcp/tools/application/applicationSaveBitbucketProvider.js +49 -0
- package/build/mcp/tools/application/applicationSaveBuildType.js +56 -0
- package/build/mcp/tools/application/applicationSaveDockerProvider.js +43 -0
- package/build/mcp/tools/application/applicationSaveEnvironment.js +33 -0
- package/build/mcp/tools/application/applicationSaveGitProvider.js +49 -0
- package/build/mcp/tools/application/applicationSaveGiteaProvider.js +43 -0
- package/build/mcp/tools/application/applicationSaveGithubProvider.js +51 -0
- package/build/mcp/tools/application/applicationSaveGitlabProvider.js +48 -0
- package/build/mcp/tools/application/applicationStart.js +21 -0
- package/build/mcp/tools/application/applicationStop.js +21 -0
- package/build/mcp/tools/application/applicationUpdate.js +319 -0
- package/build/mcp/tools/application/applicationUpdateTraefikConfig.js +26 -0
- package/build/mcp/tools/application/index.js +24 -0
- package/build/mcp/tools/compose/composeCreate.js +31 -0
- package/build/mcp/tools/compose/composeDeploy.js +26 -0
- package/build/mcp/tools/compose/composeOne.js +24 -0
- package/build/mcp/tools/compose/composeReload.js +28 -0
- package/build/mcp/tools/compose/composeRemove.js +26 -0
- package/build/mcp/tools/compose/composeSaveEnvironment.js +28 -0
- package/build/mcp/tools/compose/composeStart.js +26 -0
- package/build/mcp/tools/compose/composeStop.js +26 -0
- package/build/mcp/tools/compose/composeUpdate.js +34 -0
- package/build/mcp/tools/compose/index.js +9 -0
- package/build/mcp/tools/index.js +12 -0
- package/build/mcp/tools/mysql/index.js +13 -0
- package/build/mcp/tools/mysql/mysqlChangeStatus.js +24 -0
- package/build/mcp/tools/mysql/mysqlCreate.js +50 -0
- package/build/mcp/tools/mysql/mysqlDeploy.js +21 -0
- package/build/mcp/tools/mysql/mysqlMove.js +24 -0
- package/build/mcp/tools/mysql/mysqlOne.js +23 -0
- package/build/mcp/tools/mysql/mysqlRebuild.js +21 -0
- package/build/mcp/tools/mysql/mysqlReload.js +22 -0
- package/build/mcp/tools/mysql/mysqlRemove.js +21 -0
- package/build/mcp/tools/mysql/mysqlSaveEnvironment.js +26 -0
- package/build/mcp/tools/mysql/mysqlSaveExternalPort.js +25 -0
- package/build/mcp/tools/mysql/mysqlStart.js +21 -0
- package/build/mcp/tools/mysql/mysqlStop.js +21 -0
- package/build/mcp/tools/mysql/mysqlUpdate.js +103 -0
- package/build/mcp/tools/postgres/index.js +13 -0
- package/build/mcp/tools/postgres/postgresChangeStatus.js +26 -0
- package/build/mcp/tools/postgres/postgresCreate.js +48 -0
- package/build/mcp/tools/postgres/postgresDeploy.js +23 -0
- package/build/mcp/tools/postgres/postgresMove.js +26 -0
- package/build/mcp/tools/postgres/postgresOne.js +26 -0
- package/build/mcp/tools/postgres/postgresRebuild.js +23 -0
- package/build/mcp/tools/postgres/postgresReload.js +26 -0
- package/build/mcp/tools/postgres/postgresRemove.js +23 -0
- package/build/mcp/tools/postgres/postgresSaveEnvironment.js +28 -0
- package/build/mcp/tools/postgres/postgresSaveExternalPort.js +27 -0
- package/build/mcp/tools/postgres/postgresStart.js +23 -0
- package/build/mcp/tools/postgres/postgresStop.js +23 -0
- package/build/mcp/tools/postgres/postgresUpdate.js +97 -0
- package/build/mcp/tools/project/index.js +6 -0
- package/build/mcp/tools/project/projectAll.js +68 -0
- package/build/mcp/tools/project/projectCreate.js +30 -0
- package/build/mcp/tools/project/projectDuplicate.js +54 -0
- package/build/mcp/tools/project/projectOne.js +24 -0
- package/build/mcp/tools/project/projectRemove.js +21 -0
- package/build/mcp/tools/project/projectUpdate.js +39 -0
- package/build/mcp/tools/toolFactory.js +60 -0
- package/build/server.js +12 -0
- package/build/types/platform.js +3 -0
- package/build/utils/apiClient.js +126 -0
- package/build/utils/clientConfig.js +37 -0
- package/build/utils/logger.js +38 -0
- package/build/utils/responseFormatter.js +33 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2025 Henrique Andrade
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
# Platform MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@hanzo/platform-mcp) [<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Platform%20MCP&color=0098FF">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22platform-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40ahdev%2Fplatform-mcp%40latest%22%5D%7D)
|
|
4
|
+
|
|
5
|
+
Platform MCP Server exposes Platform functionalities as tools consumable via the Model Context Protocol (MCP). It allows MCP-compatible clients (e.g., AI models, other applications) to interact with your Platform server programmatically.
|
|
6
|
+
|
|
7
|
+
This server focuses exclusively on **tools** for direct Platform API operations, providing a clean and efficient interface for project and application management.
|
|
8
|
+
|
|
9
|
+
## 🛠️ Getting Started
|
|
10
|
+
|
|
11
|
+
### Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js >= v18.0.0 (or Docker)
|
|
14
|
+
- Cursor, VS Code, Claude Desktop, or another MCP Client
|
|
15
|
+
- A running Platform server instance
|
|
16
|
+
|
|
17
|
+
### Install in Cursor
|
|
18
|
+
|
|
19
|
+
Go to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server`
|
|
20
|
+
|
|
21
|
+
Add this to your Cursor `~/.cursor/mcp.json` file. You may also install in a specific project by creating `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"platform-mcp": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
29
|
+
"env": {
|
|
30
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
31
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
<details>
|
|
39
|
+
<summary>Alternative: Use Bun</summary>
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"platform-mcp": {
|
|
45
|
+
"command": "bunx",
|
|
46
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
47
|
+
"env": {
|
|
48
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
49
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
<details>
|
|
59
|
+
<summary>Alternative: Use Deno</summary>
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"platform-mcp": {
|
|
65
|
+
"command": "deno",
|
|
66
|
+
"args": ["run", "--allow-env", "--allow-net", "npm:@hanzo/platform-mcp"],
|
|
67
|
+
"env": {
|
|
68
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
69
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
</details>
|
|
77
|
+
|
|
78
|
+
### Install in Windsurf
|
|
79
|
+
|
|
80
|
+
Add this to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"platform-mcp": {
|
|
86
|
+
"command": "npx",
|
|
87
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
88
|
+
"env": {
|
|
89
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
90
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Install in VS Code
|
|
98
|
+
|
|
99
|
+
[<img alt="Install in VS Code (npx)" src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Platform%20MCP&color=0098FF">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22platform-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40ahdev%2Fplatform-mcp%40latest%22%5D%7D)
|
|
100
|
+
[<img alt="Install in VS Code Insiders (npx)" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Platform%20MCP&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%7B%22name%22%3A%22platform-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40ahdev%2Fplatform-mcp%40latest%22%5D%7D)
|
|
101
|
+
|
|
102
|
+
Add this to your VS Code MCP config file. See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"servers": {
|
|
107
|
+
"platform-mcp": {
|
|
108
|
+
"type": "stdio",
|
|
109
|
+
"command": "npx",
|
|
110
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
111
|
+
"env": {
|
|
112
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
113
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Install in Zed
|
|
121
|
+
|
|
122
|
+
Add this to your Zed `settings.json`. See [Zed Context Server docs](https://zed.dev/docs/assistant/context-servers) for more info.
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"context_servers": {
|
|
127
|
+
"platform-mcp": {
|
|
128
|
+
"command": {
|
|
129
|
+
"path": "npx",
|
|
130
|
+
"args": ["-y", "@hanzo/platform-mcp"]
|
|
131
|
+
},
|
|
132
|
+
"settings": {
|
|
133
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
134
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Install in Claude Desktop
|
|
142
|
+
|
|
143
|
+
Add this to your Claude Desktop `claude_desktop_config.json` file. See [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user) for more info.
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"platform-mcp": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
151
|
+
"env": {
|
|
152
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
153
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Install in BoltAI
|
|
161
|
+
|
|
162
|
+
Open the "Settings" page of the app, navigate to "Plugins," and enter the following JSON:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"platform-mcp": {
|
|
168
|
+
"command": "npx",
|
|
169
|
+
"args": ["-y", "@hanzo/platform-mcp"],
|
|
170
|
+
"env": {
|
|
171
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
172
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Using Docker
|
|
180
|
+
|
|
181
|
+
The Docker container supports both **stdio** and **HTTP** transport modes, making it flexible for different deployment scenarios.
|
|
182
|
+
|
|
183
|
+
1. **Build the Docker Image:**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
git clone https://github.com/hanzoai/platform.git
|
|
187
|
+
cd platform-mcp
|
|
188
|
+
docker build -t platform-mcp .
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. **Manual Docker Commands:**
|
|
192
|
+
|
|
193
|
+
**Stdio Mode (for MCP clients):**
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
docker run -it --rm \
|
|
197
|
+
-e PLATFORM_URL=https://your-platform-server.com/api \
|
|
198
|
+
-e PLATFORM_API_KEY=your_token_here \
|
|
199
|
+
platform-mcp
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**HTTP Mode (for web applications):**
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
docker run -it --rm \
|
|
206
|
+
-p 8080:3000 \
|
|
207
|
+
-e MCP_TRANSPORT=http \
|
|
208
|
+
-e PLATFORM_URL=https://your-platform-server.com/api \
|
|
209
|
+
-e PLATFORM_API_KEY=your_token_here \
|
|
210
|
+
platform-mcp
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
3. **Docker Compose:**
|
|
214
|
+
|
|
215
|
+
Use the provided `docker-compose.yml` for production deployments:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# Start HTTP service
|
|
219
|
+
docker-compose up -d platform-mcp-http
|
|
220
|
+
|
|
221
|
+
# View logs
|
|
222
|
+
docker-compose logs -f platform-mcp-http
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
4. **MCP Client Configuration:**
|
|
226
|
+
|
|
227
|
+
**For stdio mode (Claude Desktop, VS Code, etc.):**
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"mcpServers": {
|
|
232
|
+
"platform-mcp": {
|
|
233
|
+
"command": "docker",
|
|
234
|
+
"args": [
|
|
235
|
+
"run",
|
|
236
|
+
"-i",
|
|
237
|
+
"--rm",
|
|
238
|
+
"-e",
|
|
239
|
+
"PLATFORM_URL=https://your-platform-server.com/api",
|
|
240
|
+
"-e",
|
|
241
|
+
"PLATFORM_API_KEY=your_token_here",
|
|
242
|
+
"platform-mcp"
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**For HTTP mode (web applications):**
|
|
250
|
+
|
|
251
|
+
Start the HTTP server first, then configure your client to connect to `http://localhost:3000/mcp`.
|
|
252
|
+
|
|
253
|
+
### Install in Windows
|
|
254
|
+
|
|
255
|
+
The configuration on Windows is slightly different compared to Linux or macOS. Use `cmd` as the command wrapper:
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"mcpServers": {
|
|
260
|
+
"platform-mcp": {
|
|
261
|
+
"command": "cmd",
|
|
262
|
+
"args": ["/c", "npx", "-y", "@hanzo/platform-mcp"],
|
|
263
|
+
"env": {
|
|
264
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
265
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Environment Variables
|
|
273
|
+
|
|
274
|
+
- `PLATFORM_URL`: Your Platform server API URL (required)
|
|
275
|
+
- `PLATFORM_API_KEY`: Your Platform API authentication token (required)
|
|
276
|
+
|
|
277
|
+
## 🚀 Transport Modes
|
|
278
|
+
|
|
279
|
+
This MCP server supports multiple transport modes to suit different use cases:
|
|
280
|
+
|
|
281
|
+
### Stdio Mode (Default)
|
|
282
|
+
|
|
283
|
+
The default mode uses stdio for direct process communication, ideal for desktop applications and command-line usage.
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Run with stdio (default)
|
|
287
|
+
npx -y @hanzo/platform-mcp
|
|
288
|
+
# or
|
|
289
|
+
npm run start:stdio
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### HTTP Mode (Streamable HTTP + Legacy SSE)
|
|
293
|
+
|
|
294
|
+
Modern HTTP mode exposes the server via HTTP/HTTPS supporting **both modern and legacy protocols** for maximum compatibility:
|
|
295
|
+
|
|
296
|
+
- **Streamable HTTP (MCP 2025-03-26)** - Modern protocol with session management
|
|
297
|
+
- **Legacy SSE (MCP 2024-11-05)** - Backwards compatibility for older clients
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
# Run with HTTP mode
|
|
301
|
+
npm run start:http
|
|
302
|
+
# or
|
|
303
|
+
npx -y @hanzo/platform-mcp --http
|
|
304
|
+
# or via environment variable
|
|
305
|
+
MCP_TRANSPORT=http npx -y @hanzo/platform-mcp
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Modern Streamable HTTP Endpoints:**
|
|
309
|
+
|
|
310
|
+
- **POST /mcp** - Client-to-server requests
|
|
311
|
+
- **GET /mcp** - Server-to-client notifications
|
|
312
|
+
- **DELETE /mcp** - Session termination
|
|
313
|
+
- **GET /health** - Health check endpoint
|
|
314
|
+
|
|
315
|
+
**Legacy SSE Endpoints (Backwards Compatibility):**
|
|
316
|
+
|
|
317
|
+
- **GET /sse** - SSE stream initialization
|
|
318
|
+
- **POST /messages** - Client message posting
|
|
319
|
+
|
|
320
|
+
**Configuration:**
|
|
321
|
+
|
|
322
|
+
- Internal port: `3000` (fixed)
|
|
323
|
+
- External port: configurable via `EXTERNAL_PORT` (default: `3000`)
|
|
324
|
+
- Supports both modern Streamable HTTP (MCP 2025-03-26) and legacy SSE (MCP 2024-11-05)
|
|
325
|
+
- Session management with automatic cleanup for both transport types
|
|
326
|
+
|
|
327
|
+
**Client Compatibility:**
|
|
328
|
+
|
|
329
|
+
Modern clients automatically use the Streamable HTTP endpoints, while legacy clients can connect using the SSE endpoints. The server handles both protocols simultaneously, ensuring compatibility with:
|
|
330
|
+
|
|
331
|
+
- **Modern MCP clients** (Claude Desktop, Cline, etc.) → Use `/mcp` endpoints
|
|
332
|
+
- **Legacy MCP clients** → Use `/sse` and `/messages` endpoints
|
|
333
|
+
- **Custom integrations** → Choose the appropriate protocol for your needs
|
|
334
|
+
|
|
335
|
+
For detailed transport mode documentation and client examples, refer to the configuration examples above.
|
|
336
|
+
|
|
337
|
+
## 📚 Available Tools
|
|
338
|
+
|
|
339
|
+
This MCP server provides comprehensive tools for Platform project, application, and database management through **56 tools** organized into four main categories:
|
|
340
|
+
|
|
341
|
+
### 🗂️ Project Management (6 tools)
|
|
342
|
+
|
|
343
|
+
Complete project lifecycle management including creation, updates, duplication, and deletion:
|
|
344
|
+
|
|
345
|
+
- **`project-all`** - List all projects
|
|
346
|
+
- **`project-one`** - Get project details
|
|
347
|
+
- **`project-create`** - Create new projects
|
|
348
|
+
- **`project-update`** - Update project configurations
|
|
349
|
+
- **`project-duplicate`** - Duplicate projects with selective service copying
|
|
350
|
+
- **`project-remove`** - Delete projects
|
|
351
|
+
|
|
352
|
+
### 🚀 Application Management (24 tools)
|
|
353
|
+
|
|
354
|
+
Comprehensive application lifecycle and configuration management:
|
|
355
|
+
|
|
356
|
+
#### Core Operations
|
|
357
|
+
|
|
358
|
+
- **CRUD Operations**: Create, read, update, delete applications
|
|
359
|
+
- **Lifecycle Management**: Deploy, redeploy, start, stop, reload applications
|
|
360
|
+
- **Utility Operations**: Move between projects, clean queues, refresh tokens
|
|
361
|
+
|
|
362
|
+
#### Git Provider Integrations
|
|
363
|
+
|
|
364
|
+
Support for multiple Git providers with specific configurations:
|
|
365
|
+
|
|
366
|
+
- **GitHub Provider** - Full GitHub integration with webhooks
|
|
367
|
+
- **GitLab Provider** - Complete GitLab project integration
|
|
368
|
+
- **Bitbucket Provider** - Bitbucket repository management
|
|
369
|
+
- **Gitea Provider** - Self-hosted Gitea integration
|
|
370
|
+
- **Git Provider** - Custom Git repository support
|
|
371
|
+
- **Docker Provider** - Direct Docker image deployment
|
|
372
|
+
|
|
373
|
+
#### Configuration Management
|
|
374
|
+
|
|
375
|
+
- **Build Settings** - Configure build types (Dockerfile, Heroku, Nixpacks, etc.)
|
|
376
|
+
- **Environment Management** - Environment variables and build arguments
|
|
377
|
+
- **Monitoring Integration** - Application monitoring and metrics
|
|
378
|
+
- **Traefik Configuration** - Load balancer and reverse proxy settings
|
|
379
|
+
|
|
380
|
+
### 🐘 PostgreSQL Database Management (13 tools)
|
|
381
|
+
|
|
382
|
+
Complete PostgreSQL database lifecycle management:
|
|
383
|
+
|
|
384
|
+
#### Core Database Operations
|
|
385
|
+
|
|
386
|
+
- **CRUD Operations**: Create, read, update, remove PostgreSQL databases
|
|
387
|
+
- **Lifecycle Management**: Deploy, start, stop, reload, rebuild databases
|
|
388
|
+
- **Configuration Management**: External ports, environment variables, status changes
|
|
389
|
+
- **Project Management**: Move databases between projects
|
|
390
|
+
|
|
391
|
+
#### Available PostgreSQL Tools
|
|
392
|
+
|
|
393
|
+
- **`postgres-create`** - Create new PostgreSQL databases
|
|
394
|
+
- **`postgres-one`** - Get database details
|
|
395
|
+
- **`postgres-update`** - Update database configurations
|
|
396
|
+
- **`postgres-remove`** - Delete databases
|
|
397
|
+
- **`postgres-deploy`** - Deploy databases
|
|
398
|
+
- **`postgres-start`** - Start database instances
|
|
399
|
+
- **`postgres-stop`** - Stop database instances
|
|
400
|
+
- **`postgres-reload`** - Reload database configurations
|
|
401
|
+
- **`postgres-rebuild`** - Rebuild database instances
|
|
402
|
+
- **`postgres-move`** - Move databases between projects
|
|
403
|
+
- **`postgres-changeStatus`** - Change database status
|
|
404
|
+
- **`postgres-saveExternalPort`** - Configure external database ports
|
|
405
|
+
- **`postgres-saveEnvironment`** - Manage database environment variables
|
|
406
|
+
|
|
407
|
+
### 🐬 MySQL Database Management (13 tools)
|
|
408
|
+
|
|
409
|
+
Complete MySQL database lifecycle management with MySQL-specific features:
|
|
410
|
+
|
|
411
|
+
#### Core Database Operations
|
|
412
|
+
|
|
413
|
+
- **CRUD Operations**: Create, read, update, remove MySQL databases
|
|
414
|
+
- **Lifecycle Management**: Deploy, start, stop, reload, rebuild databases
|
|
415
|
+
- **Configuration Management**: External ports, environment variables, status changes
|
|
416
|
+
- **Project Management**: Move databases between projects
|
|
417
|
+
- **MySQL-Specific Features**: Root password management, MySQL 8.0 support
|
|
418
|
+
|
|
419
|
+
#### Available MySQL Tools
|
|
420
|
+
|
|
421
|
+
- **`mysql-create`** - Create new MySQL databases (includes root password setup)
|
|
422
|
+
- **`mysql-one`** - Get database details
|
|
423
|
+
- **`mysql-update`** - Update database configurations
|
|
424
|
+
- **`mysql-remove`** - Delete databases
|
|
425
|
+
- **`mysql-deploy`** - Deploy databases
|
|
426
|
+
- **`mysql-start`** - Start database instances
|
|
427
|
+
- **`mysql-stop`** - Stop database instances
|
|
428
|
+
- **`mysql-reload`** - Reload database configurations
|
|
429
|
+
- **`mysql-rebuild`** - Rebuild database instances
|
|
430
|
+
- **`mysql-move`** - Move databases between projects
|
|
431
|
+
- **`mysql-changeStatus`** - Change database status
|
|
432
|
+
- **`mysql-saveExternalPort`** - Configure external database ports
|
|
433
|
+
- **`mysql-saveEnvironment`** - Manage database environment variables
|
|
434
|
+
|
|
435
|
+
For detailed information about each tool, including input schemas, required fields, and usage examples, see **[TOOLS.md](TOOLS.md)**.
|
|
436
|
+
|
|
437
|
+
### Tool Annotations
|
|
438
|
+
|
|
439
|
+
All tools include semantic annotations to help MCP clients understand their behavior:
|
|
440
|
+
|
|
441
|
+
- **Read-Only Tools** (`readOnlyHint: true`): Safe operations that only retrieve data
|
|
442
|
+
- **Destructive Tools** (`destructiveHint: true`): Operations that modify or delete resources
|
|
443
|
+
- **Creation Tools** (`destructiveHint: false`): Operations that create new resources
|
|
444
|
+
- **Idempotent Tools** (`idempotentHint: true`): Operations safe to repeat
|
|
445
|
+
- **External API Tools** (`openWorldHint: true`): All tools interact with Platform API
|
|
446
|
+
|
|
447
|
+
## 🏗️ Architecture
|
|
448
|
+
|
|
449
|
+
The Platform MCP Server is built using:
|
|
450
|
+
|
|
451
|
+
- **`@modelcontextprotocol/sdk`**: For creating the MCP server and defining tools
|
|
452
|
+
- **Node.js & TypeScript**: As the underlying runtime and language
|
|
453
|
+
- **Stdio Transport**: Communicates with MCP clients over standard input/output (stdio)
|
|
454
|
+
- **Platform API Integration**: Direct interaction with Platform server's REST API
|
|
455
|
+
- **Comprehensive Tool Coverage**: Complete implementation of all Platform application and project endpoints
|
|
456
|
+
- **Robust Error Handling**: Centralized HTTP client with retry logic and structured error responses
|
|
457
|
+
- **Schema Validation**: Full Zod-based input validation matching OpenAPI specifications
|
|
458
|
+
- **Tool Annotations**: Semantic annotations (readOnlyHint, destructiveHint, etc.) for enhanced MCP client understanding
|
|
459
|
+
|
|
460
|
+
The server architecture supports:
|
|
461
|
+
|
|
462
|
+
- **56 Tools** covering all project, application, and database management operations
|
|
463
|
+
- **Multiple Database Types** (PostgreSQL and MySQL with full lifecycle management)
|
|
464
|
+
- **Multiple Git Providers** (GitHub, GitLab, Bitbucket, Gitea, custom Git)
|
|
465
|
+
- **Flexible Configuration** for builds, deployments, and monitoring
|
|
466
|
+
- **Type-Safe Operations** with comprehensive TypeScript support
|
|
467
|
+
|
|
468
|
+
Each tool includes input validation, API integration, and structured response formatting for consistent MCP client interaction.
|
|
469
|
+
|
|
470
|
+
## 🔧 Development
|
|
471
|
+
|
|
472
|
+
Clone the project and install dependencies:
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
git clone https://github.com/hanzoai/platform.git
|
|
476
|
+
cd platform-mcp
|
|
477
|
+
npm install
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Build:
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
npm run build
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### Local Configuration Example
|
|
487
|
+
|
|
488
|
+
```json
|
|
489
|
+
{
|
|
490
|
+
"mcpServers": {
|
|
491
|
+
"platform-mcp": {
|
|
492
|
+
"command": "npx",
|
|
493
|
+
"args": ["tsx", "/path/to/platform-mcp/src/index.ts"],
|
|
494
|
+
"env": {
|
|
495
|
+
"PLATFORM_URL": "https://your-platform-server.com/api",
|
|
496
|
+
"PLATFORM_API_KEY": "your-platform-api-token"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Testing with MCP Inspector
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
npx -y @modelcontextprotocol/inspector npx @hanzo/platform-mcp
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### Documentation
|
|
510
|
+
|
|
511
|
+
- **[TOOLS.md](TOOLS.md)** - Complete tool reference with schemas and examples
|
|
512
|
+
- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Contributing guidelines
|
|
513
|
+
|
|
514
|
+
## 🔧 Troubleshooting
|
|
515
|
+
|
|
516
|
+
### MCP Client Errors
|
|
517
|
+
|
|
518
|
+
1. Try adding `@latest` to the package name.
|
|
519
|
+
|
|
520
|
+
2. Make sure you are using Node v18 or higher to have native fetch support with `npx`.
|
|
521
|
+
|
|
522
|
+
3. Verify your `PLATFORM_URL` and `PLATFORM_API_KEY` environment variables are correctly set.
|
|
523
|
+
|
|
524
|
+
## 🤝 Contributing
|
|
525
|
+
|
|
526
|
+
We welcome contributions! If you'd like to contribute to the Platform MCP Server, please check out our [Contributing Guide](CONTRIBUTING.md).
|
|
527
|
+
|
|
528
|
+
## 🆘 Support
|
|
529
|
+
|
|
530
|
+
If you encounter any issues, have questions, or want to suggest a feature, please [open an issue](https://github.com/hanzoai/mcp/issues) in our GitHub repository.
|
|
531
|
+
|
|
532
|
+
## 📄 License
|
|
533
|
+
|
|
534
|
+
This project is licensed under the [Apache License](LICENSE).
|