@hoststack.dev/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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HostStack 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.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @hoststack.dev/mcp
2
+
3
+ Model Context Protocol (MCP) server for [HostStack](https://hoststack.dev) — let Claude, Cursor, and any other MCP-capable agent deploy services, manage databases, rotate env vars, and read logs on your HostStack team.
4
+
5
+ Two ways to run it:
6
+
7
+ - **Hosted** (recommended) — point your client at `https://api.hoststack.dev/api/mcp` with a Bearer API key. No local install.
8
+ - **Local stdio** — `npx -y @hoststack.dev/mcp` runs the same server in-process and talks JSON-RPC over stdin/stdout.
9
+
10
+ ## Quick start
11
+
12
+ ### 1. Get an API key
13
+
14
+ Open the dashboard at <https://hoststack.dev/dashboard/settings/api-keys> and create a key with `full_access` permission. The key is bound to a single team — every tool call operates on that team automatically; agents never need to pass `teamId`.
15
+
16
+ ### 2. Wire it into your client
17
+
18
+ #### Claude Desktop
19
+
20
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "hoststack": {
26
+ "command": "npx",
27
+ "args": ["-y", "@hoststack.dev/mcp"],
28
+ "env": {
29
+ "HOSTSTACK_API_KEY": "hs_live_..."
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ #### Cursor
37
+
38
+ Add to `~/.cursor/mcp.json` (or via Settings → MCP):
39
+
40
+ ```json
41
+ {
42
+ "hoststack": {
43
+ "command": "npx",
44
+ "args": ["-y", "@hoststack.dev/mcp"],
45
+ "env": {
46
+ "HOSTSTACK_API_KEY": "hs_live_..."
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ #### Claude Code
53
+
54
+ ```bash
55
+ claude mcp add hoststack -- npx -y @hoststack.dev/mcp -e HOSTSTACK_API_KEY=hs_live_...
56
+ ```
57
+
58
+ #### Any other client (hosted)
59
+
60
+ ```http
61
+ POST https://api.hoststack.dev/api/mcp
62
+ Authorization: Bearer hs_live_...
63
+ Content-Type: application/json
64
+ ```
65
+
66
+ The endpoint speaks the streamable-HTTP MCP transport. Stateless — every request is independent; no session bookkeeping.
67
+
68
+ ### 3. Generate config snippets
69
+
70
+ The CLI knows how to print config for the three big clients so you don't have to memorise the shape:
71
+
72
+ ```bash
73
+ npx @hoststack.dev/mcp --print-config claude-desktop
74
+ npx @hoststack.dev/mcp --print-config cursor
75
+ npx @hoststack.dev/mcp --print-config claude-code
76
+ ```
77
+
78
+ If `HOSTSTACK_API_KEY` is set in your shell, it gets baked into the snippet; otherwise you'll see a `hs_live_your_api_key_here` placeholder you can search-and-replace.
79
+
80
+ ## Tool inventory
81
+
82
+ 31 tools, grouped by resource:
83
+
84
+ | Category | Read | Write |
85
+ |---|---|---|
86
+ | **projects** | `list_projects`, `get_project` | `create_project`, `update_project` |
87
+ | **services** | `list_services`, `get_service`, `get_service_metrics`, `get_service_logs` | `update_service`, `update_service_config`, `suspend_service`, `resume_service` |
88
+ | **deploys** | `list_deploys`, `get_deploy`, `get_deploy_logs` | `trigger_deploy`, `cancel_deploy` |
89
+ | **databases** | `list_databases`, `get_database` | — (use the dashboard for create/delete/credentials) |
90
+ | **domains** | `list_domains` | `add_domain`, `verify_domain`, `remove_domain` |
91
+ | **env-vars** | `list_env_vars` | `set_env_var`, `delete_env_var`, `bulk_set_env_vars` |
92
+ | **cron** | `list_cron_executions`, `get_cron_execution` | — |
93
+ | **activity-log** | `list_activity_log` | — |
94
+ | **meta** | `get_me` | — |
95
+
96
+ A few design notes worth knowing as a caller:
97
+
98
+ - **`set_env_var` / `delete_env_var` are key-based.** You don't need an env-var ID; the MCP looks up the existing var by key first, then patches or deletes by ID under the hood.
99
+ - **`list_env_vars` masks secret values.** Anything stored with `is_secret: true` comes back as `••••••`. The masking happens server-side, so you can't accidentally leak a secret to the agent's context window.
100
+ - **`get_service_logs` and `get_deploy_logs` are snapshots.** Streaming logs over MCP isn't supported — re-call the tool to get newer entries. Use the dashboard's `/dashboard/services/:id/logs` for live tails.
101
+ - **No `delete_project`, `delete_service`, or `create_service`.** Destructive cascades and the wizard flow are dashboard-only — too risky / too complex for v0.x.
102
+ - **Telemetry, hosted only.** When you use `https://api.hoststack.dev/api/mcp`, we record one row per tool call (tool name, duration, ok/error, SHA-derived hash of input args — never the args themselves) for the analytics page and on-call alerts. Retained 30 days. The local stdio install records nothing.
103
+
104
+ ## Environment variables
105
+
106
+ | Var | Required | Default | Notes |
107
+ |---|---|---|---|
108
+ | `HOSTSTACK_API_KEY` | yes | — | Bearer token. `hs_live_…` for prod, `hs_test_…` for the test team. |
109
+ | `HOSTSTACK_BASE_URL` | no | `https://api.hoststack.dev` | Override for self-hosted or staging. |
110
+ | `HOSTSTACK_MCP_TRACE` | no | unset | Set to `1` to emit one NDJSON line per tool call to stderr. Useful for `2> mcp-trace.log` debugging without colliding with the JSON-RPC body on stdout. |
111
+
112
+ ## License
113
+
114
+ MIT — see [LICENSE](./LICENSE).