Knowledge Base

MCP搜索检索

提供方 未标注

搜索检索 stdio · 本地进程 未标注 社区 / 第三方
查看接入方式

全面解析Knowledge BaseMCP Server的核心功能、安装配置和实用案例。作为顶级Model Context Protocol服务器,Knowledge Base能让AI助手访问实时数据、执行操作,为您提供更智能的工作体验和自动化解决方案。

一句话选型结论

按资料字段整理

Knowledge Base 属于搜索检索类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类搜索检索 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

搜索检索
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
pip install kb-mcp-server\"

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
联网搜索取证

让模型查最新资料并给出出处。

资料聚合

把一个主题的网页、文档集中抓回来整理。

情报与竞品检索

按关键词持续检索行业动态和竞品信息。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Knowledge Base当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Brave Search 433812ff 2 未标注 未标注 无 2026-05-17
Sequentialthinking 1 SSE · 服务端推送 远程部署 有 2026-05-18
Baidu Netdisk 未标注 未标注 未标注 无 2026-05-17
ragflow 未标注 stdio · 本地进程 本地部署 有 2026-04-11
mindsdb (430e18) 未标注 未标注 未标注 有 2026-05-17

服务器档案

搜索检索
字段来自项目仓库与公开索引,中文说明由本站标注
提供方未标注上游标注的维护方 未标注
分类搜索检索本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

15.9 KB
来自项目仓库与上游目录的原文,未做删改

Embedding MCP Server

A Model Context Protocol (MCP) server implementation powered by txtai, providing semantic search, knowledge graph capabilities, and AI-driven text processing through a standardized interface.

The Power of txtai: All-in-one Embeddings Database

This project leverages txtai, an all-in-one embeddings database for RAG leveraging semantic search, knowledge graph construction, and language model workflows. txtai offers several key advantages:

  • Unified Vector Database: Combines vector indexes, graph networks, and relational databases in a single platform
  • Semantic Search: Find information based on meaning, not just keywords
  • Knowledge Graph Integration: Automatically build and query knowledge graphs from your data
  • Portable Knowledge Bases: Save entire knowledge bases as compressed archives (.tar.gz) that can be easily shared and loaded
  • Extensible Pipeline System: Process text, documents, audio, images, and video through a unified API
  • Local-first Architecture: Run everything locally without sending data to external services

How It Works

The project contains a knowledge base builder tool and a MCP server. The knowledge base builder tool is a command-line interface for creating and managing knowledge bases. The MCP server provides a standardized interface to access the knowledge base.

It is not required to use the knowledge base builder tool to build a knowledge base. You can always build a knowledge base using txtai's programming interface by writing a Python script or even using a jupyter notebook. As long as the knowledge base is built using txtai, it can be loaded by the MCP server. Better yet, the knowledge base can be a folder on the file system or an exported .tar.gz file. Just give it to the MCP server and it will load it.

1. Build a Knowledge Base with kb_builder

The kb_builder module provides a command-line interface for creating and managing knowledge bases:

  • Process documents from various sources (files, directories, JSON)
  • Extract text and create embeddings
  • Build knowledge graphs automatically
  • Export portable knowledge bases

Note it is possibly limited in functionality and currently only provided for convenience.

2. Start the MCP Server

The MCP server provides a standardized interface to access the knowledge base:

  • Semantic search capabilities
  • Knowledge graph querying and visualization
  • Text processing pipelines (summarization, extraction, etc.)
  • Full compliance with the Model Context Protocol

Installation

Recommended: Using uv with Python 3.10+

We recommend using uv with Python 3.10 or newer for the best experience. This provides better dependency management and ensures consistent behavior.```bash

Install uv if you don't have it already

pip install -U uv

Create a virtual environment with Python 3.10 or newer

uv venv --python=3.10 # or 3.11, 3.12, etc.

Activate the virtual environment (bash/zsh)

source .venv/bin/activate

For fish shell

source .venv/bin/activate.fish

Install from PyPI

uv pip install kb-mcp-server


> **Note**: We pin transformers to version 4.49.0 to avoid deprecation warnings about `transformers.agents.tools` that appear in version 4.50.0 and newer. If you use a newer version of transformers, you may see these warnings, but they don't affect functionality.

### Using conda```bash
# Create a new conda environment (optional)
conda create -n embedding-mcp python=3.10
conda activate embedding-mcp

