Token导航 LogoToken导航TokenDH.com
finewiki MCP logo
文档知识stdio官方级别未说明来源级核验

finewiki MCP

MCP Server

一个提供统一搜索功能的离线知识库服务,整合了约2100万篇文章(包括FineWiki英文版和FineWeb-Edu教育内容),适用于研究、事实核查和需要可靠离线信息的AI应用。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
Python研究工具文档处理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

minimasoft

提供方

minimasoft

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run python -m finewiki_mcp.indexer \

详细介绍

📚 线下知识MCP

A. 模型上下文协议(MCP) 提供约2100万篇文章统一搜索的服务器——FineWiki English(约660万)和FineWeb Edu教育内容(约1440万)。 🌐

没有API密钥。没有费率限制。没有追踪器。只是纯粹的离线AI环境! 💪

主要特点: - 🔍 使用单个查询跨两个数据集进行统一全文搜索 - 🐳 在Docker中运行(不需要本地依赖) - ⚡ 使用Tantivy进行闪电般快速的索引和搜索(约60ms的获取时间) - 💾 完整的线下知识:29GB+71GB=100GB,约2100万篇文章 - 📖 聚合工具: text_search_knowledgefetch_knowledge

______________________________________________________________________

🎯 这是什么?

此MCP服务器为您提供 无限离线上下文 通过将维基百科和精心策划的教育网络内容整合到一个可搜索的知识库中。非常适合研究、事实核查或任何需要可靠离线信息的人工智能应用程序。

把它想象成你自己的离线谷歌+维基百科API,完全运行在你的机器上。 🏠

______________________________________________________________________

📥 下载拼花游戏文件

FineWiki英文数据集(维基百科)

./links.sh

这将使用aria2下载所有拼花地板文件,以获得最高速度⚡

安装aria2: ``bash # Ubuntu/Debian sudo apt install aria2 # macOS brew install aria2 ``

FineWeb教育数据集(教育网络)

FineWeb Edu包含来自网络的精选教育内容(约1440万篇文章)。

# Place your fineweb-edu parquet files in ./fineweb-edu/
mkdir -p fineweb-edu
# Copy or download parquet files here

______________________________________________________________________

🐳 Docker安装程序(推荐)

步骤1:构建两个索引

构建FineWiki索引(约30分钟):

./run_finewiki.sh index --dataset finewiki

构建FineWeb教育指数(约60-90分钟):

./run_finewiki.sh index --dataset fineweb-edu

这将:

  • 构建Docker镜像(一次)
  • 扫描所有 .parquet 指定目录中的文件
  • 创建Tantivy搜索索引:

- index_data/ → FineWiki(约29GB,660万篇文章) - index_data_fineweb_edu/ → FineWeb教育(约71GB,约1440万篇文章)

  • 注: 索引后,您可以删除拼花文件——所有内容都在索引中

步骤2:启动MCP服务器

./run_finewiki.sh server --dataset finewiki

服务器会自动加载这两个索引,并公开统一的搜索工具。

______________________________________________________________________

🧪 测试

运行内置测试以验证一切正常:

./run_finewiki.sh test --index-dir index_data

预期产量:

Test Mode - Testing aggregated knowledge tools
FineWiki index: /host_project/index_data
  FineWiki index loaded in 0.003s
  Memory after loading: 0.04 GB
  FineWeb-Edu index loaded from /host_project/index_data_fineweb_edu
  Memory after both indices loaded: 0.06 GB

======================================================================
Testing text_search_knowledge + fetch_knowledge tools
======================================================================

--- Query: 'machine learning' ---
  Search completed in X.XXXs
  Found XX total results (X Wikipedia, X Educational)
...

======================================================================
SUMMARY
======================================================================
Queries tested: 3
Total fetches performed: 6
Average fetch time: ~60ms
Final memory usage: ~0.32 GB

✓ All tests completed successfully!

______________________________________________________________________

🤖 与MCP客户端集成

示例配置

适用于克劳德桌面(claude_desktop_config.json):

{
  "mcpServers": {
    "offline-knowledge": {
      "command": "bash",
      "args": [
        "/path/to/finewiki_mcp/run_finewiki.sh",
        "server",
        "--dataset",
        "finewiki"
      ]
    }
  }
}

对于其他MCP客户端:

{
  "offline-knowledge": {
    "command": "docker",
    "args": [
      "run",
      "--rm",
      "-v", "/path/to/index_data:/host_project/index_data:ro",
      "-v", "/path/to/index_data_fineweb_edu:/host_project/index_data_fineweb_edu:ro",
      "offline-knowledge-mcp:latest"
    ]
  }
}
注: 替换 /path/to/ 使用存储库和索引目录的实际路径。

______________________________________________________________________

🧰 可用工具

MCP服务器公开了两个跨两个数据集工作的统一搜索工具:

工具说明
text_search_knowledge同时搜索约2100万篇文章,最多可返回20个结果,分为维基百科和教育网络内容。ID前缀为 wiki:edu: 用于统一取数。
fetch_knowledge通过前缀ID获取完整内容(wiki:12345edu:abc-def).返回包含所有可用字段的完整文章/文档。

工具使用示例

示例1:跨两个来源的研究查询

{
  "name": "text_search_knowledge",
  "arguments": {
    "query": "machine learning"
  }
}

*退货:* 约20个结果(例如,10个维基百科+10个教育),ID如下:

  • wiki:34567 → 维基百科关于机器学习的文章
  • edu:ml-tutorial-2024 → 机器学习教育教程

示例2:从搜索结果中获取完整内容

{
  "name": "fetch_knowledge",
  "arguments": {
    "doc_id": "wiki:34567"
  }
}

*退货:* 完整的维基百科文章 id, title, content, url.

{
  "name": "fetch_knowledge",
  "arguments": {
    "doc_id": "edu:ml-tutorial-2024"
  }
}

*退货:* 教育文件 id, text, url, dump, date, language.

______________________________________________________________________

🏗️ 项目结构

finewiki_mcp/
├── src/finewiki_mcp/
│   ├── __init__.py       # Package initialization (exports searcher classes)
│   ├── common.py         # Shared utilities (Tantivy schema definitions)
│   ├── indexer.py        # Index generation from Parquet files
│   ├── searcher.py       # FineWikiSearcher, FineWebEduSearcher, aggregate_search()
│   ├── server.py         # MCP server with text_search_knowledge + fetch_knowledge
│   └── tester.py         # Test utilities (tests aggregated knowledge tools)
├── index_data/           # FineWiki Tantivy index (~29GB for 6.6M articles) 🗂️
├── index_data_fineweb_edu/  # FineWeb-Edu index (~71GB for ~14.4M articles) 🗂️
├── finewiki_en/          # FineWiki parquet files (optional after indexing) 📦
├── fineweb-edu/          # FineWeb-Edu parquet files (optional after indexing) 📦
├── run_finewiki.sh       # Docker runner script (index/server/test modes) ⚙️
├── links.sh              # Downloads for FineWiki parquet files 🔗
├── pyproject.toml        # Project dependencies (tantivy, mcp)
└── README.md             # This documentation 📖

______________________________________________________________________

🔧 运作原理

  1. 索引 📝

用途 坦提维 从Parquet文件创建快速全文搜索索引。

FineWiki架构:

- id:文档标识符(整数、存储、索引) - title:文章标题(存储、索引) - content:全文(存储、索引) - url:源URL(已存储、已索引)

FineWeb 教育方案:

- id:字符串文档标识符(存储、索引) - text:主要教育内容(存储、索引) - dump:转储日期/源标识符(存储、索引) - url:源URL(已存储、已索引) - date:内容日期(存储、索引) - file_path:原始文件路径(已存储、已索引) - language:语言代码(存储、索引)

  1. 聚合搜索 🔍

aggregate_search() 函数同时查询两个索引:

   def aggregate_search(wiki_searcher, edu_searcher, query, total_limit=20):
       # Split limit between sources (default 10-10)
       wiki_results = wiki_searcher.search_by_content(query, limit=half)
       edu_results = edu_searcher.search_by_text(query, limit=remaining)
       
       # Prefix IDs for unified fetching
       combined = [
           {"id": f"wiki:{hit['id']}", ...} for hit in wiki_results
       ] + [
           {"id": f"edu:{hit['id']}", ...} for hit in edu_results
       ]
       return combined
  1. 统一提取 📚

fetch_knowledge 该工具解析前缀并从相应的源获取:

- wiki:12345 → Calls FineWikiSearcher.fetch_content(12345) - edu:abc-def → Calls FineWebEduSearcher.fetch_content("abc-def")

______________________________________________________________________

📊 存储需求

数据集文章索引大小拼花文件(可选)
FineWiki英语~6.6M29GB约20-25GB
FineWeb教育约1440万71GB变化多样
总计~21米100GB
注: 运行后 ./run_finewiki.sh index,您可以安全地删除拼花地板文件。

性能基准(来自试运行)

Index loaded: ~3ms per searcher
Memory usage:
  - FineWiki only: 0.04 GB
  - Both indexes: 0.06 GB
  - After operations: 0.32 GB max

Average fetch time: ~60ms (with both indexes loaded)

______________________________________________________________________

🛠️ 开发(可选)

在没有Docker的情况下在本地处理代码:

# Install dependencies
uv sync

# Run indexer directly (FineWiki)
uv run python -m finewiki_mcp.indexer \
    --parquet-dir finewiki_en \
    --index-dir index_data

# Run server in test mode
uv run python -m finewiki_mcp.server \
    --index-dir index_data \
    --mode test

______________________________________________________________________

📚 许可证

本项目按原样提供,用于教育和研究目的。请随时适应和扩展! 🚀

______________________________________________________________________

线下知识,无限语境! 🧠✨

目录标签

目录标签

Python研究工具文档处理离线搜索本地部署知识库全文检索教育内容

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP