Skip to content

Commit 1e99900

Browse files
committed
fix: Always clear cache when on MCP page to help with redirect issues
1 parent bfdb768 commit 1e99900

File tree

2 files changed

+26
-2
lines changed
  • apify-docs-theme/src/theme/Layout
  • sources/platform/integrations/ai

2 files changed

+26
-2
lines changed

apify-docs-theme/src/theme/Layout/index.jsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@ import { useLocation } from '@docusaurus/router';
44
import Layout from '@docusaurus/theme-classic/lib/theme/Layout/index';
55
import useBaseUrl from '@docusaurus/useBaseUrl';
66
import { usePluginData } from '@docusaurus/useGlobalData';
7-
import React from 'react';
7+
import React, { useEffect } from 'react';
88

99
export default function LayoutWrapper(props) {
1010
const { options: { subNavbar } } = usePluginData('@apify/docs-theme');
1111
const baseUrl = useBaseUrl('/');
1212
const currentPath = useLocation().pathname.replace(new RegExp(`^${baseUrl}`), '');
1313

14+
// Silent cache busting for mcp.apify.com redirects
15+
useEffect(() => {
16+
// Only run on the MCP documentation page
17+
if (currentPath.includes('integrations/mcp')) {
18+
// Always clear cache when on MCP page to help with redirect issues.
19+
// Background: Previously, mcp.apify.com had a 301 redirect to this docs page, which was wrong.
20+
// Many users have this redirect cached in their browsers, so they can't access the new MCP UI.
21+
// This helps with their cached redirect, allowing them to access mcp.apify.com
22+
fetch('https://mcp.apify.com/', { method: 'get', cache: 'reload' }).then(() => {
23+
console.log('MCP cache cleared successfully');
24+
}).catch((error) => {
25+
console.warn('Failed to clear MCP cache:', error);
26+
});
27+
}
28+
}, [currentPath]);
29+
1430
return (
1531
<>
1632
<Head>

sources/platform/integrations/ai/mcp.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ slug: /integrations/mcp
88

99
<!-- markdownlint-disable MD024 -->
1010

11-
The _Apify Model Context Protocol (MCP) Server_ allows AI applications to connect to Apify’s extensive library of Actors as tools to perform web scraping, data extraction, or other automation tasks in real time.
11+
12+
13+
The _Apify Model Context Protocol (MCP) Server_ allows AI applications to connect to Apify's extensive library of Actors as tools to perform web scraping, data extraction, or other automation tasks in real time.
14+
15+
:::tip Configure MCP Server
16+
17+
Configure Apify MCP server at [mcp.apify.com](https://mcp.apify.com), select Actors and tools and copy configuration to your MCP client.
18+
19+
:::
1220

1321
![Apify MCP Server](../../images/apify_mcp_server.png)
1422

0 commit comments

Comments
 (0)