create-mcp-use-app 2.0.0-beta.12 → 2.0.0-beta.14

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.js CHANGED
@@ -1532,18 +1532,6 @@ function renderLogo() {
1532
1532
  var packageJson = JSON.parse(
1533
1533
  readFileSync2(join3(__dirname, "../package.json"), "utf-8")
1534
1534
  );
1535
- var DEFAULT_MCP_USE_VERSION = "2.0.0-beta.36";
1536
- function getCurrentPackageVersions(isDevelopment = false, sdkVersion) {
1537
- if (isDevelopment) {
1538
- return {
1539
- "mcp-use": "workspace:*"
1540
- };
1541
- }
1542
- const requestedSdk = sdkVersion ?? DEFAULT_MCP_USE_VERSION;
1543
- return {
1544
- "mcp-use": requestedSdk
1545
- };
1546
- }
1547
1535
  function processTemplateFile(filePath, versions, isDevelopment = false) {
1548
1536
  const content = readFileSync2(filePath, "utf-8");
1549
1537
  let processedContent = content;
@@ -1554,7 +1542,7 @@ function processTemplateFile(filePath, versions, isDevelopment = false) {
1554
1542
  version
1555
1543
  );
1556
1544
  }
1557
- const mcpUseVersion = isDevelopment ? "workspace:*" : versions["mcp-use"] || DEFAULT_MCP_USE_VERSION;
1545
+ const mcpUseVersion = isDevelopment ? "workspace:*" : versions["mcp-use"];
1558
1546
  if (isDevelopment) {
1559
1547
  processedContent = processedContent.replace(
1560
1548
  /"mcp-use": "\^[^"]+"/,
@@ -2027,11 +2015,35 @@ async function main() {
2027
2015
  );
2028
2016
  process.exit(1);
2029
2017
  }
2018
+ }
2019
+ let mcpUseVersion;
2020
+ if (options.dev) {
2021
+ mcpUseVersion = "workspace:*";
2022
+ } else if (options.sdkVersion) {
2023
+ mcpUseVersion = options.sdkVersion;
2024
+ } else {
2025
+ const response = await fetch("https://registry.npmjs.org/mcp-use", {
2026
+ headers: { Accept: "application/vnd.npm.install-v1+json" },
2027
+ signal: AbortSignal.timeout(1e4)
2028
+ });
2029
+ if (!response.ok) {
2030
+ throw new Error(
2031
+ `Failed to resolve the mcp-use beta dist-tag from npm (${response.status})`
2032
+ );
2033
+ }
2034
+ const metadata = await response.json();
2035
+ const betaVersion = metadata["dist-tags"]?.beta;
2036
+ if (!betaVersion) {
2037
+ throw new Error("npm did not return a beta version for mcp-use");
2038
+ }
2039
+ mcpUseVersion = betaVersion;
2040
+ }
2041
+ const versions = { "mcp-use": mcpUseVersion };
2042
+ if (!useCurrentDir) {
2030
2043
  mkdirSync(projectPath, { recursive: true });
2031
2044
  }
2032
2045
  console.log(cyan(`\u{1F680} Creating MCP server "${displayName}"...`));
2033
2046
  const validatedTemplate = validateTemplateName(selectedTemplate);
2034
- const versions = getCurrentPackageVersions(options.dev, options.sdkVersion);
2035
2047
  await copyTemplate(projectPath, validatedTemplate, versions, options.dev);
2036
2048
  updatePackageJson(projectPath, packageName);
2037
2049
  updateIndexTs(projectPath, packageName);
@@ -31,23 +31,6 @@ export function PipIcon() {
31
31
  );
32
32
  }
33
33
 
