Skip to content

Commit 43a5d9c

Browse files
authored
feat: add workflow mcp server and fix tool naming (#1)
2 parents a0ef949 + 52140b8 commit 43a5d9c

File tree

8 files changed

+50
-10
lines changed

8 files changed

+50
-10
lines changed

app/ai/mcp/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createcontent } from '@/lib/content'
44
const content = createcontent('ai')
55

66
const { handler, page } = createmcp({
7-
name: 'ai-sdk-docs',
7+
name: 'ai',
88
title: 'ai sdk',
99
description: 'AI SDK documentation',
1010
basePath: '/ai/mcp',

app/api/sync/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const repos = [
33
{ repo: 'honojs/website', path: 'docs', key: 'hono' },
44
{ repo: 'sveltejs/svelte.dev', path: 'apps/svelte.dev/content', key: 'svelte' },
55
{ repo: 'Effect-TS/website', path: 'content/src/content/docs', key: 'effect' },
6+
{ repo: 'vercel/workflow', path: 'docs/content', key: 'workflow' },
67
]
78

89
async function getlatestcommit(repo: string, path: string): Promise<string | null> {

app/effect/mcp/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createcontent } from '@/lib/content'
44
const content = createcontent('effect')
55

66
const { handler, page } = createmcp({
7-
name: 'effect-docs',
7+
name: 'effect',
88
title: 'effect',
99
description: 'Effect-TS documentation',
1010
basePath: '/effect/mcp',

app/hono/mcp/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createcontent } from '@/lib/content'
44
const content = createcontent('hono')
55

66
const { handler, page } = createmcp({
7-
name: 'hono-docs',
7+
name: 'hono',
88
title: 'hono',
99
description: 'Hono framework documentation',
1010
basePath: '/hono/mcp',

app/svelte/mcp/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createcontent } from '@/lib/content'
44
const content = createcontent('svelte')
55

66
const { handler, page } = createmcp({
7-
name: 'svelte-docs',
7+
name: 'svelte',
88
title: 'svelte',
99
description: 'Svelte and SvelteKit documentation',
1010
basePath: '/svelte/mcp',

app/workflow/mcp/route.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { createmcp } from '@/lib/mcp'
2+
import { createcontent } from '@/lib/content'
3+
4+
const content = createcontent('workflow')
5+
6+
const { handler, page } = createmcp({
7+
name: 'workflow',
8+
title: 'workflow',
9+
description: 'Vercel Workflow documentation',
10+
basePath: '/workflow/mcp',
11+
sections: ['docs', 'guides'],
12+
searchDocs: content.searchDocs,
13+
getDoc: content.getDoc,
14+
listDocs: content.listDocs,
15+
tools: [
16+
{ name: 'search_workflow_docs', description: 'search documentation by keyword' },
17+
{ name: 'get_workflow_doc', description: 'get full content of a page' },
18+
{ name: 'list_workflow_docs', description: 'list available pages' },
19+
],
20+
})
21+
22+
export async function GET(request: Request) {
23+
const accept = request.headers.get('accept') || ''
24+
if (accept.includes('text/html')) {
25+
return new Response(page, { headers: { 'Content-Type': 'text/html' } })
26+
}
27+
return handler(request)
28+
}
29+
30+
export { handler as POST, handler as DELETE }

lib/servers.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,32 @@ export interface Server {
88
export const servers: Server[] = [
99
{
1010
path: '/ai/mcp',
11-
name: 'ai-sdk-docs',
11+
name: 'ai',
1212
description: 'search and read ai sdk documentation',
13-
tools: ['search_ai_sdk_docs', 'get_ai_sdk_doc', 'list_ai_sdk_docs'],
13+
tools: ['search_ai_docs', 'get_ai_doc', 'list_ai_docs'],
1414
},
1515
{
1616
path: '/hono/mcp',
17-
name: 'hono-docs',
17+
name: 'hono',
1818
description: 'search and read hono framework documentation',
1919
tools: ['search_hono_docs', 'get_hono_doc', 'list_hono_docs'],
2020
},
2121
{
2222
path: '/svelte/mcp',
23-
name: 'svelte-docs',
23+
name: 'svelte',
2424
description: 'search and read svelte and sveltekit documentation',
2525
tools: ['search_svelte_docs', 'get_svelte_doc', 'list_svelte_docs'],
2626
},
2727
{
2828
path: '/effect/mcp',
29-
name: 'effect-docs',
29+
name: 'effect',
3030
description: 'search and read effect-ts documentation',
3131
tools: ['search_effect_docs', 'get_effect_doc', 'list_effect_docs'],
3232
},
33+
{
34+
path: '/workflow/mcp',
35+
name: 'workflow',
36+
description: 'search and read vercel workflow documentation',
37+
tools: ['search_workflow_docs', 'get_workflow_doc', 'list_workflow_docs'],
38+
},
3339
]

scripts/clone.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ai_hash=""
88
hono_hash=""
99
svelte_hash=""
1010
effect_hash=""
11+
workflow_hash=""
1112

1213
clone() {
1314
local repo=$1
@@ -28,13 +29,15 @@ ai_hash=$(clone "vercel/ai" "content" "ai")
2829
hono_hash=$(clone "honojs/website" "docs" "hono")
2930
svelte_hash=$(clone "sveltejs/svelte.dev" "apps/svelte.dev/content" "svelte")
3031
effect_hash=$(clone "Effect-TS/website" "content/src/content/docs" "effect")
32+
workflow_hash=$(clone "vercel/workflow" "docs/content" "workflow")
3133

3234
cat > public/hashes.json << EOF
3335
{
3436
"ai": "$ai_hash",
3537
"hono": "$hono_hash",
3638
"svelte": "$svelte_hash",
37-
"effect": "$effect_hash"
39+
"effect": "$effect_hash",
40+
"workflow": "$workflow_hash"
3841
}
3942
EOF
4043

0 commit comments

Comments
 (0)