This commit is contained in:
lidongjie committed 2025-07-25 22:46:19 +08:00
commit f108551780
11 files changed
+62 -22

No files matched your search

+2 -2
View File
@@ -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
```
支持系统包括:
+2 -2
View File
@@ -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
```
<br>
@@ -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
```
<details>
+4
View File
@@ -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_MCP_URL || "http://127.0.0.1:8002"}/mcp/:path*`,
},
];
},
@@ -66,9 +66,9 @@ export const BasicInfoTab: React.FC<BasicInfoTabProps> = ({
onInputChange('auth_token', '');
}}
>
<SelectItem key="none" value="none">{t('None')}</SelectItem>
<SelectItem key="apikey" value="apikey">{t('API Key')}</SelectItem>
<SelectItem key="bearer-token" value="bearer-token">{t('Bearer Token')}</SelectItem>
<SelectItem key="none" value={AuthMethod.None}>{t('None')}</SelectItem>
<SelectItem key="apikey" value={AuthMethod.APIKey}>{t('API Key')}</SelectItem>
<SelectItem key="token" value={AuthMethod.BearerToken}>{t('Bearer Token')}</SelectItem>
</Select>
{/* auth config input fields */}
@@ -27,10 +27,33 @@ export const ProductDetailThemeSelector: React.FC<
const { platformConfig } = usePlatformConfig();
const currentTheme = platformConfig.theme || Theme.DEFAULT;
const [url, setUrl] = useState<string>(process.env.NEXT_PUBLIC_MCP_URL || "");
const [mcpName, setMcpName] = useState<string>("");
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<
<div className="min-h-screen bg-background flex flex-col justify-between">
<Navigation items={NavigationItems} />
<main className="flex-1">
<ProductDetailClient product={product} />
<ProductDetailClient product={product} mcpName={mcpName} />
</main>
<div>
<Footer />
@@ -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<DetailProps> = ({
product,
breadcrumbs,
url,
mcpName,
navItems = [],
}) => {
const { t } = useTranslation();
@@ -220,7 +221,7 @@ export const Detail: React.FC<DetailProps> = ({
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"xpack-mcp-market": {
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
@@ -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<DetailProps> = ({
product,
breadcrumbs,
url,
mcpName,
navItems = [],
}) => {
const { t } = useTranslation();
@@ -154,7 +155,7 @@ export const Detail: React.FC<DetailProps> = ({
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"xpack-mcp-market": {
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
@@ -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<DetailProps> = ({
product,
breadcrumbs,
url,
mcpName,
navItems = [],
}) => {
const { t } = useTranslation();
@@ -148,7 +149,7 @@ export const Detail: React.FC<DetailProps> = ({
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"xpack-mcp-market": {
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
@@ -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<DetailProps> = ({
product,
breadcrumbs,
url,
mcpName,
navItems = [],
}) => {
const { t } = useTranslation();
@@ -169,7 +170,7 @@ export const Detail: React.FC<DetailProps> = ({
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"xpack-mcp-market": {
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
@@ -16,11 +16,13 @@ interface ProductDetailClientProps {
link: string;
name: string
}[];
mcpName?: string;
}
export const ProductDetailClient: React.FC<ProductDetailClientProps> = ({
product,
breadcrumbs
breadcrumbs,
mcpName
}) => {
const { t } = useTranslation();
@@ -56,7 +58,7 @@ export const ProductDetailClient: React.FC<ProductDetailClientProps> = ({
</div>
{/* Right side - Server Config */}
<ServerConfig product={product} />
<ServerConfig product={product} mcpName={mcpName} />
</div>
{/* SEO-friendly: Simple text content for search engines */}
@@ -10,18 +10,21 @@ import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
interface ServerConfigProps {
product: ServiceData;
mcpName?: string;
}
export const ServerConfig: React.FC<ServerConfigProps> = ({ product }) => {
export const ServerConfig: React.FC<ServerConfigProps> = ({ product, mcpName }) => {
const { t } = useTranslation();
const { handleLogin } = useAuth();
const { platformConfig } = usePlatformConfig();
const [url, setUrl] = useState<string>(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 (
<div className="min-w-[400px] w-[40%] max-w-100 flex-shrink-0 mt-12">
<div className="mb-4 mt-1">
@@ -42,7 +45,7 @@ export const ServerConfig: React.FC<ServerConfigProps> = ({ product }) => {
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"xpack-mcp-market": {
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
@@ -57,4 +60,4 @@ export const ServerConfig: React.FC<ServerConfigProps> = ({ product }) => {
</Card>
</div>
);
};
};