# Install from PyPI
pip install kb-mcp-server

From Source```bash

Create a new conda environment

conda create -n embedding-mcp python=3.10
conda activate embedding-mcp

Clone the repository

git clone https://github.com/Geeksfino/kb-mcp-server.git.git
cd kb-mcp-server

Install dependencies

pip install -e .


### Using uv (Faster Alternative)```bash
# Install uv if not already installed
pip install uv

# Create a new virtual environment
uv venv
source .venv/bin/activate

# Option 1: Install from PyPI
uv pip install kb-mcp-server

# Option 2: Install from source (for development)
uv pip install -e .

Using uvx (No Installation Required)

uvx allows you to run packages directly from PyPI without installing them:```bash

Run the MCP server

uvx --from kb-mcp-server@0.3.0 kb-mcp-server --embeddings /path/to/knowledge_base

Build a knowledge base

uvx --from kb-mcp-server@0.3.0 kb-build --input /path/to/documents --config config.yml

Search a knowledge base

uvx --from kb-mcp-server@0.3.0 kb-search /path/to/knowledge_base "Your search query"


## Command Line Usage

### Building a Knowledge Base

You can use the command-line tools installed from PyPI, the Python module directly, or the convenient shell scripts:

#### Using the PyPI Installed Commands```bash
# Build a knowledge base from documents
kb-build --input /path/to/documents --config config.yml

# Update an existing knowledge base with new documents
kb-build --input /path/to/new_documents --update

# Export a knowledge base for portability
kb-build --input /path/to/documents --export my_knowledge_base.tar.gz

# Search a knowledge base
kb-search /path/to/knowledge_base "What is machine learning?"

# Search with graph enhancement
kb-search /path/to/knowledge_base "What is machine learning?" --graph --limit 10

Using uvx (No Installation Required)```bash

Build a knowledge base from documents

uvx --from kb-mcp-server@0.3.0 kb-build --input /path/to/documents --config config.yml

Update an existing knowledge base with new documents

uvx --from kb-mcp-server@0.3.0 kb-build --input /path/to/new_documents --update

Export a knowledge base for portability

uvx --from kb-mcp-server@0.3.0 kb-build --input /path/to/documents --export my_knowledge_base.tar.gz

Search a knowledge base

uvx --from kb-mcp-server@0.3.0 kb-search /path/to/knowledge_base "What is machine learning?"

Search with graph enhancement

uvx --from kb-mcp-server@0.3.0 kb-search /path/to/knowledge_base "What is machine learning?" --graph --limit 10


#### Using the Python Module```bash
# Build a knowledge base from documents
python -m kb_builder build --input /path/to/documents --config config.yml

# Update an existing knowledge base with new documents
python -m kb_builder build --input /path/to/new_documents --update

# Export a knowledge base for portability
python -m kb_builder build --input /path/to/documents --export my_knowledge_base.tar.gz

Using the Convenience Scripts

The repository includes convenient wrapper scripts that make it easier to build and search knowledge bases:```bash

Build a knowledge base using a template configuration

./scripts/kb_build.sh /path/to/documents technical_docs

Build using a custom configuration file

./scripts/kb_build.sh /path/to/documents /path/to/my_config.yml

Update an existing knowledge base

./scripts/kb_build.sh /path/to/documents technical_docs --update

Search a knowledge base

./scripts/kb_search.sh /path/to/knowledge_base "What is machine learning?"

Search with graph enhancement

./scripts/kb_search.sh /path/to/knowledge_base "What is machine learning?" --graph


Run `./scripts/kb_build.sh --help` or `./scripts/kb_search.sh --help` for more options.

### Starting the MCP Server

#### Using the PyPI Installed Command```bash
# Start with a specific knowledge base folder
kb-mcp-server --embeddings /path/to/knowledge_base_folder

# Start with a given knowledge base archive
kb-mcp-server --embeddings /path/to/knowledge_base.tar.gz