34
- export function CloseIcon() {
35
- return (
36
- <svg
37
- width="14"
38
- height="14"
39
- viewBox="0 0 24 24"
40
- fill="none"
41
- stroke="currentColor"
42
- strokeWidth="2"
43
- aria-hidden
44
- >
45
- <line x1="18" y1="6" x2="6" y2="18" />
46
- <line x1="6" y1="6" x2="18" y2="18" />
47
- </svg>
48
- );
49
- }
50
-
51
34
  export function SunIcon() {
52
35
  return (
53
36
  <svg
@@ -16,7 +16,6 @@ import { useState } from "react";
16
16
  import { z } from "zod";
17
17
 
18
18
  import {
19
- CloseIcon,
20
19
  ExpandIcon,
21
20
  ExternalLinkIcon,
22
21
  MonitorIcon,
@@ -124,65 +123,47 @@ export default function McpApp() {
124
123
  </span>
125
124
  </Tooltip>
126
125
  </div>
127
- <div className="flex items-center gap-2">
128
- {!isFullscreen && !isPip && (
129
- <>
130
- {availableDisplayModes.includes("pip") && (
131
- <Tooltip
132
- label="MCP Apps display mode: picture-in-picture"
133
- multiline
126
+ {!isPip && (
127
+ <div className="flex items-center gap-2">
128
+ {availableDisplayModes.includes("pip") && (
129
+ <Tooltip
130
+ label="MCP Apps display mode: picture-in-picture"
131
+ multiline
132
+ >
133
+ <button
134
+ type="button"
135
+ className="cursor-pointer rounded-full border border-neutral-300 p-2 text-neutral-900 transition-colors hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-100 dark:hover:bg-neutral-800"
136
+ aria-label="Picture-in-picture"
137
+ onClick={() => void requestDisplayMode({ mode: "pip" })}
134
138
  >
135
- <button
136
- type="button"
137
- className="cursor-pointer rounded-full border border-neutral-300 p-2 text-neutral-900 transition-colors hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-100 dark:hover:bg-neutral-800"
138
- aria-label="Picture-in-picture"
139
- onClick={() => void requestDisplayMode({ mode: "pip" })}
140
- >
141
- <PipIcon />
142
- </button>
143
- </Tooltip>
144
- )}
145
- {availableDisplayModes.includes("fullscreen") && (
146
- <Tooltip
147
- label="MCP Apps display mode: fullscreen"
148
- multiline
139
+ <PipIcon />
140
+ </button>
141
+ </Tooltip>
142
+ )}
143
+ {availableDisplayModes.includes("fullscreen") && (
144
+ <Tooltip label="MCP Apps display mode: fullscreen" multiline>
145
+ <button
146
+ type="button"
147
+ className="cursor-pointer rounded-full border border-neutral-300 p-2 text-neutral-900 transition-colors hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-100 dark:hover:bg-neutral-800"
148
+ aria-label="Fullscreen"
149
+ onClick={() =>
150
+ void requestDisplayMode({ mode: "fullscreen" })
151
+ }
149
152
  >
150
- <button
151
- type="button"
152
- className="cursor-pointer rounded-full border border-neutral-300 p-2 text-neutral-900 transition-colors hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-100 dark:hover:bg-neutral-800"
153
- aria-label="Fullscreen"
154
- onClick={() =>
155
- void requestDisplayMode({ mode: "fullscreen" })
156
- }
157
- >
158
- <ExpandIcon />
159
- </button>
160
- </Tooltip>
161
- )}
162
- </>
163
- )}
164
- {(isFullscreen || isPip) && (
165
- <Tooltip
166
- label="MCP Apps display mode: return to inline"
167
- multiline
168
- >
169
- <button
170
- type="button"
171
- className="cursor-pointer rounded-full border border-neutral-300 p-2 text-neutral-900 transition-colors hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-100 dark:hover:bg-neutral-800"
172
- aria-label="Exit"
173
- onClick={() => void requestDisplayMode({ mode: "inline" })}
174
- >
175
- <CloseIcon />
176
- </button>
177
- </Tooltip>
178
- )}
179
- </div>
153
+ <ExpandIcon />
154
+ </button>
155
+ </Tooltip>
156
+ )}
157
+ </div>
158
+ )}
180
159
  </div>
181
160
  )}
182
161
  {!isMobile && (
183
162
  <button
184
163
  type="button"
185
- className="absolute bottom-6 left-1/2 z-20 flex -translate-x-1/2 cursor-pointer flex-col items-center gap-1 border-0 bg-transparent p-0 text-neutral-900 transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50"
164
+ className={`absolute left-1/2 z-20 flex -translate-x-1/2 cursor-pointer flex-col items-center gap-1 border-0 bg-transparent p-0 text-neutral-900 transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50 ${
165
+ isFullscreen ? "top-6" : "bottom-6"
166
+ }`}
186
167
  disabled={!canOpenExternal}
187
168
  title="mcp-use on GitHub"
188
169
  onClick={() =>
@@ -202,7 +183,7 @@ export default function McpApp() {
202
183
  <div
203
184
  className={`relative z-10 flex flex-col items-center text-center ${
204
185
  isFullscreen
205
- ? "min-h-0 flex-1 justify-center overflow-y-auto px-6 py-8"
186
+ ? "min-h-0 flex-1 justify-center overflow-y-auto px-6 pt-24 pb-8"
206
187
  : isMobile
207
188
  ? "px-6 py-10"
208
189
  : "min-h-[400px] px-8 py-8 pb-16 sm:min-h-[440px] sm:px-10 sm:py-10 sm:pb-16"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mcp-use-app",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.14",
4
4
  "type": "module",
5
5
  "description": "Create MCP-Use apps with one command",
6
6
  "author": "mcp-use, Inc.",