feat/mcp server change mcp name and fix mcp server can not set bearer token bug
This commit is contained in:
1 parent
224a209fea
commit
fdfe2c63bc
8 files changed
+54
-18
No files matched your search
@@ -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>
|
||||
);
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user