@mcp-use/cli 3.6.5-canary.1 → 4.0.0-beta.1
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -10099
- package/package.json +11 -39
- package/LICENSE +0 -22
- package/README.md +0 -570
- package/dist/commands/auth.d.ts +0 -34
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/client-auth.d.ts +0 -4
- package/dist/commands/client-auth.d.ts.map +0 -1
- package/dist/commands/client.d.ts +0 -29
- package/dist/commands/client.d.ts.map +0 -1
- package/dist/commands/deploy.d.ts +0 -83
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deployments.d.ts +0 -3
- package/dist/commands/deployments.d.ts.map +0 -1
- package/dist/commands/env.d.ts +0 -3
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/org.d.ts +0 -13
- package/dist/commands/org.d.ts.map +0 -1
- package/dist/commands/screenshot.d.ts +0 -99
- package/dist/commands/screenshot.d.ts.map +0 -1
- package/dist/commands/servers.d.ts +0 -3
- package/dist/commands/servers.d.ts.map +0 -1
- package/dist/commands/skills.d.ts +0 -3
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/index.cjs +0 -10118
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/shims/next-shims-cjs.cjs +0 -42
- package/dist/shims/next-shims-loader.mjs +0 -119
- package/dist/shims/next-shims-noop.cjs +0 -146
- package/dist/shims/next-shims-register.mjs +0 -14
- package/dist/shims/next-shims-registry.json +0 -11
- package/dist/utils/api.d.ts +0 -329
- package/dist/utils/api.d.ts.map +0 -1
- package/dist/utils/cdp-screenshot.d.ts +0 -68
- package/dist/utils/cdp-screenshot.d.ts.map +0 -1
- package/dist/utils/chrome-path.d.ts +0 -14
- package/dist/utils/chrome-path.d.ts.map +0 -1
- package/dist/utils/cloud-urls.d.ts +0 -13
- package/dist/utils/cloud-urls.d.ts.map +0 -1
- package/dist/utils/config.d.ts +0 -54
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/errors.d.ts +0 -6
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/format.d.ts +0 -94
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/git.d.ts +0 -56
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/next-shims.d.ts +0 -77
- package/dist/utils/next-shims.d.ts.map +0 -1
- package/dist/utils/oauth.d.ts +0 -22
- package/dist/utils/oauth.d.ts.map +0 -1
- package/dist/utils/parse-args.d.ts +0 -27
- package/dist/utils/parse-args.d.ts.map +0 -1
- package/dist/utils/project-link.d.ts +0 -11
- package/dist/utils/project-link.d.ts.map +0 -1
- package/dist/utils/session-storage.d.ts +0 -46
- package/dist/utils/session-storage.d.ts.map +0 -1
- package/dist/utils/session.d.ts +0 -39
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/tarball.d.ts +0 -13
- package/dist/utils/tarball.d.ts.map +0 -1
- package/dist/utils/update-check.d.ts +0 -6
- package/dist/utils/update-check.d.ts.map +0 -1
- package/dist/utils/widget-paths.d.ts +0 -2
- package/dist/utils/widget-paths.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-use/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "4.0.0-beta.1",
|
|
5
|
+
"description": "Compatibility proxy for the CLI included in mcp-use v2",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/mcp-use/mcp-use#readme",
|
|
@@ -17,58 +17,30 @@
|
|
|
17
17
|
"keywords": [
|
|
18
18
|
"mcp",
|
|
19
19
|
"model-context-protocol",
|
|
20
|
-
"cli"
|
|
21
|
-
"build-tool",
|
|
22
|
-
"widget",
|
|
23
|
-
"ui",
|
|
24
|
-
"react",
|
|
25
|
-
"esbuild",
|
|
26
|
-
"bundler",
|
|
27
|
-
"typescript"
|
|
20
|
+
"cli"
|
|
28
21
|
],
|
|
29
22
|
"bin": {
|
|
30
|
-
"mcp-use": "./dist/index.
|
|
23
|
+
"mcp-use": "./dist/index.js"
|
|
31
24
|
},
|
|
32
25
|
"files": [
|
|
33
26
|
"dist"
|
|
34
27
|
],
|
|
35
28
|
"engines": {
|
|
36
|
-
"node": "
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
40
|
-
"react-dom": "^18.0.0 || ^19.0.0",
|
|
41
|
-
"react-router-dom": "^7.12.0"
|
|
29
|
+
"node": ">=22.22.2"
|
|
42
30
|
},
|
|
43
31
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
-
"@vitejs/plugin-react": "^6.0.0",
|
|
46
|
-
"chalk": "^5.6.2",
|
|
47
|
-
"chokidar": "^5.0.0",
|
|
48
|
-
"commander": "^14.0.2",
|
|
49
|
-
"dotenv": "^17.3.1",
|
|
50
|
-
"esbuild": "0.28.1",
|
|
51
|
-
"open": "^11.0.0",
|
|
52
|
-
"tar": "^7.5.16",
|
|
53
|
-
"tsx": "^4.21.0",
|
|
54
|
-
"vite": "^8.0.16",
|
|
55
|
-
"vite-plugin-singlefile": "^2.3.2",
|
|
56
|
-
"ws": "^8.19.0",
|
|
57
|
-
"zod": "4.3.5",
|
|
58
|
-
"@mcp-use/inspector": "12.0.4-canary.1",
|
|
59
|
-
"mcp-use": "1.34.4-canary.1"
|
|
32
|
+
"mcp-use": "^2.0.0-beta.12"
|
|
60
33
|
},
|
|
61
34
|
"devDependencies": {
|
|
62
|
-
"
|
|
63
|
-
"
|
|
35
|
+
"rimraf": "^6.1.3",
|
|
36
|
+
"tsup": "^8.5.1",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
64
38
|
},
|
|
65
39
|
"publishConfig": {
|
|
66
40
|
"access": "public"
|
|
67
41
|
},
|
|
68
42
|
"scripts": {
|
|
69
|
-
"build": "tsup && tsc --emitDeclarationOnly --declaration",
|
|
70
|
-
"
|
|
71
|
-
"test": "vitest run",
|
|
72
|
-
"test:watch": "vitest"
|
|
43
|
+
"build": "rimraf dist && tsup src/index.ts --format esm --target node22 && tsc --emitDeclarationOnly --declaration",
|
|
44
|
+
"test": "node --test tests/proxy.test.mjs"
|
|
73
45
|
}
|
|
74
46
|
}
|
package/LICENSE
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 mcp-use, Inc.
|
|
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.
|
|
22
|
-
|
package/README.md
DELETED
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
<div align="center" style="margin: 0 auto; max-width: 80%;">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mcp-use/mcp-use/main/static/logo_white.svg">
|
|
4
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/mcp-use/mcp-use/main/static/logo_black.svg">
|
|
5
|
-
<img alt="mcp use logo" src="https://raw.githubusercontent.com/mcp-use/mcp-use/main/static/logo_white.svg" width="80%" style="margin: 20px auto;">
|
|
6
|
-
</picture>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<h1 align="center">mcp-use CLI</h1>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@mcp-use/cli" alt="NPM Downloads">
|
|
13
|
-
<img src="https://img.shields.io/npm/dw/@mcp-use/cli.svg"/></a>
|
|
14
|
-
<a href="https://www.npmjs.com/package/@mcp-use/cli" alt="NPM Version">
|
|
15
|
-
<img src="https://img.shields.io/npm/v/@mcp-use/cli.svg"/></a>
|
|
16
|
-
<a href="https://github.com/mcp-use/mcp-use/blob/main/LICENSE" alt="License">
|
|
17
|
-
<img src="https://img.shields.io/github/license/mcp-use/mcp-use" /></a>
|
|
18
|
-
<a href="https://github.com/mcp-use/mcp-use/stargazers" alt="GitHub stars">
|
|
19
|
-
<img src="https://img.shields.io/github/stars/mcp-use/mcp-use?style=social" /></a>
|
|
20
|
-
<a href="https://discord.gg/XkNkSkMz3V" alt="Discord">
|
|
21
|
-
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
22
|
-
</p>
|
|
23
|
-
|
|
24
|
-
🛠️ **mcp-use CLI** is a powerful build and development tool for creating MCP (Model Context Protocol) applications with integrated UI widgets. It enables developers to build MCP servers with custom React components that can be served alongside their MCP tools, providing rich visual interfaces for AI interactions.
|
|
25
|
-
|
|
26
|
-
## 📦 Related Packages
|
|
27
|
-
|
|
28
|
-
| Package | Description | Version |
|
|
29
|
-
| ------------------------------------------------------------------------------------------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
30
|
-
| [mcp-use](https://github.com/mcp-use/mcp-use/tree/main/libraries/typescript/packages/mcp-use) | Core MCP framework | [](https://www.npmjs.com/package/mcp-use) |
|
|
31
|
-
| [@mcp-use/inspector](https://github.com/mcp-use/mcp-use/tree/main/libraries/typescript/packages/inspector) | Web-based MCP inspector | [](https://www.npmjs.com/package/@mcp-use/inspector) |
|
|
32
|
-
| [create-mcp-use-app](https://github.com/mcp-use/mcp-use/tree/main/libraries/typescript/packages/create-mcp-use-app) | Create MCP apps | [](https://www.npmjs.com/package/create-mcp-use-app) |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## ✨ Key Features
|
|
37
|
-
|
|
38
|
-
| Feature | Description |
|
|
39
|
-
| ------------------------ | ------------------------------------------------------------------------------------ |
|
|
40
|
-
| **🚀 Auto Inspector** | Automatically opens the MCP Inspector in your browser when development server starts |
|
|
41
|
-
| **♻️ Hot Reload** | Development mode with automatic reloading for both server code and UI widgets |
|
|
42
|
-
| **🎨 Widget Builder** | Compiles React components into standalone HTML pages with all dependencies bundled |
|
|
43
|
-
| **📦 Production Ready** | Optimized production builds with hashed assets for caching |
|
|
44
|
-
| **🛠️ TypeScript First** | Full TypeScript support with watch mode compilation |
|
|
45
|
-
| **🖥️ Multi-Environment** | Separate commands for development, build, and production deployment |
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 🚀 Installation
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# Install globally
|
|
53
|
-
npm install -g @mcp-use/cli
|
|
54
|
-
|
|
55
|
-
# Or use with npx (no installation needed)
|
|
56
|
-
npx @mcp-use/cli dev
|
|
57
|
-
|
|
58
|
-
# Install as a project dependency
|
|
59
|
-
npm install --save-dev @mcp-use/cli
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## 📖 Usage
|
|
65
|
-
|
|
66
|
-
### Development Mode
|
|
67
|
-
|
|
68
|
-
Start a development server with hot reload, automatic TypeScript compilation, and auto-opening inspector:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
mcp-use dev [options]
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**What happens in dev mode:**
|
|
75
|
-
|
|
76
|
-
1. TypeScript files are compiled in watch mode
|
|
77
|
-
2. UI widgets are built with hot reload
|
|
78
|
-
3. Server runs with auto-restart on changes (via tsx)
|
|
79
|
-
4. Inspector automatically opens in your browser at `http://localhost:3000/inspector`
|
|
80
|
-
5. MCP endpoint is available at `http://localhost:3000/mcp`
|
|
81
|
-
|
|
82
|
-
**Options:**
|
|
83
|
-
|
|
84
|
-
- `-p, --path <path>` - Project directory (default: current directory)
|
|
85
|
-
- `--port <port>` - Server port (default: 3000)
|
|
86
|
-
- `--no-open` - Don't auto-open inspector in browser
|
|
87
|
-
|
|
88
|
-
### Production Build
|
|
89
|
-
|
|
90
|
-
Build your MCP application for production deployment:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
mcp-use build [options]
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**What happens during build:**
|
|
97
|
-
|
|
98
|
-
1. TypeScript is compiled to JavaScript
|
|
99
|
-
2. All `.tsx` files in `resources/` are bundled as standalone HTML pages
|
|
100
|
-
3. Assets are hashed for optimal caching
|
|
101
|
-
4. Output is optimized and minified
|
|
102
|
-
|
|
103
|
-
**Options:**
|
|
104
|
-
|
|
105
|
-
- `-p, --path <path>` - Project directory (default: current directory)
|
|
106
|
-
|
|
107
|
-
### Production Server
|
|
108
|
-
|
|
109
|
-
Start the production server from built files:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
mcp-use start [options]
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Options:**
|
|
116
|
-
|
|
117
|
-
- `-p, --path <path>` - Project directory (default: current directory)
|
|
118
|
-
- `--port <port>` - Server port (default: 3000)
|
|
119
|
-
|
|
120
|
-
### Cloud Deployment
|
|
121
|
-
|
|
122
|
-
Deploy your MCP server to production via [manufact.com](https://manufact.com):
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# Login to Manufact cloud
|
|
126
|
-
mcp-use login
|
|
127
|
-
|
|
128
|
-
# Non-interactive login with a pre-approved device code (web onboarding, agents)
|
|
129
|
-
mcp-use login --device-code <code>
|
|
130
|
-
|
|
131
|
-
# Non-interactive login (for agents / CI) — picks an org without prompting
|
|
132
|
-
mcp-use login --org <slug|id|name>
|
|
133
|
-
|
|
134
|
-
# Check authentication status
|
|
135
|
-
mcp-use whoami
|
|
136
|
-
|
|
137
|
-
# Deploy your MCP server
|
|
138
|
-
mcp-use deploy [options]
|
|
139
|
-
|
|
140
|
-
# Logout
|
|
141
|
-
mcp-use logout
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Deploy Options:**
|
|
145
|
-
|
|
146
|
-
- `--no-github` - Upload local source without connecting GitHub (platform-managed repo)
|
|
147
|
-
- `--name <name>` - Custom deployment name
|
|
148
|
-
- `--port <port>` - Server port (default: 3000)
|
|
149
|
-
- `--runtime <runtime>` - Runtime environment: "node" or "python"
|
|
150
|
-
- `--branch <name>` - Deploy branch (default: current git branch). Also scopes `--env` / `--env-file` sync to that branch's preview env.
|
|
151
|
-
- `--env <key=value...>` - Set environment variable **values** (repeatable)
|
|
152
|
-
- `--env-file <path>` - Load environment variable values from a `.env` file
|
|
153
|
-
- `--root-dir <path>` - Subdirectory to deploy from (monorepos)
|
|
154
|
-
- `--watch-paths <glob...>` - Only auto-deploy when matching files change (monorepos); set on new-server creation
|
|
155
|
-
- `--wait-for-ci` - Hold GitHub auto-deploys until other check runs pass; set on new-server creation
|
|
156
|
-
- `--open` - Open deployment in browser after success
|
|
157
|
-
|
|
158
|
-
**Example:**
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
# Basic deployment (from GitHub when configured)
|
|
162
|
-
mcp-use deploy
|
|
163
|
-
|
|
164
|
-
# Deploy without GitHub — uploads local source
|
|
165
|
-
mcp-use deploy --no-github
|
|
166
|
-
|
|
167
|
-
# Deploy with custom options
|
|
168
|
-
mcp-use deploy --name my-server --port 8000 --open
|
|
169
|
-
|
|
170
|
-
# Deploy a branch and scope env values to its preview env
|
|
171
|
-
mcp-use deploy --branch feature-x --env API_KEY=abc123
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## ☁️ Managing cloud servers
|
|
177
|
-
|
|
178
|
-
After a server exists you can update its configuration and environment
|
|
179
|
-
variables without redeploying from scratch.
|
|
180
|
-
|
|
181
|
-
### `servers update`
|
|
182
|
-
|
|
183
|
-
Mutate server-level config in place (no delete/recreate, so the URL slug and
|
|
184
|
-
env vars are preserved):
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Change the production branch (which branch triggers production deploys)
|
|
188
|
-
mcp-use servers update my-server --branch main
|
|
189
|
-
|
|
190
|
-
# Override build / start commands or rename the server
|
|
191
|
-
mcp-use servers update my-server --build-command "npm run build" --start-command "npm start"
|
|
192
|
-
mcp-use servers update my-server --name "My Server" --description "…"
|
|
193
|
-
|
|
194
|
-
# Clear a build/start override (pass an empty string)
|
|
195
|
-
mcp-use servers update my-server --build-command "" --start-command ""
|
|
196
|
-
|
|
197
|
-
# Monorepos: scope auto-deploys to an app's own files + shared code
|
|
198
|
-
mcp-use servers update my-server \
|
|
199
|
-
--watch-paths "apps/my-server/**" "packages/shared/**" \
|
|
200
|
-
--deploy-branches "release/*"
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Flags: `--branch` (production branch), `--name`, `--description`,
|
|
204
|
-
`--build-command`, `--start-command`, `--root-dir`, `--watch-paths`,
|
|
205
|
-
`--deploy-branches`, `--wait-for-ci` / `--no-wait-for-ci`, `--org`. At least
|
|
206
|
-
one is required. Pass an empty string to `--build-command`, `--start-command`,
|
|
207
|
-
or `--root-dir` to clear it; pass an empty string to `--watch-paths` /
|
|
208
|
-
`--deploy-branches` to clear the filter (deploy on any change / allow all
|
|
209
|
-
branches).
|
|
210
|
-
|
|
211
|
-
### `servers env` — environment variables
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
# List (production scope), or scope to a branch's preview env
|
|
215
|
-
mcp-use servers env list --server <id>
|
|
216
|
-
mcp-use servers env list --server <id> --branch feature-x
|
|
217
|
-
|
|
218
|
-
# Add a variable. --env selects which environment TAGS it applies to;
|
|
219
|
-
# --branch pins it to a branch's preview env (omit for production).
|
|
220
|
-
mcp-use servers env add API_KEY=abc123 --server <id> --env production,preview
|
|
221
|
-
mcp-use servers env add API_KEY=abc123 --server <id> --branch feature-x
|
|
222
|
-
|
|
223
|
-
# Update / remove by KEY (resolved within the branch scope) or by UUID
|
|
224
|
-
mcp-use servers env update API_KEY --server <id> --value newval --branch feature-x
|
|
225
|
-
mcp-use servers env rm API_KEY --server <id> --branch feature-x
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### `deployments restart`
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Restart reusing the deployment's branch, or target a different branch
|
|
232
|
-
mcp-use deployments restart <deployment-id>
|
|
233
|
-
mcp-use deployments restart <deployment-id> --branch feature-x
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
### Environment naming
|
|
237
|
-
|
|
238
|
-
The platform models environments as `production`, `preview`, and
|
|
239
|
-
`development` (the `--env` tag) plus an optional **branch** pin (`--branch`).
|
|
240
|
-
There is no literal `test` environment. Common aliases map as:
|
|
241
|
-
|
|
242
|
-
| You might say | Use |
|
|
243
|
-
| --- | --- |
|
|
244
|
-
| `prod` | `production` |
|
|
245
|
-
| `dev` | `development` |
|
|
246
|
-
| `staging` / per-branch | a `--branch <name>` preview (optionally tagged `preview`) |
|
|
247
|
-
|
|
248
|
-
Note the two different `--env` meanings: on `deploy` it sets variable
|
|
249
|
-
**values** (`KEY=VALUE`), while on `servers env` it selects the environment
|
|
250
|
-
**tags** a variable applies to (`production,preview,development`).
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## 💡 Examples
|
|
255
|
-
|
|
256
|
-
### Basic Development Workflow
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
# Create a new MCP app (using create-mcp-use-app)
|
|
260
|
-
npx create-mcp-use-app my-mcp-server
|
|
261
|
-
|
|
262
|
-
# Navigate to project
|
|
263
|
-
cd my-mcp-server
|
|
264
|
-
|
|
265
|
-
# Start development with auto-reload and inspector
|
|
266
|
-
mcp-use dev
|
|
267
|
-
|
|
268
|
-
# Browser automatically opens to http://localhost:3000/inspector
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
### Custom Port Configuration
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
# Development on port 8080
|
|
275
|
-
mcp-use dev --port 8080
|
|
276
|
-
|
|
277
|
-
# Production on port 8080
|
|
278
|
-
mcp-use build
|
|
279
|
-
mcp-use start --port 8080
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### Working with Different Project Structures
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
# Specify custom project path
|
|
286
|
-
mcp-use dev -p ./my-app
|
|
287
|
-
mcp-use build -p ./my-app
|
|
288
|
-
mcp-use start -p ./my-app
|
|
289
|
-
|
|
290
|
-
# Development without auto-opening browser
|
|
291
|
-
mcp-use dev --no-open
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
### CI/CD Pipeline Example
|
|
295
|
-
|
|
296
|
-
```bash
|
|
297
|
-
# In your CI/CD pipeline
|
|
298
|
-
npm install
|
|
299
|
-
npm run build # Uses mcp-use build
|
|
300
|
-
npm run start # Uses mcp-use start
|
|
301
|
-
|
|
302
|
-
# Or with PM2 for production
|
|
303
|
-
npm run build
|
|
304
|
-
pm2 start "mcp-use start" --name my-mcp-server
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## 📁 Project Structure
|
|
310
|
-
|
|
311
|
-
The CLI expects the following project structure:
|
|
312
|
-
|
|
313
|
-
```
|
|
314
|
-
my-mcp-app/
|
|
315
|
-
├── package.json
|
|
316
|
-
├── tsconfig.json
|
|
317
|
-
├── src/
|
|
318
|
-
│ └── index.ts # Your MCP server entry point
|
|
319
|
-
├── resources/ # UI widgets (React components)
|
|
320
|
-
│ ├── todo-list.tsx # Becomes /widgets/todo-list/index.html
|
|
321
|
-
│ └── dashboard.tsx # Becomes /widgets/dashboard/index.html
|
|
322
|
-
└── dist/ # Build output
|
|
323
|
-
├── index.js # Compiled server
|
|
324
|
-
└── resources/
|
|
325
|
-
└── mcp-use/
|
|
326
|
-
└── widgets/
|
|
327
|
-
├── todo-list/
|
|
328
|
-
│ ├── index.html
|
|
329
|
-
│ └── assets/
|
|
330
|
-
│ └── index-[hash].js
|
|
331
|
-
└── dashboard/
|
|
332
|
-
├── index.html
|
|
333
|
-
└── assets/
|
|
334
|
-
└── index-[hash].js
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
339
|
-
## 🎨 Creating UI Widgets
|
|
340
|
-
|
|
341
|
-
UI widgets are React components that get compiled into standalone HTML pages. They can interact with your MCP server tools using the `useMcp` hook:
|
|
342
|
-
|
|
343
|
-
```tsx
|
|
344
|
-
// resources/task-manager.tsx
|
|
345
|
-
import React, { useState, useEffect } from "react";
|
|
346
|
-
import { useMcp } from "mcp-use/react";
|
|
347
|
-
|
|
348
|
-
export default function TaskManager() {
|
|
349
|
-
const { callTool, status, error } = useMcp();
|
|
350
|
-
const [tasks, setTasks] = useState([]);
|
|
351
|
-
const [newTask, setNewTask] = useState("");
|
|
352
|
-
|
|
353
|
-
useEffect(() => {
|
|
354
|
-
loadTasks();
|
|
355
|
-
}, []);
|
|
356
|
-
|
|
357
|
-
const loadTasks = async () => {
|
|
358
|
-
const result = await callTool("list_tasks");
|
|
359
|
-
setTasks(result.tasks);
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
const addTask = async () => {
|
|
363
|
-
if (!newTask.trim()) return;
|
|
364
|
-
|
|
365
|
-
await callTool("create_task", {
|
|
366
|
-
title: newTask,
|
|
367
|
-
status: "pending",
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
setNewTask("");
|
|
371
|
-
await loadTasks();
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
if (status === "connecting") return <div>Connecting...</div>;
|
|
375
|
-
if (error) return <div>Error: {error.message}</div>;
|
|
376
|
-
|
|
377
|
-
return (
|
|
378
|
-
<div className="p-4">
|
|
379
|
-
<h1 className="text-2xl font-bold mb-4">Task Manager</h1>
|
|
380
|
-
|
|
381
|
-
<div className="flex gap-2 mb-4">
|
|
382
|
-
<input
|
|
383
|
-
type="text"
|
|
384
|
-
value={newTask}
|
|
385
|
-
onChange={(e) => setNewTask(e.target.value)}
|
|
386
|
-
placeholder="Add a new task..."
|
|
387
|
-
className="flex-1 p-2 border rounded"
|
|
388
|
-
/>
|
|
389
|
-
<button
|
|
390
|
-
onClick={addTask}
|
|
391
|
-
className="px-4 py-2 bg-blue-500 text-white rounded"
|
|
392
|
-
>
|
|
393
|
-
Add Task
|
|
394
|
-
</button>
|
|
395
|
-
</div>
|
|
396
|
-
|
|
397
|
-
<ul className="space-y-2">
|
|
398
|
-
{tasks.map((task) => (
|
|
399
|
-
<li key={task.id} className="p-2 border rounded">
|
|
400
|
-
{task.title}
|
|
401
|
-
</li>
|
|
402
|
-
))}
|
|
403
|
-
</ul>
|
|
404
|
-
</div>
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
This widget will be available at `http://localhost:3000/widgets/task-manager` after building.
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
|
-
## 🔧 Configuration
|
|
414
|
-
|
|
415
|
-
### TypeScript Configuration
|
|
416
|
-
|
|
417
|
-
Ensure your `tsconfig.json` includes:
|
|
418
|
-
|
|
419
|
-
```json
|
|
420
|
-
{
|
|
421
|
-
"compilerOptions": {
|
|
422
|
-
"target": "ES2020",
|
|
423
|
-
"module": "ESNext",
|
|
424
|
-
"jsx": "react-jsx",
|
|
425
|
-
"esModuleInterop": true,
|
|
426
|
-
"skipLibCheck": true,
|
|
427
|
-
"strict": true,
|
|
428
|
-
"outDir": "./dist",
|
|
429
|
-
"rootDir": "./src"
|
|
430
|
-
},
|
|
431
|
-
"include": ["src/**/*", "resources/**/*"]
|
|
432
|
-
}
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
### Package.json Scripts
|
|
436
|
-
|
|
437
|
-
Add these scripts for convenience:
|
|
438
|
-
|
|
439
|
-
```json
|
|
440
|
-
{
|
|
441
|
-
"scripts": {
|
|
442
|
-
"dev": "mcp-use dev",
|
|
443
|
-
"build": "mcp-use build",
|
|
444
|
-
"start": "mcp-use start",
|
|
445
|
-
"serve": "npm run build && npm run start"
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
---
|
|
451
|
-
|
|
452
|
-
## 🚀 Advanced Usage
|
|
453
|
-
|
|
454
|
-
### Environment Variables
|
|
455
|
-
|
|
456
|
-
#### Development & Build
|
|
457
|
-
|
|
458
|
-
```bash
|
|
459
|
-
# Custom port via environment variable
|
|
460
|
-
PORT=8080 mcp-use dev
|
|
461
|
-
|
|
462
|
-
# Production build with custom output
|
|
463
|
-
BUILD_DIR=./build mcp-use build
|
|
464
|
-
|
|
465
|
-
# Custom MCP URL for widget asset paths
|
|
466
|
-
MCP_URL=https://myserver.com mcp-use build
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
#### Deployment & Cloud
|
|
470
|
-
|
|
471
|
-
For deploying to Manufact cloud, see the environment variables in this section for detailed configuration:
|
|
472
|
-
|
|
473
|
-
```bash
|
|
474
|
-
# Frontend URL (where /auth/cli page is)
|
|
475
|
-
MCP_WEB_URL=https://mcp-use.com
|
|
476
|
-
|
|
477
|
-
# Backend API URL (where /api/v1 endpoints are)
|
|
478
|
-
MCP_API_URL=https://cloud.manufact.com
|
|
479
|
-
|
|
480
|
-
# Example: Local development
|
|
481
|
-
export MCP_WEB_URL=http://localhost:3000
|
|
482
|
-
export MCP_API_URL=http://localhost:8000
|
|
483
|
-
mcp-use login
|
|
484
|
-
mcp-use deploy
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
See the [CLI reference docs](https://docs.mcp-use.com/typescript/server/cli-reference#environment-variables) for more examples and configuration options.
|
|
488
|
-
|
|
489
|
-
### Docker Deployment
|
|
490
|
-
|
|
491
|
-
```dockerfile
|
|
492
|
-
# Dockerfile
|
|
493
|
-
FROM node:20-alpine
|
|
494
|
-
WORKDIR /app
|
|
495
|
-
COPY package*.json ./
|
|
496
|
-
RUN npm ci --production
|
|
497
|
-
COPY . .
|
|
498
|
-
RUN npm run build
|
|
499
|
-
EXPOSE 3000
|
|
500
|
-
CMD ["npm", "start"]
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
### Serving Built Widgets
|
|
504
|
-
|
|
505
|
-
You can serve the built widgets from any Hono app using `serveStatic`:
|
|
506
|
-
|
|
507
|
-
```ts
|
|
508
|
-
import { Hono } from "hono";
|
|
509
|
-
import { serveStatic } from "hono/node-server/serve-static";
|
|
510
|
-
|
|
511
|
-
const app = new Hono();
|
|
512
|
-
|
|
513
|
-
// Serve MCP widgets
|
|
514
|
-
app.use(
|
|
515
|
-
"/widgets/*",
|
|
516
|
-
serveStatic({ root: "./dist/resources/mcp-use/widgets" })
|
|
517
|
-
);
|
|
518
|
-
|
|
519
|
-
// Your other routes...
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
---
|
|
523
|
-
|
|
524
|
-
## 🐛 Troubleshooting
|
|
525
|
-
|
|
526
|
-
### Common Issues
|
|
527
|
-
|
|
528
|
-
**Port already in use:**
|
|
529
|
-
|
|
530
|
-
```bash
|
|
531
|
-
# Use a different port
|
|
532
|
-
mcp-use dev --port 3001
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
**TypeScript compilation errors:**
|
|
536
|
-
|
|
537
|
-
```bash
|
|
538
|
-
# Check your tsconfig.json
|
|
539
|
-
# Ensure all dependencies are installed
|
|
540
|
-
npm install
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
**Widgets not loading:**
|
|
544
|
-
|
|
545
|
-
- Ensure `.tsx` files are in the `resources/` directory
|
|
546
|
-
- Check that React dependencies are installed
|
|
547
|
-
- Verify the build output in `dist/resources/mcp-use/widgets/`
|
|
548
|
-
|
|
549
|
-
**Inspector not opening:**
|
|
550
|
-
|
|
551
|
-
```bash
|
|
552
|
-
# Manually open http://localhost:3000/inspector
|
|
553
|
-
# Or disable auto-open
|
|
554
|
-
mcp-use dev --no-open
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
---
|
|
558
|
-
|
|
559
|
-
## 📚 Learn More
|
|
560
|
-
|
|
561
|
-
- [mcp-use Documentation](https://github.com/mcp-use/mcp-use)
|
|
562
|
-
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
563
|
-
- [Creating MCP Servers](https://github.com/mcp-use/mcp-use/tree/main/libraries/typescript/packages/mcp-use#-mcp-server-framework)
|
|
564
|
-
- [MCP Inspector Guide](https://github.com/mcp-use/mcp-use/tree/main/libraries/typescript/packages/inspector)
|
|
565
|
-
|
|
566
|
-
---
|
|
567
|
-
|
|
568
|
-
## 📜 License
|
|
569
|
-
|
|
570
|
-
MIT © [mcp-use](https://github.com/mcp-use)
|
package/dist/commands/auth.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { OrgInfo } from "../utils/api.js";
|
|
2
|
-
/**
|
|
3
|
-
* Resolve an org identifier (slug, id, or case-insensitive name) against a list.
|
|
4
|
-
* Returns null if no match.
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolveOrgFromOption(orgs: OrgInfo[], identifier: string): OrgInfo | null;
|
|
7
|
-
/**
|
|
8
|
-
* Prompt user to pick an organization from a numbered list.
|
|
9
|
-
*/
|
|
10
|
-
export declare function promptOrgSelection(orgs: OrgInfo[], defaultOrgId?: string | null): Promise<OrgInfo | null>;
|
|
11
|
-
/**
|
|
12
|
-
* Login command using OAuth 2.0 Device Authorization Grant (RFC 8628).
|
|
13
|
-
*/
|
|
14
|
-
export declare function loginCommand(options?: {
|
|
15
|
-
silent?: boolean;
|
|
16
|
-
apiKey?: string;
|
|
17
|
-
org?: string;
|
|
18
|
-
/**
|
|
19
|
-
* A pre-approved OAuth device code (RFC 8628). When provided, skip requesting
|
|
20
|
-
* a new code + opening a browser and poll the token endpoint directly. Used by
|
|
21
|
-
* the web onboarding flow, which creates and approves the code, then embeds it
|
|
22
|
-
* in the agent's prompt.
|
|
23
|
-
*/
|
|
24
|
-
deviceCode?: string;
|
|
25
|
-
}): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Logout command - revokes API key and deletes config
|
|
28
|
-
*/
|
|
29
|
-
export declare function logoutCommand(): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Whoami command - shows current user info
|
|
32
|
-
*/
|
|
33
|
-
export declare function whoamiCommand(): Promise<void>;
|
|
34
|
-
//# sourceMappingURL=auth.d.ts.map
|