Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@vercel/agent-readability": "0.7.0",
"@vercel/analytics": "2.0.1",
"@vercel/geistdocs": "2.4.1",
"@vercel/geistdocs": "2.7.5",
"fumadocs-core": "16.2.2",
"fumadocs-mdx": "14.0.4",
"fumadocs-ui": "16.2.2",
Expand Down
40 changes: 40 additions & 0 deletions apps/docs/scripts/test-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,46 @@ assert.match(publicSkill.body, /^---\nname: issue-graph\n/);
assert.equal(publicSkill.body, skill.body);
assert.match(publicSkill.body, /issue-graph skills get core/);
checks += 2;
const bridge = await request("/api/mcp?webmcp-script", { accept: "*/*" });
assert.equal(bridge.response.status, 200);
assert.match(bridge.response.headers.get("content-type") ?? "", /javascript/);
assert.match(bridge.body, /registerTool/);
async function rpc(method: string, params: Record<string, unknown>) {
const response = await fetch(new URL("/api/mcp", origin), {
method: "POST",
headers: { "content-type": "application/json", accept: "application/json, text/event-stream" },
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
});
assert.equal(response.status, 200);
const text = await response.text();
const message = JSON.parse(
response.headers.get("content-type")?.includes("text/event-stream")
? (text
.split(/\r?\n/)
.find((line) => line.startsWith("data:"))
?.slice(5) ?? "")
: text,
);
assert.equal(message.error, undefined);
return message.result;
}
const { tools } = await rpc("tools/list", {});
assert.deepEqual(
tools.map((tool: { name: string }) => tool.name),
["search_docs"],
);
const found = await rpc("tools/call", {
name: "search_docs",
arguments: { query: "competing PRs", locale: "en" },
});
assert.notEqual(found.isError, true);
const matches = found.content
.filter((item: { type: string }) => item.type === "text")
.flatMap((item: { text: string }) => JSON.parse(item.text));
assert.ok(
matches.some((item: { url: string }) => item.url === "/docs/backlog#compare-competing-prs"),
);
checks += 3;
console.log(
`PASS: ${checks} route checks against ${origin.origin}${preview ? " (preview noindex)" : ""}`,
);
7 changes: 7 additions & 0 deletions apps/docs/src/app/api/mcp/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createMcpRoute } from "@vercel/geistdocs/routes/mcp";
import { config } from "@/lib/geistdocs/config";
import { GET as search } from "../search/route";

const handler = createMcpRoute({ config, search });

export { handler as GET, handler as POST };
2 changes: 1 addition & 1 deletion apps/docs/tests/content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe("documentation content contract", () => {
expect(pkg.name).toBe("@issue-graph/docs");
expect(pkg.private).toBe(true);
for (const [name, version] of Object.entries({
"@vercel/geistdocs": "2.4.1",
"@vercel/geistdocs": "2.7.5",
"@vercel/agent-readability": "0.7.0",
next: "16.3.5",
react: "19.3.0",
Expand Down
72 changes: 61 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading