mcphosting-cli 0.1.2 → 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 CHANGED
@@ -1,260 +1,12 @@
1
- # MCPHosting CLI
1
+ # mcphosting-cli
2
2
 
3
- [![npm version](https://badge.fury.io/js/@mcphosting%2Fcli.svg)](https://www.npmjs.com/package/@mcphosting/cli)
4
- [![Downloads](https://img.shields.io/npm/dm/@mcphosting/cli.svg)](https://www.npmjs.com/package/@mcphosting/cli)
5
- [![GitHub stars](https://img.shields.io/github/stars/gorlomi-enzo/mcphosting-cli.svg)](https://github.com/gorlomi-enzo/mcphosting-cli)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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.
7
4
 
8
- **Connect AI agents to MCP servers. Browse, install, and manage Model Context Protocol servers.**
9
-
10
- The easiest way to connect MCP servers to Claude Desktop, ChatGPT, Cursor, VS Code, and other AI clients. One command to rule them all.
11
-
12
- ## Quick Start
13
-
14
- ```bash
15
- # Install globally
16
- npm install -g @mcphosting/cli
17
-
18
- # Or run directly with npx
19
- npx @mcphosting/cli connect github
20
- ```
21
-
22
- ## 🔗 How to Connect MCP Servers to AI Clients
23
-
24
- ### How to Connect MCP Servers to Claude Desktop
25
-
26
- Claude Desktop is the most popular way to use MCP servers. Here's how to connect any MCP server:
27
-
28
- 1. **Install the CLI:**
29
- ```bash
30
- npm install -g @mcphosting/cli
31
- ```
32
-
33
- 2. **Connect an MCP server:**
34
- ```bash
35
- mcphost connect github
36
- ```
37
-
38
- 3. **Restart Claude Desktop** to load the new MCP server
39
-
40
- The CLI automatically detects your Claude Desktop installation and updates the `claude_desktop_config.json` file with the MCP server configuration.
41
-
42
- **Manual Claude Desktop Setup:**
43
- If you prefer manual setup, edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
44
-
45
- ```json
46
- {
47
- "mcpServers": {
48
- "github": {
49
- "command": "npx",
50
- "args": ["-y", "@mcphosting/cli", "proxy", "https://github.mcphost.dev"],
51
- "env": {}
52
- }
53
- }
54
- }
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
55
10
  ```
56
11
 
57
- ### How to Connect MCP Servers to ChatGPT
58
-
59
- ChatGPT Plus users can connect MCP servers through the web interface:
60
-
61
- 1. **Get the MCP server URL:**
62
- ```bash
63
- mcphost info github # Shows the server URL
64
- ```
65
-
66
- 2. **Add to ChatGPT:**
67
- - Open ChatGPT in your browser
68
- - Go to Settings → Apps → Connect an app
69
- - Enter the MCP server URL (e.g., `https://github.mcphost.dev`)
70
- - Follow the authorization prompts
71
-
72
- 3. **Start using MCP tools** in your ChatGPT conversations
73
-
74
- ### How to Connect MCP Servers to Cursor
75
-
76
- Cursor IDE supports MCP servers through configuration files:
77
-
78
- 1. **Auto-connect with CLI:**
79
- ```bash
80
- mcphost connect notion --client cursor
81
- ```
82
-
83
- 2. **Manual Cursor setup:**
84
- Create or edit `~/.cursor/mcp.json`:
85
- ```json
86
- {
87
- "mcpServers": {
88
- "notion": {
89
- "command": "npx",
90
- "args": ["-y", "@mcphosting/cli", "proxy", "https://notion.mcphost.dev"],
91
- "env": {}
92
- }
93
- }
94
- }
95
- ```
96
-
97
- 3. **Restart Cursor** to load the MCP server
98
-
99
- ## 📦 Available Commands
100
-
101
- ### Connection Management
102
- ```bash
103
- mcphost connect <url-or-slug> # Connect MCP server to all AI clients
104
- mcphost connect <url> --client claude # Connect only to Claude Desktop
105
- mcphost disconnect <slug> # Remove MCP connection
106
- mcphost list # List all connected MCP servers
107
- ```
108
-
109
- ### Marketplace
110
- ```bash
111
- mcphost search <query> # Search MCP marketplace
112
- mcphost info <slug> # Get detailed MCP server info
113
- ```
114
-
115
- ### Migration
116
- ```bash
117
- mcphost import --from smithery # Import from Smithery CLI
118
- ```
119
-
120
- ### Authentication (Optional)
121
- ```bash
122
- mcphost login # Login to MCPHosting
123
- mcphost logout # Logout
124
- mcphost whoami # Show current user
125
- ```
126
-
127
- ## 🌟 Featured MCP Servers
128
-
129
- | Server | Description | Tools | Connect |
130
- |--------|-------------|-------|---------|
131
- | **GitHub** | Access repositories, issues, PRs | `read_file`, `list_repos`, `create_issue` | `mcphost connect github` |
132
- | **Slack** | Send messages, manage workspaces | `send_message`, `list_channels` | `mcphost connect slack` |
133
- | **Notion** | Read/write pages and databases | `read_page`, `create_page`, `query_database` | `mcphost connect notion` |
134
- | **Stripe** | Payment and customer data | `get_customer`, `list_payments` | `mcphost connect stripe` |
135
- | **PostgreSQL** | Safe database queries | `query`, `describe_table`, `list_tables` | `mcphost connect postgres` |
136
-
137
- ## 🚀 MCPHosting CLI vs Smithery CLI
138
-
139
- | Feature | MCPHosting CLI | Smithery CLI |
140
- |---------|----------------|--------------|
141
- | **Auto-detection** | ✅ Detects Claude, Cursor, VS Code | ❌ Manual config |
142
- | **ChatGPT support** | ✅ Web setup instructions | ❌ Not supported |
143
- | **Migration** | ✅ `import --from smithery` | ❌ No migration |
144
- | **Marketplace** | ✅ Search & browse built-in | ❌ Limited discovery |
145
- | **Growth features** | ✅ Sharing prompts, GitHub stars | ❌ Basic CLI |
146
- | **Proxy mode** | ✅ Built-in STDIO proxy | ❌ External tools needed |
147
- | **Multiple clients** | ✅ Connect to all at once | ❌ One at a time |
148
-
149
- **Migration from Smithery:**
150
- ```bash
151
- mcphost import --from smithery
152
- ```
153
-
154
- ## 🎯 Supported AI Clients
155
-
156
- | Client | Status | Auto-Detection | Config Location |
157
- |--------|--------|----------------|-----------------|
158
- | **Claude Desktop** | ✅ Full support | ✅ Automatic | `~/Library/Application Support/Claude/` |
159
- | **ChatGPT Plus** | ✅ Web setup | N/A | Web interface |
160
- | **Cursor** | ✅ Full support | ✅ Automatic | `~/.cursor/mcp.json` |
161
- | **VS Code** | ✅ Full support | ✅ Automatic | `.vscode/mcp.json` |
162
- | **OpenClaw** | ✅ Full support | ✅ Automatic | `~/.openclaw/mcp.json` |
163
-
164
- ## 🔧 Examples
165
-
166
- **Connect GitHub MCP to all clients:**
167
- ```bash
168
- mcphost connect github
169
- # 🎉 Connected! Share with your team:
170
- # npx @mcphosting/cli connect github
171
- #
172
- # ⭐ Star us: https://github.com/gorlomi-enzo/mcphosting-cli
173
- ```
174
-
175
- **Connect custom MCP server:**
176
- ```bash
177
- mcphost connect https://my-custom-mcp.example.com
178
- ```
179
-
180
- **Search for MCP servers:**
181
- ```bash
182
- mcphost search "database"
183
- mcphost search "slack"
184
- mcphost info notion
185
- ```
186
-
187
- **Import from Smithery:**
188
- ```bash
189
- mcphost import --from smithery --dry-run # Preview what will be imported
190
- mcphost import --from smithery # Actually import
191
- ```
192
-
193
- **List connections:**
194
- ```bash
195
- mcphost list
196
- # 📋 Connected MCP Servers (3)
197
- #
198
- # Slug | URL | Clients | Added
199
- # github | https://github.mcphost.dev | claude, cursor | 12/1/2024
200
- # slack | https://slack.mcphost.dev | claude | 12/1/2024
201
- # notion | https://notion.mcphost.dev | claude, cursor | 12/1/2024
202
- ```
203
-
204
- ## 🏗️ How It Works
205
-
206
- 1. **URL Resolution:** Slugs like `github` become `https://github.mcphost.dev`
207
- 2. **Client Detection:** Automatically finds Claude Desktop, Cursor, VS Code configs
208
- 3. **Config Update:** Adds MCP server entry to each client's config file
209
- 4. **Proxy Mode:** Uses `npx @mcphosting/cli proxy <url>` for STDIO communication
210
-
211
- **Config Format:**
212
- ```json
213
- {
214
- "mcpServers": {
215
- "github": {
216
- "command": "npx",
217
- "args": ["-y", "@mcphosting/cli", "proxy", "https://github.mcphost.dev"],
218
- "env": {}
219
- }
220
- }
221
- }
222
- ```
223
-
224
- ## 🔒 Security & Privacy
225
-
226
- - **No data collection** during MCP proxying
227
- - **Open source** - audit the code yourself
228
- - **Local config** - your connections stored in `~/.mcphosting/`
229
- - **Optional auth** - marketplace features only
230
-
231
- ## 📚 Documentation
232
-
233
- - [Getting Started Guide](https://mcphosting.com/docs/getting-started)
234
- - [MCP Server Development](https://mcphosting.com/docs/development)
235
- - [API Reference](https://mcphosting.com/docs/api)
236
- - [Troubleshooting](https://mcphosting.com/docs/troubleshooting)
237
-
238
- ## 🤝 Contributing
239
-
240
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md).
241
-
242
- 1. Fork the repository
243
- 2. Create a feature branch: `git checkout -b my-feature`
244
- 3. Commit changes: `git commit -am 'Add feature'`
245
- 4. Push to branch: `git push origin my-feature`
246
- 5. Submit a Pull Request
247
-
248
- ## 📄 License
249
-
250
- MIT License - see [LICENSE](LICENSE) for details.
251
-
252
- ## 🌟 Star History
253
-
254
- [![Star History Chart](https://api.star-history.com/svg?repos=gorlomi-enzo/mcphosting-cli&type=Date)](https://star-history.com/#gorlomi-enzo/mcphosting-cli&Date)
255
-
256
- ---
257
-
258
- **Made with ❤️ by [MCPHosting](https://mcphosting.com)**
259
-
260
- [⭐ Star us on GitHub](https://github.com/gorlomi-enzo/mcphosting-cli) • [🐦 Follow on Twitter](https://twitter.com/mcphosting) • [💬 Join Discord](https://discord.gg/mcphosting)
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,61 +1,28 @@
1
1
  {
2
2
  "name": "mcphosting-cli",
3
- "version": "0.1.2",
4
- "description": "Connect AI agents to MCP servers. Browse, install, and manage Model Context Protocol servers.",
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
- "mcphost": "dist/index.js"
7
- },
8
- "main": "./dist/index.cjs",
9
- "module": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.cjs"
15
- }
6
+ "mcphosting-cli": "./index.js"
16
7
  },
17
8
  "type": "module",
18
- "scripts": {
19
- "build": "tsup",
20
- "dev": "tsup --watch",
21
- "test": "node dist/index.js --help"
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"
22
17
  },
23
18
  "keywords": [
24
19
  "mcp",
25
20
  "model-context-protocol",
26
- "claude",
27
- "chatgpt",
28
- "cursor",
29
21
  "ai-agents",
30
- "mcp-server",
31
- "mcp-hosting",
32
- "smithery",
33
- "github-mcp",
34
- "slack-mcp",
35
- "notion-mcp",
36
- "stripe-mcp",
37
- "mcp-marketplace",
38
- "ai-tools",
39
- "llm-tools"
22
+ "claude"
40
23
  ],
41
- "author": "MCPHosting",
42
- "license": "MIT",
43
- "dependencies": {
44
- "@modelcontextprotocol/sdk": "^1.0.0",
45
- "chalk": "^5.3.0",
46
- "commander": "^12.0.0",
47
- "conf": "^12.0.0",
48
- "open": "^10.0.0",
49
- "ora": "^8.0.1"
50
- },
51
- "devDependencies": {
52
- "@types/node": "^20.11.0",
53
- "tsup": "^8.0.0",
54
- "typescript": "^5.3.0"
55
- },
56
24
  "files": [
57
- "dist",
58
- "README.md",
59
- "LICENSE"
25
+ "index.js",
26
+ "README.md"
60
27
  ]
61
- }
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.