Using uvx (No Installation Required)```bash

Start with a specific knowledge base folder

uvx kb-mcp-server@0.2.6 --embeddings /path/to/knowledge_base_folder

Start with a given knowledge base archive

uvx kb-mcp-server@0.2.6 --embeddings /path/to/knowledge_base.tar.gz


#### Using the Python Module```bash
# Start with a specific knowledge base folder
python -m txtai_mcp_server --embeddings /path/to/knowledge_base_folder

# Start with a given knowledge base archive
python -m txtai_mcp_server --embeddings /path/to/knowledge_base.tar.gz

MCP Server Configuration

The MCP server is configured using environment variables or command-line arguments, not YAML files. YAML files are only used for configuring txtai components during knowledge base building.

Here's how to configure the MCP server:```bash

Start the server with command-line arguments

kb-mcp-server --embeddings /path/to/knowledge_base --host 0.0.0.0 --port 8000

Or using uvx (no installation required)

uvx kb-mcp-server@0.2.6 --embeddings /path/to/knowledge_base --host 0.0.0.0 --port 8000

Or using the Python module

python -m txtai_mcp_server --embeddings /path/to/knowledge_base --host 0.0.0.0 --port 8000

Or use environment variables

export TXTAI_EMBEDDINGS=/path/to/knowledge_base
export MCP_SSE_HOST=0.0.0.0
export MCP_SSE_PORT=8000
python -m txtai_mcp_server


Common configuration options:
- `--embeddings`: Path to the knowledge base (required)
- `--host`: Host address to bind to (default: localhost)
- `--port`: Port to listen on (default: 8000)
- `--transport`: Transport to use, either 'sse' or 'stdio' (default: stdio)
- `--enable-causal-boost`: Enable causal boost feature for enhanced relevance scoring
- `--causal-config`: Path to custom causal boost configuration YAML file

## Configuring LLM Clients to Use the MCP Server

To configure an LLM client to use the MCP server, you need to create an MCP configuration file. Here's an example `mcp_config.json`:

### Using the server directly

If you use a virtual Python environment to install the server, you can use the following configuration - note that MCP host like Claude will not be able to connect to the server if you use a virtual environment, you need to use the absolute path to the Python executable of the virtual environment where you did "pip install" or "uv pip install", for example```json
{
  "mcpServers": {
    "kb-server": {
      "command": "/your/home/project/.venv/bin/kb-mcp-server",
      "args": [
        "--embeddings",
        "/path/to/knowledge_base.tar.gz"
      ],
      "cwd": "/path/to/working/directory"
    }
  }
}

Using system default Python

If you use your system default Python, you can use the following configuration:```json
{
"rag-server": {
"command": "python3",
"args": [
"-m",
"txtai_mcp_server",
"--embeddings",
"/path/to/knowledge_base.tar.gz",
"--enable-causal-boost"
],
"cwd": "/path/to/working/directory"
}
}


Alternatively, if you're using uvx, assuming you have uvx installed in your system via "brew install uvx" etc, or you 've installed uvx and made it globally accessible via:```
# Create a symlink to /usr/local/bin (which is typically in the system PATH)
sudo ln -s /Users/cliang/.local/bin/uvx /usr/local/bin/uvx

This creates a symbolic link from your user-specific installation to a system-wide location. For macOS applications like Claude Desktop, you can modify the system-wide PATH by creating or editing a launchd configuration file:```

Create a plist file to set environment variables for all GUI applications

sudo nano /Library/LaunchAgents/environment.plist

Add this content:```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>my.startup</string>
  <key>ProgramArguments</key>
  <array>
    <string>sh</string>
    <string>-c</string>
    <string>launchctl setenv PATH $PATH:/Users/cliang/.local/bin</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

Then load it:```
sudo launchctl load -w /Library/LaunchAgents/environment.plist

You'll need to restart your computer for this to take effect, though.```json
{
  "mcpServers": {
    "kb-server": {
      "command": "uvx",
      "args": [
        "kb-mcp-server@0.2.6",
        "--embeddings", "/path/to/knowledge_base",
        "--host", "localhost",
        "--port", "8000"
      ],
      "cwd": "/path/to/working/directory"
    }
  }
}

Place this configuration file in a location accessible to your LLM client and configure the client to use it. The exact configuration steps will depend on your specific LLM client.

Advanced Knowledge Base Configuration

Building a knowledge base with txtai requires a YAML configuration file that controls various aspects of the embedding process. This configuration is used by the kb_builder tool, not the MCP server itself.

One may need to tune segmentation/chunking strategies, embedding models, and scoring methods, as well as configure graph construction, causal boosting, weights of hybrid search, and more.

Fortunately, txtai provides a powerful YAML configuration system that requires no coding. Here's an example of a comprehensive configuration for knowledge base building:```yaml

Path to save/load embeddings index

path: ~/.txtai/embeddings
writable: true

Content storage in SQLite

content:
path: sqlite:///~/.txtai/content.db

Embeddings configuration

embeddings:
# Model settings
path: sentence-transformers/nli-mpnet-base-v2
backend: faiss
gpu: true
batch: 32
normalize: true

# Scoring settings
scoring: hybrid
hybridalpha: 0.75

Pipeline configuration

pipeline:
workers: 2
queue: 100
timeout: 300

Question-answering pipeline

extractor:
path: distilbert-base-cased-distilled-squad
maxlength: 512
minscore: 0.3

Graph configuration

graph:
backend: sqlite
path: ~/.txtai/graph.db
similarity: 0.75 # Threshold for creating graph connections
limit: 10 # Maximum connections per node


### Configuration Examples

The `src/kb_builder/configs` directory contains configuration templates for different use cases and storage backends:

#### Storage and Backend Configurations
- `memory.yml`: In-memory vectors (fastest for development, no persistence)
- `sqlite-faiss.yml`: SQLite for content + FAISS for vectors (local file-based persistence)
- `postgres-pgvector.yml`: PostgreSQL + pgvector (production-ready with full persistence)

#### Domain-Specific Configurations
- `base.yml`: Base configuration template
- `code_repositories.yml`: Optimized for code repositories
- `data_science.yml`: Configured for data science documents
- `general_knowledge.yml`: General purpose knowledge base
- `research_papers.yml`: Optimized for academic papers
- `technical_docs.yml`: Configured for technical documentation

You can use these as starting points for your own configurations:```bash
python -m kb_builder build --input /path/to/documents --config src/kb_builder/configs/technical_docs.yml

# Or use a storage-specific configuration
python -m kb_builder build --input /path/to/documents --config src/kb_builder/configs/postgres-pgvector.yml

Advanced Features

Knowledge Graph Capabilities

The MCP server leverages txtai's built-in graph functionality to provide powerful knowledge graph capabilities:

  • Automatic Graph Construction: Build knowledge graphs from your documents automatically
  • Graph Traversal: Navigate through related concepts and documents
  • Path Finding: Discover connections between different pieces of information
  • Community Detection: Identify clusters of related information

Causal Boosting Mechanism

The MCP server includes a sophisticated causal boosting mechanism that enhances search relevance by identifying and prioritizing causal relationships:

  • Pattern Recognition: Detects causal language patterns in both queries and documents
  • Multilingual Support: Automatically applies appropriate patterns based on detected query language
  • Configurable Boost Multipliers: Different types of causal matches receive customizable boost factors
  • Enhanced Relevance: Results that explain causal relationships are prioritized in search results

This mechanism significantly improves responses to "why" and "how" questions by surfacing content that explains relationships between concepts. The causal boosting configuration is highly customizable through YAML files, allowing adaptation to different domains and languages.

License

MIT License - see LICENSE file for details

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
Knowledge Base 怎么安装?

在客户端按下面的安装命令接入:pip install kb-mcp-server\"。装完在客户端配置里引用同一个包或端点。

Knowledge Base 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Knowledge Base 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Knowledge Base 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

Knowledge Base 能提供哪些能力?

资料显示能力标签包括 本地AI、搜索、Python、文本处理、知识图谱。具体工具清单以官方文档为准。

Knowledge Base 需要什么运行环境?

运行时为 Python;属于本地进程,需要在本机装好运行环境。

Knowledge Base 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。