@devries-cameron20 / composio-1 / commits / 17d1f18e9
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): restore legacy authentication and MCP links

Brendan O'Leary committed Oct 31, 2026 at 12:26 UTC 17d1f18e90b434dee14423d3632ce99ec9c14e4d
4 files changed +89 -2
docs/README.md
+2
@@ -84,6 +84,8 @@ See the [Twoslash guide](agent-guidance/context/twoslash.md) for complete exampl
84
85 Define permanent redirects in `next.config.mjs` and cover legacy entry points in `tests/integration/redirects.test.ts`. `/docs/getting-started` redirects to `/docs/quickstart` so stale links found by agents still reach the current guide.
86
87 +Keep legacy redirects topic-specific. Requests ending in `.md` and legacy `/llms.mdx/` requests must target a Markdown representation, not an HTML guide. The redirect integration tests cover the seven DEVREL-304 entry points, their response formats, content negotiation, and unknown routes that must remain 404s.
88 +
89 ## Search
90
91 Docs search uses Algolia when `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` is set; otherwise it falls back to the local Fumadocs `/api/search` endpoint for development and tests. The sync script builds a first-party index from MDX/OpenAPI/toolkit data (no crawler required), splits long pages into section-sized records, configures searchable attributes/custom ranking/distinct, requests `clickAnalytics`, and sends search result view/click events with `search-insights`.
docs/next.config.mjs
+27
@@ -1127,6 +1127,33 @@ const config = {
1127 destination: '/docs/authentication/white-labeling-authentication',
1128 permanent: true,
1129 },
1130 + // Exact legacy entry points reported in DEVREL-304. Machine-readable
1131 + // requests redirect to .md destinations rather than the HTML guides.
1132 + {
1133 + source: '/authentication/authentication-overview',
1134 + destination: '/docs/authentication',
1135 + permanent: true,
1136 + },
1137 + {
1138 + source: '/authentication/connected-accounts/overview',
1139 + destination: '/docs/authentication/manually-authenticating',
1140 + permanent: true,
1141 + },
1142 + {
1143 + source: '/llms.mdx/authentication/connected-accounts/overview',
1144 + destination: '/docs/authentication/manually-authenticating.md',
1145 + permanent: true,
1146 + },
1147 + {
1148 + source: '/llms.mdx/sessions/sessions-via-mcp',
1149 + destination: '/docs/sessions-via-mcp.md',
1150 + permanent: true,
1151 + },
1152 + {
1153 + source: '/docs/manually-authenticating.md',
1154 + destination: '/docs/authentication/manually-authenticating.md',
1155 + permanent: true,
1156 + },
1157 // Auth, security, and deployment paths coding agents guess while
1158 // evaluating Composio. Each source returned 404 in Gauge agent sessions.
1159 {
docs/tests/integration/redirects.test.ts
+59 -1
@@ -7,8 +7,20 @@
7 import { describe, test, expect } from "bun:test";
8 import { fetchPage, fetchNoRedirect, BASE_URL } from "./helpers";
9
10 +/** Exact failed requests from DEVREL-304, including machine-readable routes. */
11 +const EVIDENCED_REDIRECTS = [
12 + { from: "/docs/auth-and-connected-accounts", to: "/docs/authentication", markdown: false },
13 + { from: "/docs/getting-started", to: "/docs/quickstart", markdown: false },
14 + { from: "/authentication/authentication-overview", to: "/docs/authentication", markdown: false },
15 + { from: "/authentication/connected-accounts/overview", to: "/docs/authentication/manually-authenticating", markdown: false },
16 + { from: "/llms.mdx/authentication/connected-accounts/overview", to: "/docs/authentication/manually-authenticating.md", markdown: true },
17 + { from: "/llms.mdx/sessions/sessions-via-mcp", to: "/docs/sessions-via-mcp.md", markdown: true },
18 + { from: "/docs/manually-authenticating.md", to: "/docs/authentication/manually-authenticating.md", markdown: true },
19 +];
20 +
21 /** Sample of important redirects to test (from next.config.mjs) */
22 const REDIRECTS = [
23 + ...EVIDENCED_REDIRECTS,
24 { from: "/", to: "/docs" },
25 { from: "/cookbooks", to: "/examples" },
26 { from: "/api-reference", to: "/reference" },
@@ -31,7 +43,6 @@ const REDIRECTS = [
43 { from: "/authentication", to: "/docs/authentication" },
44 { from: "/changelog", to: "/docs/changelog" },
45 { from: "/docs/mcp-quickstart", to: "/docs/single-toolkit-mcp" },
34 - { from: "/docs/getting-started", to: "/docs/quickstart" },
46 { from: "/docs/welcome", to: "/docs" },
47 { from: "/docs/managed-authentication", to: "/docs/authentication" },
48 { from: "/docs/workbench", to: "/docs/sandbox/remote" },
@@ -81,3 +92,50 @@ describe("Redirects - destinations are valid", () => {
92 expect(failures).toEqual([]);
93 });
94 });
95 +
96 +describe("Evidenced legacy routes - response representations", () => {
97 + for (const { from, to, markdown } of EVIDENCED_REDIRECTS) {
98 + test(`${from} serves the canonical ${markdown ? "Markdown" : "HTML"} topic`, async () => {
99 + const response = await fetchPage(from, {
100 + headers: { Accept: "text/html", "User-Agent": "facebookexternalhit/1.1" },
101 + timeout: 30_000,
102 + });
103 + expect(response.status).toBe(200);
104 + expect(new URL(response.url).pathname).toBe(to);
105 + expect(response.headers.get("content-type")).toContain(markdown ? "text/markdown" : "text/html");
106 + const body = await response.text();
107 + const canonical = `https://docs.composio.dev${to.replace(/\.md$/, "")}`;
108 + if (markdown) {
109 + expect(body).toContain(`canonical_url: "${canonical}"`);
110 + expect(body).toMatch(/^# .+/m);
111 + expect(body).not.toMatch(/<!doctype html/i);
112 + } else {
113 + expect(body).toContain(`<link rel="canonical" href="${canonical}"`);
114 + expect(body).toContain("<h1");
115 + }
116 + });
117 +
118 + if (!markdown) {
119 + for (const accept of ["text/markdown", "text/plain"]) {
120 + test(`${from} preserves ${accept} negotiation`, async () => {
121 + const response = await fetchPage(from, { headers: { Accept: accept }, timeout: 30_000 });
122 + expect(response.status).toBe(200);
123 + expect(response.headers.get("content-type")).toContain("text/markdown");
124 + expect(await response.text()).toContain(`canonical_url: "https://docs.composio.dev${to}"`);
125 + });
126 + }
127 + }
128 + }
129 +
130 + test("unknown documentation routes remain 404s", async () => {
131 + for (const path of [
132 + "/authentication/not-a-real-guide",
133 + "/llms.mdx/authentication/not-a-real-guide",
134 + "/docs/not-a-real-guide.md",
135 + ]) {
136 + const response = await fetchPage(path, { timeout: 30_000 });
137 + expect(response.status).toBe(404);
138 + expect(new URL(response.url).pathname).toBe(path);
139 + }
140 + });
141 +});
skills/composio/references/platform.md
+1 -1
@@ -141,7 +141,7 @@ If the application has its own connect UI, use session authorization and connect
141 Do not force advanced requests through first-time setup. Route them to current documentation:
142
143 - Session scoping, account selection, callbacks, direct tools, and sandbox controls: `configuring-sessions.md`
144 -- Custom connection UI: `manually-authenticating.md`
144 +- Custom connection UI: `authentication/manually-authenticating.md`
145 - Triggers and webhooks: `triggers.md` and the setting-up-triggers guides
146 - Custom MCP servers, tools, toolkits, or proxy execution: the `extending-sessions` guides
147 - Legacy direct execution, MCP servers, or Tool Router migrations: the migration and sessions guides