|
| 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 } |
0 commit comments