From fdfe2c63bc65299fcce40f8d719a0ea8f84be3f6 Mon Sep 17 00:00:00 2001 From: riverLethe <865192079@qq.com> Date: Fri, 25 Jul 2025 22:03:12 +0800 Subject: [PATCH 1/5] feat/mcp server change mcp name and fix mcp server can not set bearer token bug --- .../components/mcp-services/BasicInfoTab.tsx | 6 ++-- .../theme/ProductDetailThemeSelector.tsx | 29 ++++++++++++++++++- .../src/components/theme/classic/Detail.tsx | 5 ++-- .../src/components/theme/creative/Detail.tsx | 5 ++-- .../src/components/theme/modern/Detail.tsx | 5 ++-- frontend/src/components/theme/temu/Detail.tsx | 5 ++-- .../components/marketplace/ProductDetail.tsx | 6 ++-- .../components/marketplace/ServerConfig.tsx | 11 ++++--- 8 files changed, 54 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/mcp-services/BasicInfoTab.tsx b/frontend/src/components/mcp-services/BasicInfoTab.tsx index b871b35..c5d2bab 100644 --- a/frontend/src/components/mcp-services/BasicInfoTab.tsx +++ b/frontend/src/components/mcp-services/BasicInfoTab.tsx @@ -66,9 +66,9 @@ export const BasicInfoTab: React.FC = ({ onInputChange('auth_token', ''); }} > - {t('None')} - {t('API Key')} - {t('Bearer Token')} + {t('None')} + {t('API Key')} + {t('Bearer Token')} {/* auth config input fields */} diff --git a/frontend/src/components/theme/ProductDetailThemeSelector.tsx b/frontend/src/components/theme/ProductDetailThemeSelector.tsx index f7bda2f..67e54ce 100644 --- a/frontend/src/components/theme/ProductDetailThemeSelector.tsx +++ b/frontend/src/components/theme/ProductDetailThemeSelector.tsx @@ -27,10 +27,33 @@ export const ProductDetailThemeSelector: React.FC< const { platformConfig } = usePlatformConfig(); const currentTheme = platformConfig.theme || Theme.DEFAULT; const [url, setUrl] = useState(process.env.NEXT_PUBLIC_MCP_URL || ""); + const [mcpName, setMcpName] = useState(""); useEffect(() => { if (url || !product.slug_name) return; setUrl(`${window.location.origin}/mcp/${product.slug_name}`); }, [product.slug_name]); + function sanitizeMCPServerName(rawName: string | undefined): string { + if (!rawName) return "xpack-mcp-service"; + + // Lower-case & replace invalid chars with hyphen + let name = rawName + .trim() + .toLowerCase() + .replace(/[^a-z0-9-_]+/g, "-"); + + // Collapse multiple hyphens + name = name.replace(/-+/g, "-"); + + // Trim leading/trailing hyphens + name = name.replace(/^-+/, "").replace(/-+$/, ""); + + + return name || "mcp-service"; + } + useEffect(() => { + setMcpName(sanitizeMCPServerName(platformConfig.name)); + }, [platformConfig.name]); + //Render the About page based on the current theme switch (currentTheme) { @@ -41,6 +64,7 @@ export const ProductDetailThemeSelector: React.FC< breadcrumbs={breadcrumbs} url={url} navItems={NavigationItems} + mcpName={mcpName} /> ); case Theme.CLASSIC: @@ -50,6 +74,7 @@ export const ProductDetailThemeSelector: React.FC< breadcrumbs={breadcrumbs} url={url} navItems={NavigationItems} + mcpName={mcpName} /> ); case Theme.CREATIVE: @@ -59,6 +84,7 @@ export const ProductDetailThemeSelector: React.FC< breadcrumbs={breadcrumbs} url={url} navItems={NavigationItems} + mcpName={mcpName} /> ); case Theme.TEMU: @@ -68,6 +94,7 @@ export const ProductDetailThemeSelector: React.FC< breadcrumbs={breadcrumbs} url={url} navItems={NavigationItems} + mcpName={mcpName} /> ); case Theme.DEFAULT: @@ -76,7 +103,7 @@ export const ProductDetailThemeSelector: React.FC<
- +
diff --git a/frontend/src/components/theme/classic/Detail.tsx b/frontend/src/components/theme/classic/Detail.tsx index 89ed318..73c9e5f 100644 --- a/frontend/src/components/theme/classic/Detail.tsx +++ b/frontend/src/components/theme/classic/Detail.tsx @@ -21,7 +21,7 @@ interface DetailProps { name: string; }[]; url?: string; - + mcpName?: string; // navigation items navItems?: NavigationItem[]; } @@ -30,6 +30,7 @@ export const Detail: React.FC = ({ product, breadcrumbs, url, + mcpName, navItems = [], }) => { const { t } = useTranslation(); @@ -220,7 +221,7 @@ export const Detail: React.FC = ({ {`{ "mcpServers": { - "xpack-mcp-market": { + "${mcpName || "xpack-mcp-market"}": { "type": "sse", "autoApprove":"all", "url": "${url}?apikey=`} diff --git a/frontend/src/components/theme/creative/Detail.tsx b/frontend/src/components/theme/creative/Detail.tsx index 0e52d67..71af15c 100644 --- a/frontend/src/components/theme/creative/Detail.tsx +++ b/frontend/src/components/theme/creative/Detail.tsx @@ -21,7 +21,7 @@ interface DetailProps { name: string; }[]; url?: string; - + mcpName?: string; // navigation items navItems?: NavigationItem[]; } @@ -30,6 +30,7 @@ export const Detail: React.FC = ({ product, breadcrumbs, url, + mcpName, navItems = [], }) => { const { t } = useTranslation(); @@ -154,7 +155,7 @@ export const Detail: React.FC = ({ {`{ "mcpServers": { - "xpack-mcp-market": { + "${mcpName || "xpack-mcp-market"}": { "type": "sse", "autoApprove":"all", "url": "${url}?apikey=`} diff --git a/frontend/src/components/theme/modern/Detail.tsx b/frontend/src/components/theme/modern/Detail.tsx index b9e2cef..b7ff790 100644 --- a/frontend/src/components/theme/modern/Detail.tsx +++ b/frontend/src/components/theme/modern/Detail.tsx @@ -21,7 +21,7 @@ interface DetailProps { name: string; }[]; url?: string; - + mcpName?: string; // navigation items navItems?: NavigationItem[]; } @@ -30,6 +30,7 @@ export const Detail: React.FC = ({ product, breadcrumbs, url, + mcpName, navItems = [], }) => { const { t } = useTranslation(); @@ -148,7 +149,7 @@ export const Detail: React.FC = ({ {`{ "mcpServers": { - "xpack-mcp-market": { + "${mcpName || "xpack-mcp-market"}": { "type": "sse", "autoApprove":"all", "url": "${url}?apikey=`} diff --git a/frontend/src/components/theme/temu/Detail.tsx b/frontend/src/components/theme/temu/Detail.tsx index fca8e7a..e8ad3ba 100644 --- a/frontend/src/components/theme/temu/Detail.tsx +++ b/frontend/src/components/theme/temu/Detail.tsx @@ -21,7 +21,7 @@ interface DetailProps { name: string; }[]; url?: string; - + mcpName?: string; // navigation items navItems?: NavigationItem[]; } @@ -30,6 +30,7 @@ export const Detail: React.FC = ({ product, breadcrumbs, url, + mcpName, navItems = [], }) => { const { t } = useTranslation(); @@ -169,7 +170,7 @@ export const Detail: React.FC = ({ {`{ "mcpServers": { - "xpack-mcp-market": { + "${mcpName || "xpack-mcp-market"}": { "type": "sse", "autoApprove":"all", "url": "${url}?apikey=`} diff --git a/frontend/src/shared/components/marketplace/ProductDetail.tsx b/frontend/src/shared/components/marketplace/ProductDetail.tsx index 06ce3a6..347bbfb 100644 --- a/frontend/src/shared/components/marketplace/ProductDetail.tsx +++ b/frontend/src/shared/components/marketplace/ProductDetail.tsx @@ -16,11 +16,13 @@ interface ProductDetailClientProps { link: string; name: string }[]; + mcpName?: string; } export const ProductDetailClient: React.FC = ({ product, - breadcrumbs + breadcrumbs, + mcpName }) => { const { t } = useTranslation(); @@ -56,7 +58,7 @@ export const ProductDetailClient: React.FC = ({
{/* Right side - Server Config */} - +
{/* SEO-friendly: Simple text content for search engines */} diff --git a/frontend/src/shared/components/marketplace/ServerConfig.tsx b/frontend/src/shared/components/marketplace/ServerConfig.tsx index bf45b11..f443b32 100644 --- a/frontend/src/shared/components/marketplace/ServerConfig.tsx +++ b/frontend/src/shared/components/marketplace/ServerConfig.tsx @@ -10,18 +10,21 @@ import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext"; interface ServerConfigProps { product: ServiceData; + mcpName?: string; } -export const ServerConfig: React.FC = ({ product }) => { +export const ServerConfig: React.FC = ({ product, mcpName }) => { + const { t } = useTranslation(); const { handleLogin } = useAuth(); const { platformConfig } = usePlatformConfig(); const [url, setUrl] = useState(process.env.NEXT_PUBLIC_MCP_URL || ""); useEffect(() => { - if (url || !product.slug_name) return; + if (url || !product.slug_name) return setUrl(`${window.location.origin}/mcp/${product.slug_name}`); }, [product.slug_name]); + return (
@@ -42,7 +45,7 @@ export const ServerConfig: React.FC = ({ product }) => { {`{ "mcpServers": { - "xpack-mcp-market": { + "${mcpName || "xpack-mcp-market"}": { "type": "sse", "autoApprove":"all", "url": "${url}?apikey=`} @@ -57,4 +60,4 @@ export const ServerConfig: React.FC = ({ product }) => {
); -}; +}; \ No newline at end of file From 7985c6ae2ba50dd4c3a06ee2ccdf8f6b8f6c8f2b Mon Sep 17 00:00:00 2001 From: JackLiu Date: Fri, 25 Jul 2025 22:18:09 +0800 Subject: [PATCH 2/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 732f5b3..e30188a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Everything is open-source and licensed under **Apache 2.0** — ready for commer 😍 Deploying XPack is incredibly simple. With just one command line, you can deploy your MCP Market in 10 minutes. ```bash -curl -sSO http://xpack.ai/install/quick-start.sh; bash quick-start.sh +curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh ```
@@ -83,7 +83,7 @@ Ensure these services are available and properly configured before running the b 😍 Deploying XPack is incredibly simple. With just one command line, you can deploy your MCP Market in 10 minutes. ```bash -curl -sSO http://xpack.ai/install/quick-start.sh; bash quick-start.sh +curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh ```
From e1fdbdd026e7d2dd4d550163ff4979aeaa977389 Mon Sep 17 00:00:00 2001 From: JackLiu Date: Fri, 25 Jul 2025 22:18:42 +0800 Subject: [PATCH 3/5] Update README-zh-cn.md --- README-zh-cn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh-cn.md b/README-zh-cn.md index d98e627..9071350 100644 --- a/README-zh-cn.md +++ b/README-zh-cn.md @@ -30,7 +30,7 @@ 😍 只需一行命令,即可在 10 分钟内部署你的 MCP 服务市场: ```bash -curl -sSO http://xpack.ai/install/quick-start.sh; bash quick-start.sh +curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh ``` 该脚本会自动安装 MySQL、Redis、RabbitMQ,并启动 XPack 服务。 @@ -83,7 +83,7 @@ XPack-MCP-Market 依赖以下服务(可容器化或自行安装): ### 🟢 快速部署命令 ```bash -curl -sSO http://xpack.ai/install/quick-start.sh; bash quick-start.sh +curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh ``` 支持系统包括: From b548f2494d81cba6cc1427144d69c81288ac78a9 Mon Sep 17 00:00:00 2001 From: riverLethe <865192079@qq.com> Date: Fri, 25 Jul 2025 22:25:47 +0800 Subject: [PATCH 4/5] feat/ui:add /mcp url rewrite rule --- frontend/next.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/next.config.js b/frontend/next.config.js index cda7e23..5b80890 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -29,6 +29,10 @@ const nextConfig = { source: "/uploads/:path*", destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/uploads/:path*`, }, + { + source: "/mcp/:path*", + destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/mcp/:path*`, + }, ]; }, From 2eb02bb70fe0f042eb60252aa2faef2f9f0c8f73 Mon Sep 17 00:00:00 2001 From: riverLethe <865192079@qq.com> Date: Fri, 25 Jul 2025 22:39:27 +0800 Subject: [PATCH 5/5] fix/op:change op rewrite port to 8002 --- frontend/next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index 5b80890..fa334c9 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -31,7 +31,7 @@ const nextConfig = { }, { source: "/mcp/:path*", - destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/mcp/:path*`, + destination: `${process.env.NEXT_PUBLIC_MCP_URL || "http://127.0.0.1:8002"}/mcp/:path*`, }, ]; },