feat/mcp server change mcp name and fix mcp server can not set bearer token bug

This commit is contained in:
riverLethe committed 2025-07-25 22:03:37 +08:00
1 parent 224a209fea
commit fdfe2c63bc
8 files changed
+54 -18

No files matched your search

@@ -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>
);
};
};