Skip to content

Commit 903acbb

Browse files
jirispilkaTC-MO
authored andcommitted
fix: Always clear cache when on MCP page to help with redirect issue (apify#1801)
Always clear cache when on MCP page to help with redirect issues. Previously, mcp.apify.com had a 301 redirect to this docs page, which was wrong. Many users have this redirect cached in their browsers, so they can't access the new MCP UI. This helps with their cached redirect, allowing them to access mcp.apify.com @B4nan is there is a better place to put the code than in the src/theme/layout? Kudos to @JJetmar FYI @MQ37 close apify/apify-mcp-server#129 close https://github.com/apify/ai-team/issues/33 EDIT: Remove this fix after some time: apify#1802 --------- Co-authored-by: Michał Olender <[email protected]>
1 parent fb1c4e5 commit 903acbb

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

apify-docs-theme/static/js/custom.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,30 @@ window.addEventListener('load', () => {
125125

126126
// docusaurus-openapi-docs plugin: scroll sidebar into viewport, no need for a large timeout here
127127
setTimeout(() => scrollOpenApiSidebarItemIntoView(), 200);
128+
129+
// MCP cache clearing - run after page is fully loaded
130+
setTimeout(() => clearMcpRedirectCache(), 200);
128131
});
129132

130133
window.addEventListener('popstate', () => {
131134
setTimeout(() => redirectOpenApiDocs(), 50);
132135
setTimeout(() => scrollOpenApiSidebarItemIntoView(), 50);
133136
});
137+
138+
// MCP redirect cache-busting
139+
// Background: Previously, mcp.apify.com had a 301 redirect to the docs page
140+
// This clears cached redirects so users can access the new MCP configuration interface
141+
function clearMcpRedirectCache() {
142+
// Only run on the MCP documentation page
143+
if (window.location.pathname.includes('integrations/mcp')) {
144+
// Clear cached redirects to mcp.apify.com
145+
fetch('https://mcp.apify.com/', {
146+
method: 'get',
147+
cache: 'reload',
148+
}).then(() => {
149+
// Cache cleared successfully
150+
}).catch(() => {
151+
// Failed to clear cache - silent fail
152+
});
153+
}
154+
}

sources/platform/integrations/ai/mcp.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /integrations/mcp
88

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

11-
The _Apify Model Context Protocol (MCP) Server_ allows AI applications to connect to Apifys extensive library of Actors as tools to perform web scraping, data extraction, or other automation tasks in real time.
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.
1212

1313
![Apify MCP Server](../../images/apify_mcp_server.png)
1414

@@ -17,21 +17,18 @@ The _Apify Model Context Protocol (MCP) Server_ allows AI applications to connec
1717
You can use the Apify MCP Server in two ways:
1818

1919
- _HTTPS Endpoint_ `mcp.apify.com`: Connect your MCP client through OAuth or by including `Authorization: Bearer <APIFY_TOKEN>` header in your requests.
20-
- `https://mcp.apify.com` for streamable transport (recommended)
21-
- `https://mcp.apify.com/sse` for SSE transport (legacy)
20+
- `https://mcp.apify.com` for streamable transport
2221
- _Standard Input/Output (stdio)_: Ideal for local integrations and command-line tools such as the Claude for Desktop client.
2322
- Set MCP client server command to `npx @apify/actors-mcp-server` and environment variable `APIFY_TOKEN` to your Apify API token
2423
- See `npx @apify/actors-mcp-server --help` for more options
2524

26-
You could also use legacy option by running [Apify Actors MCP Server](https://apify.com/apify/actors-mcp-server) as an Actor.
25+
:::tip Quick setup options
26+
_MCP server configuration for other clients_: Use https://mcp.apify.com to select Actors and tools, then copy the configuration to your client.
2727

28-
:::tip Run instantly ⚡
29-
30-
To install the Apify MCP Server in [Claude for Desktop](https://claude.ai/download) with one click, download and run the latest [Apify MCP Server DXT file](https://github.com/apify/actors-mcp-server/releases/latest/download/actors-mcp-server.dxt)
28+
_Claude Desktop_: Download and run the [Apify MCP Server DXT file](https://github.com/apify/actors-mcp-server/releases/latest/download/actors-mcp-server.dxt) for one-click installation.
3129

3230
:::
3331

34-
3532
## Prerequisites
3633

3734
Before you start, make sure you have the following:
@@ -211,7 +208,11 @@ Check your client’s documentation or settings to confirm this feature is avail
211208

212209
The Apify MCP server has a rate limit of _30 requests per second_ per user. If you exceed this limit, you will receive a `429 Too Many Requests` response.
213210

214-
## Troubleshooting
211+
## Support and contribution
212+
213+
The Apify MCP Server is an open-source project.
214+
You can report bugs, suggest new features, or ask questions in the [GitHub issues](https://github.com/apify/actors-mcp-server/issues).
215+
If you find this project useful, please [star it on GitHub](https://github.com/apify/actors-mcp-server) to show your support!
215216

216217
- _Authorization (API Token):_ If the MCP server isn’t executing Actors, ensure you provided a correct Apify API token. Without a valid `APIFY_TOKEN`, the server cannot start Actor runs. Always set the `APIFY_TOKEN` environment variable when running locally.
217218
- _Ensure latest version:_ If running via NPM, always use the latest version of `@apify/actors-mcp-server` for the newest features and fixes. You can append `@latest` when installing or in your config args to ensure this.
@@ -221,7 +222,7 @@ The Apify MCP server has a rate limit of _30 requests per second_ per user. If y
221222
## Learn more
222223

223224
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction): Learn about the open standard on the official MCP website – understanding the protocol can help you build custom agents.
224-
- [Apify Actors MCP Server](https://apify.com/apify/actors-mcp-server): The README for the Apify MCP Server actor (available on Apify Store as `apify/actors-mcp-server`) provides technical details on implementation and advanced usage.
225+
- [Actors MCP Server GitHub](https://github.com/apify/actors-mcp-server): The README for the Apify MCP Server actor (available on Apify Store as `apify/actors-mcp-server`) provides technical details on implementation and advanced usage.
225226
- [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client): A specialized client actor (`jiri.spilka/tester-mcp-client`) that you can run to simulate an AI agent in your browser. Useful for testing your setup with a chat UI.
226227
- [How to use MCP with Apify Actors](https://blog.apify.com/how-to-use-mcp/): Learn how to expose over 5,000 Apify Actors to AI agents with Claude and LangGraph, and configure MCP clients and servers.
227228
- [Apify MCP Server Tutorial](https://www.youtube.com/watch?v=BKu8H91uCTg): Integrate thousands of Apify Actors and Agents with Claude.

0 commit comments

Comments
 (0)