Skip to main content
Glama

Deepwiki MCP Server

by regenrek
linkRewrite.ts786 B
import type { ModeEnum } from '../schemas/deepwiki' import { fromHtml } from 'hast-util-from-html' import { visit } from 'unist-util-visit' interface Opts { mode: typeof ModeEnum._type } /** rehype plugin to rewrite internal links to anchors or markdown files */ export function rehypeRewriteLinks(opts: Opts) { return function transformer(tree: any, file: any) { visit(tree, 'element', (node: any) => { if (node.tagName !== 'a') return const href: string | undefined = node.properties?.href if (!href || href.startsWith('http')) return if (opts.mode === 'aggregate') { node.properties.href = `#${href.replace(/^\//, '')}` } else { node.properties.href = `${href.replace(/^\//, '')}.md` } }) } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/regenrek/deepwiki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server