mcphosting-cli 0.3.1 → 0.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/README.md +8 -154
- package/index.js +151 -0
- package/package.json +15 -52
- package/LICENSE +0 -21
- package/dist/index.cjs +0 -2643
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2620
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,158 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mcphosting-cli
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[](https://www.npmjs.com/package/mcphosting-cli)
|
|
5
|
-
[](https://opensource.org/licenses/MIT)
|
|
3
|
+
File tasks into your [MCPHosting.com](https://mcphosting.com) AI command center from the terminal, and link Claude Code / Cursor to your workspace via MCP.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
npm install -g mcphosting-cli
|
|
13
|
-
|
|
14
|
-
mcphosting login --github # Login with GitHub (recommended)
|
|
15
|
-
mcphosting deploy
|
|
16
|
-
# Done. Your MCP server is live. 🚀
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
That's it. Three commands. Your MCP server is deployed and ready for Claude Desktop, Cursor, ChatGPT, and more.
|
|
20
|
-
|
|
21
|
-
## 🚀 Deploy
|
|
22
|
-
|
|
23
|
-
### Deploy from current directory
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
cd my-mcp-server
|
|
27
|
-
mcphosting deploy
|
|
5
|
+
```sh
|
|
6
|
+
npx mcphosting-cli login # paste an API key from Settings → API & Vault
|
|
7
|
+
npx mcphosting-cli link # registers the MCPHosting MCP server with Claude Code
|
|
8
|
+
npx mcphosting-cli task create "Fix pricing page copy"
|
|
9
|
+
npx mcphosting-cli task list
|
|
28
10
|
```
|
|
29
11
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### Deploy from GitHub
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
mcphosting deploy --github https://github.com/user/my-mcp-server
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Deploy with options
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
mcphosting deploy --name "My MCP" --auth api_key
|
|
42
|
-
mcphosting deploy --api-url https://my-existing-mcp.com/api
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## 🔗 Connect
|
|
46
|
-
|
|
47
|
-
Connect any MCP server to your AI clients with one command:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
mcphosting connect github # Connect GitHub MCP
|
|
51
|
-
mcphosting connect notion # Connect Notion MCP
|
|
52
|
-
mcphosting connect https://my.mcp # Connect custom server
|
|
53
|
-
|
|
54
|
-
# Target specific client
|
|
55
|
-
mcphosting connect slack --client claude
|
|
56
|
-
mcphosting connect stripe --client cursor
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Auto-detects Claude Desktop, Cursor, VS Code, and OpenClaw — configures all of them at once.
|
|
60
|
-
|
|
61
|
-
## 📦 All Commands
|
|
62
|
-
|
|
63
|
-
### Authentication
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
mcphosting login # GitHub login (default, recommended)
|
|
67
|
-
mcphosting login --github # Explicit GitHub login
|
|
68
|
-
mcphosting login --email me@x.com # Email/password login
|
|
69
|
-
mcphosting login --token <token> # Direct token auth
|
|
70
|
-
mcphosting login --browser # Browser-based login
|
|
71
|
-
mcphosting logout # Log out
|
|
72
|
-
mcphosting whoami # Show current user
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Deployment & Management
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
mcphosting deploy # Deploy current directory
|
|
79
|
-
mcphosting deploy --github <url> # Deploy from GitHub
|
|
80
|
-
mcphosting list # List all servers
|
|
81
|
-
mcphosting status <slug> # Check server status
|
|
82
|
-
mcphosting logs <slug> # View server logs
|
|
83
|
-
mcphosting logs <slug> -n 100 # Last 100 log lines
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Environment Variables
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
mcphosting env list <slug> # List env vars
|
|
90
|
-
mcphosting env set <slug> KEY=val # Set an env var
|
|
91
|
-
mcphosting env remove <slug> KEY # Remove an env var
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### API Keys
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
mcphosting keys list # List API keys
|
|
98
|
-
mcphosting keys create "Prod Key" # Create new key
|
|
99
|
-
mcphosting keys delete <id> # Delete a key
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Marketplace
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
mcphosting search github # Search marketplace
|
|
106
|
-
mcphosting info notion # Server details
|
|
107
|
-
mcphosting connect <slug> # Install to AI clients
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Connection Management
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
mcphosting connect <url-or-slug> # Connect MCP to AI clients
|
|
114
|
-
mcphosting disconnect <slug> # Remove connection
|
|
115
|
-
mcphosting list --local # Show local connections
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Migration
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
mcphosting import --from smithery # Import from Smithery
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## 🎯 Supported AI Clients
|
|
125
|
-
|
|
126
|
-
| Client | Auto-Config | Location |
|
|
127
|
-
|--------|:-----------:|----------|
|
|
128
|
-
| Claude Desktop | ✅ | `~/Library/Application Support/Claude/` |
|
|
129
|
-
| Cursor | ✅ | `~/.cursor/mcp.json` |
|
|
130
|
-
| VS Code | ✅ | `.vscode/mcp.json` |
|
|
131
|
-
| OpenClaw | ✅ | `~/.openclaw/mcp.json` |
|
|
132
|
-
| ChatGPT | 📋 | Web setup instructions |
|
|
133
|
-
|
|
134
|
-
## 🏗️ How It Works
|
|
135
|
-
|
|
136
|
-
1. **`mcphosting login`** — Authenticates with MCPHosting.com
|
|
137
|
-
2. **`mcphosting deploy`** — Detects your MCP server, deploys to cloud
|
|
138
|
-
3. **`mcphosting connect`** — Configures your AI clients to use the server
|
|
139
|
-
4. **Proxy mode** — `npx mcphosting-cli proxy <url>` bridges STDIO ↔ HTTP
|
|
140
|
-
|
|
141
|
-
Your deployed server gets a URL like `https://your-server.mcphost.dev` that works with any MCP client.
|
|
142
|
-
|
|
143
|
-
## 🔒 Security
|
|
144
|
-
|
|
145
|
-
- Credentials stored locally in `~/.config/mcphosting/`
|
|
146
|
-
- No data collection during proxy
|
|
147
|
-
- Open source — audit the code
|
|
148
|
-
- Optional auth — marketplace browsing works without login
|
|
149
|
-
|
|
150
|
-
## 📚 Links
|
|
151
|
-
|
|
152
|
-
- [Documentation](https://mcphosting.com/docs)
|
|
153
|
-
- [Dashboard](https://mcphosting.com/dashboard)
|
|
154
|
-
- [GitHub](https://github.com/gorlomi-enzo/mcphosting-cli)
|
|
155
|
-
|
|
156
|
-
## License
|
|
157
|
-
|
|
158
|
-
MIT
|
|
12
|
+
Once linked, your local AI tools can create tasks, post to threads, and write notes in your dashboard — and your dashboard agents pick the work up from there.
|
package/index.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// MCPHosting CLI — file tasks and link local AI tools to your command center.
|
|
3
|
+
import { execSync } from 'node:child_process'
|
|
4
|
+
import { readFileSync, writeFileSync, existsSync } from 'node:fs'
|
|
5
|
+
import { homedir } from 'node:os'
|
|
6
|
+
import { join } from 'node:path'
|
|
7
|
+
import { createInterface } from 'node:readline/promises'
|
|
8
|
+
|
|
9
|
+
const CONFIG_PATH = join(homedir(), '.mcphosting.json')
|
|
10
|
+
const DEFAULT_SITE = 'https://mcphosting.com'
|
|
11
|
+
|
|
12
|
+
function loadConfig() {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(readFileSync(CONFIG_PATH, 'utf8'))
|
|
15
|
+
} catch {
|
|
16
|
+
return {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function saveConfig(config) {
|
|
21
|
+
writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function requireAuth() {
|
|
25
|
+
const config = loadConfig()
|
|
26
|
+
if (!config.apiKey) {
|
|
27
|
+
console.error('Not logged in. Run: mcphosting-cli login')
|
|
28
|
+
process.exit(1)
|
|
29
|
+
}
|
|
30
|
+
return config
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function api(config, path, options = {}) {
|
|
34
|
+
const res = await fetch(`${config.siteUrl ?? DEFAULT_SITE}${path}`, {
|
|
35
|
+
...options,
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
...options.headers,
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
console.error(`API error ${res.status}: ${await res.text()}`)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
return res.json()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const [, , command, ...args] = process.argv
|
|
50
|
+
|
|
51
|
+
switch (command) {
|
|
52
|
+
case 'login': {
|
|
53
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
54
|
+
const apiKey = (await rl.question('Paste your MCPHosting API key (mcph_...): ')).trim()
|
|
55
|
+
const siteUrl =
|
|
56
|
+
(await rl.question(`Site URL [${DEFAULT_SITE}]: `)).trim() || DEFAULT_SITE
|
|
57
|
+
rl.close()
|
|
58
|
+
if (!apiKey.startsWith('mcph_')) {
|
|
59
|
+
console.error('That does not look like an MCPHosting key (expected mcph_...).')
|
|
60
|
+
process.exit(1)
|
|
61
|
+
}
|
|
62
|
+
saveConfig({ apiKey, siteUrl })
|
|
63
|
+
const config = loadConfig()
|
|
64
|
+
await api(config, '/api/v1/tasks?status=all') // verify
|
|
65
|
+
console.log(`Logged in. Config saved to ${CONFIG_PATH}`)
|
|
66
|
+
break
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
case 'link': {
|
|
70
|
+
const config = requireAuth()
|
|
71
|
+
const mcpUrl = `${config.siteUrl ?? DEFAULT_SITE}/api/mcp/mcp`
|
|
72
|
+
const target = args[0] ?? 'claude'
|
|
73
|
+
if (target === 'claude') {
|
|
74
|
+
try {
|
|
75
|
+
execSync(
|
|
76
|
+
`claude mcp add mcphosting --transport http "${mcpUrl}" -H "Authorization: Bearer ${config.apiKey}"`,
|
|
77
|
+
{ stdio: 'inherit' },
|
|
78
|
+
)
|
|
79
|
+
console.log('Linked: Claude Code can now file tasks into your MCPHosting dashboard.')
|
|
80
|
+
} catch {
|
|
81
|
+
console.error('Failed to run the claude CLI — is Claude Code installed?')
|
|
82
|
+
process.exit(1)
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
// Print a generic MCP config snippet (Cursor and other clients).
|
|
86
|
+
console.log('Add this MCP server to your client config:\n')
|
|
87
|
+
console.log(
|
|
88
|
+
JSON.stringify(
|
|
89
|
+
{
|
|
90
|
+
mcpServers: {
|
|
91
|
+
mcphosting: {
|
|
92
|
+
url: mcpUrl,
|
|
93
|
+
headers: { Authorization: `Bearer ${config.apiKey}` },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
null,
|
|
98
|
+
2,
|
|
99
|
+
),
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
break
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
case 'task': {
|
|
106
|
+
const config = requireAuth()
|
|
107
|
+
const sub = args[0]
|
|
108
|
+
if (sub === 'create') {
|
|
109
|
+
const title = args.slice(1).join(' ')
|
|
110
|
+
if (!title) {
|
|
111
|
+
console.error('Usage: mcphosting-cli task create <title>')
|
|
112
|
+
process.exit(1)
|
|
113
|
+
}
|
|
114
|
+
const result = await api(config, '/api/v1/tasks', {
|
|
115
|
+
method: 'POST',
|
|
116
|
+
body: JSON.stringify({ title }),
|
|
117
|
+
})
|
|
118
|
+
console.log(`Task created: ${result.task_id}`)
|
|
119
|
+
} else if (sub === 'list' || !sub) {
|
|
120
|
+
const result = await api(config, '/api/v1/tasks')
|
|
121
|
+
for (const t of result.tasks) {
|
|
122
|
+
console.log(`[${t.status.padEnd(12)}] ${t.dept.padEnd(10)} ${t.title}`)
|
|
123
|
+
}
|
|
124
|
+
if (result.tasks.length === 0) console.log('No open tasks.')
|
|
125
|
+
} else {
|
|
126
|
+
console.error('Usage: mcphosting-cli task [create <title> | list]')
|
|
127
|
+
process.exit(1)
|
|
128
|
+
}
|
|
129
|
+
break
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
case 'status': {
|
|
133
|
+
const config = requireAuth()
|
|
134
|
+
const result = await api(config, '/api/v1/tasks')
|
|
135
|
+
const byStatus = {}
|
|
136
|
+
for (const t of result.tasks) byStatus[t.status] = (byStatus[t.status] ?? 0) + 1
|
|
137
|
+
console.log(`Workspace tasks: ${result.tasks.length} open`)
|
|
138
|
+
for (const [status, count] of Object.entries(byStatus)) console.log(` ${status}: ${count}`)
|
|
139
|
+
break
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
default:
|
|
143
|
+
console.log(`MCPHosting CLI
|
|
144
|
+
|
|
145
|
+
Usage:
|
|
146
|
+
mcphosting-cli login Save your API key (Settings -> API & Vault)
|
|
147
|
+
mcphosting-cli link [claude|config] Register the MCPHosting MCP server with Claude Code
|
|
148
|
+
mcphosting-cli task create <title> File a task into your dashboard
|
|
149
|
+
mcphosting-cli task list List open tasks
|
|
150
|
+
mcphosting-cli status Task counts by status`)
|
|
151
|
+
}
|
package/package.json
CHANGED
|
@@ -1,65 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcphosting-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "CLI for MCPHosting.com \u2014 file tasks, link Claude Code/Cursor to your AI command center",
|
|
5
5
|
"bin": {
|
|
6
|
-
"mcphosting": "
|
|
7
|
-
"mcphost": "dist/index.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/index.cjs",
|
|
10
|
-
"module": "./dist/index.js",
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/index.js",
|
|
15
|
-
"require": "./dist/index.cjs"
|
|
16
|
-
}
|
|
6
|
+
"mcphosting-cli": "./index.js"
|
|
17
7
|
},
|
|
18
8
|
"type": "module",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=18"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/gorlomi-enzo/mcphosting.com.git",
|
|
16
|
+
"directory": "cli"
|
|
23
17
|
},
|
|
24
18
|
"keywords": [
|
|
25
19
|
"mcp",
|
|
26
20
|
"model-context-protocol",
|
|
27
|
-
"claude",
|
|
28
|
-
"chatgpt",
|
|
29
|
-
"cursor",
|
|
30
21
|
"ai-agents",
|
|
31
|
-
"
|
|
32
|
-
"mcp-hosting",
|
|
33
|
-
"mcp-deploy",
|
|
34
|
-
"mcp-marketplace",
|
|
35
|
-
"ai-tools",
|
|
36
|
-
"llm-tools",
|
|
37
|
-
"deploy",
|
|
38
|
-
"hosting"
|
|
22
|
+
"claude"
|
|
39
23
|
],
|
|
40
|
-
"repository": {
|
|
41
|
-
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/mcphosting/mcphosting-cli.git"
|
|
43
|
-
},
|
|
44
|
-
"author": "MCPHosting",
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
48
|
-
"axios": "^1.7.0",
|
|
49
|
-
"chalk": "^5.3.0",
|
|
50
|
-
"commander": "^12.0.0",
|
|
51
|
-
"conf": "^12.0.0",
|
|
52
|
-
"open": "^10.0.0",
|
|
53
|
-
"ora": "^8.0.1"
|
|
54
|
-
},
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@types/node": "^20.11.0",
|
|
57
|
-
"tsup": "^8.0.0",
|
|
58
|
-
"typescript": "^5.3.0"
|
|
59
|
-
},
|
|
60
24
|
"files": [
|
|
61
|
-
"
|
|
62
|
-
"README.md"
|
|
63
|
-
"LICENSE"
|
|
25
|
+
"index.js",
|
|
26
|
+
"README.md"
|
|
64
27
|
]
|
|
65
|
-
}
|
|
28
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 MCPHosting / Gorlomi Ventures LLC
|
|
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.
|