mcpField
D
Documentation Hub MCP Server

Documentation Hub MCP Server

本地服务
github.com/deep-poharkar记忆与知识082 周前更新

关于 Documentation Hub MCP Server

这是一个面向技术查询的文档检索 MCP 服务,供需要查找 React、Node.js 和 Python 文档的 AI 客户端使用。它会识别领域、提取主题并构造定向文档 URL,再获取相关内容。

主要功能

  1. 01识别技术领域
  2. 02从查询中提取主题
  3. 03构造定向文档 URL
  4. 04获取多领域文档内容
  5. 05支持扩展文档领域

适用场景

  1. 01查找 React 特定主题文档
  2. 02检索 Node.js 技术资料
  3. 03查询 Python 文档内容
  4. 04将技术问题映射到文档页面

MCP 相关

该 MCP 服务向兼容客户端提供领域判断、主题提取和文档获取工具,并提供 React、Node.js、Python 及通用文档资源。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

文档中心 MCP 服务

一个用于跨多个技术领域智能检索文档的模型上下文协议(MCP)服务。

概述

本项目实现了一个 MCP 服务,可针对技术查询提供定向文档检索。它采用混合方式来:

  1. 确定查询所属的技术领域(React、Node.js、Python)
  2. 从查询中提取特定主题
  3. 构建精确的文档 URL
  4. 获取并返回最相关的文档

该服务使用 TypeScript 和 MCP SDK 构建,为 AI 模型提供标准化接口,以便访问文档资源。

功能

  • 领域分类:自动识别查询是关于 React、Node.js、Python 还是一般主题
  • 主题提取:使用正则表达式匹配来识别查询中的特定技术概念
  • URL 构建:根据识别出的主题构建定向文档 URL
  • 多个文档来源:支持 React、Node.js、Python 文档,并可扩展到其他领域
  • 标准化接口:实现模型上下文协议,以便与兼容 MCP 的客户端互操作

安装

# Clone the repository
git clone https://github.com/yourusername/mcp-server.git
cd mcp-server

# Install dependencies
npm install

# Build the project
npm run build

使用方法

运行服务
node build/index.js
测试主题提取

项目包含一个测试脚本,用于演示主题提取和 URL 构建的工作方式:

# Build the test script
npx tsc src/test.ts --outDir build

# Run the test
node build/test.js
与客户端集成

该服务可与任何兼容 MCP 的客户端集成。以下是客户端与服务交互的示例:

// Example client code (not included in this project)
const client = new McpClient();
const result = await client.callTool("fetch-documentation", {
  query: "How do I use useState hook in React?",
});

console.log(result);
// Output: {
//   domain: "react-docs",
//   topics: ["useState", "state"],
//   specificUrl: "https://react.dev/reference/react/useState",
//   content: "...",
//   source: "https://react.dev/reference/react/useState"
// }

项目结构

  • src/index.ts - 主服务实现
  • src/test.ts - 用于测试主题提取和 URL 构建的脚本
  • build/ - 编译后的 JavaScript 输出
  • package.json - 项目配置和依赖项

可用工具

该服务提供以下工具:

determine-domain

确定查询所属的技术领域。

{
  query: string; // The user query to classify
}

返回:

{
  domain: string; // The identified domain
  confidence: string; // "high" or "low"
}
extract-topics

从查询中提取指定领域的特定主题。

{
  query: string; // The user query to analyze
  domain: string; // The technical domain to extract topics for
}

返回:

{
  topics: string[]; // Array of identified topics
  count: number; // Number of topics found
}
fetch-documentation

根据查询和领域获取文档。

{
  query: string; // The user query
  domain?: string; // Optional domain override
}

返回:

{
  domain: string; // The identified domain
  topics: string[]; // Array of identified topics
  specificUrl: string | null; // The constructed URL if available
  content: string; // The fetched documentation content
  source: string; // The source URL
}

可用资源

该服务提供以下文档资源:

  • react-docs - React.js 文档
  • node-docs - Node.js 文档
  • python-docs - Python 文档
  • general - 领域不明确时提供的一般文档

扩展服务

添加新领域

要支持新的技术领域:

  1. 在 determineDomain 函数中的 domainKeywords 对象内添加领域关键词
  2. 在 extractTopics 函数中的 topicPatterns 对象内添加主题模式
  3. 在 constructSpecificUrl 函数中添加 URL 构建逻辑
  4. 在服务配置中添加新的资源处理程序
改进主题提取

可通过以下方式改进主题提取:

  1. 优化现有主题的正则表达式模式
  2. 为现有领域添加新主题
  3. 实现更复杂的 NLP 技术来提取主题

许可证

MIT

贡献

欢迎贡献!欢迎提交 Pull Request。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。