Embedding MCP Server
About
Integrates with knowledge bases to enable searching, retrieving, and potentially updating information from structured repositories for enhanced information access workflows.
Details
- Author
- geeksfino
- Repository
- Geeksfino/kb-mcp-server
- GitHub stars
- 33
- Downloads
- 463
- License
- MIT License
- Categories
- Search, Knowledge Base, Other, AI, Productivity, Developer Tools, Design, Workplace, File Management, Frontend, Infrastructure
- Tags
- #vector-search, #embeddings
Jump to
- Unified vector database combining vector indexes, graph networks, and relational databases.
- Semantic search based on meaning, not keywords.
- Knowledge graph integration for automatic building and querying.
- Portable knowledge bases as compressed archives (.tar.gz).
- Local-first architecture; no data sent to external services.
- Extensible pipeline system for text, documents, audio, images, and video.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Embedding MCP ServerCommand (node, npx, python, etc.)pythonArguments-
Argument 1
-m -
Argument 2
txtai_mcp_server -
Argument 3
--embeddings -
Argument 4
/path/to/knowledge_base.tar.gz -
Argument 5
--enable-causal-boost
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
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 examplemcp_config.json:
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
{ "mcpServers": { "kb-server": { "command": "/your/home/project/.venv/bin/kb-mcp-server", "args": ](https://github.com/astral-sh/uv)[ "--embeddings", "/path/to/knowledge_base.tar.gz" ], "cwd": "/path/to/working/directory" } } }
If you use your system default Python, you can use the following configuration:
{ "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
<?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>
sudo launchctl load -w /Library/LaunchAgents/environment.plist
You'll need to restart your computer for this to take effect, though.
{ "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.
Building a knowledge base with txtai requires a YAML configuration file that controls various aspects of the embedding process. This configuration is used by thekb_buildertool, 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:
# 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
Thesrc/kb_builder/configsdirectory contains configuration templates for different use cases and storage backends:
- 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)
- 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:
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
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
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.
MIT License - see LICENSE file for details
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
A powerful Model Context Protocol (MCP) server using gemini embedding 3 that transforms any local directory into an ultrafast, visually-aware spatial search engine for AI agents.
A local, high-performance memory server for AI agents, built with SQLite, vector embeddings, and a knowledge graph. Packaged for npm and Docker.
Persistent visual cache for LLM-driven software development. Caches screenshots using perceptual hashing, vector search, and AX trees to prevent token overhead and visual hallucination loops.
Discovery & reputation layer for AI agents: semantic search over 15,000+ agents and MCP servers, cross-registry reputation, remote MCP over Streamable HTTP, no auth.
An MCP server providing semantic search capabilities for APLCart data.
MCP server for Christian scholarship and research — scripture, Greek/Hebrew word data, cross-references, patristic texts, and semantic search,
Access and search EPUB ebook collections using semantic vector search.
Semantic search for Hex package documentation. Requires local Elixir and Mix installation.
local-first semantic search in Lojban dictionaries
Search 419,000+ space regulatory filings from the FCC, ITU, UNOOSA, and FAA-AST — semantic search, entity dossiers, spectrum holdings, launch licenses, and alerts.
kb-build
Build a knowledge base from documents. Parameters: --input (path to documents), --config (YAML configuration file)
kb-search
Search a knowledge base. Parameters: path to knowledge_base, search query (string), optional parameters for graph enhancement and limit.
kb-mcp-server
Start the MCP server with a specific knowledge base folder or archive. Parameters: --embeddings (path to knowledge base folder or .tar.gz), --host (optional host address), --port (optional port number).
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"embedding mcp server": {
"cwd": "/path/to/working/directory",
"env": {},
"args": [
"-m",
"txtai_mcp_server",
"--embeddings",
"/path/to/knowledge_base.tar.gz",
"--enable-causal-boost"
],
"command": "python"
}
}
}
Linux
{
"cwd": "/path/to/working/directory",
"env": [],
"args": [
"-m",
"txtai_mcp_server",
"--embeddings",
"/path/to/knowledge_base.tar.gz",
"--enable-causal-boost"
],
"command": "python"
}
Macos
{
"cwd": "/path/to/working/directory",
"env": [],
"args": [
"-m",
"txtai_mcp_server",
"--embeddings",
"/path/to/knowledge_base.tar.gz",
"--enable-causal-boost"
],
"command": "python"
}
Windows
{
"cwd": "/path/to/working/directory",
"env": [],
"args": [
"-m",
"txtai_mcp_server",
"--embeddings",
"/path/to/knowledge_base.tar.gz",
"--enable-causal-boost"
],
"command": "python"
}
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 leveragestxtai, 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
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
Thekb_buildermodule 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.
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
We recommend usinguvwith Python 3.10 or newer for the best experience. This provides better dependency management and ensures consistent behavior.
# 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 abouttransformers.agents.toolsthat 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.
# 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
# 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 .
# 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 .
uvxallows you to run packages directly from PyPI without installing them:
# 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"
You can use the command-line tools installed from PyPI, the Python module directly, or the convenient shell scripts:
# 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
# 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
# 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
The repository includes convenient wrapper scripts that make it easier to build and search knowledge bases:
# 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 --helpor./scripts/kb_search.sh --helpfor more options.
# 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
# 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
# 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
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:
# 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
- --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 examplemcp_config.json:
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
{ "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" } } }
If you use your system default Python, you can use the following configuration:
{ "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
<?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>
sudo launchctl load -w /Library/LaunchAgents/environment.plist
You'll need to restart your computer for this to take effect, though.
{ "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.
Building a knowledge base with txtai requires a YAML configuration file that controls various aspects of the embedding process. This configuration is used by thekb_buildertool, 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:
# 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
Thesrc/kb_builder/configsdirectory contains configuration templates for different use cases and storage backends:
- 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)
- 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:
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
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
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.
MIT License - see LICENSE file for details
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
A powerful Model Context Protocol (MCP) server using gemini embedding 3 that transforms any local directory into an ultrafast, visually-aware spatial search engine for AI agents.
A local, high-performance memory server for AI agents, built with SQLite, vector embeddings, and a knowledge graph. Packaged for npm and Docker.
Persistent visual cache for LLM-driven software development. Caches screenshots using perceptual hashing, vector search, and AX trees to prevent token overhead and visual hallucination loops.
Discovery & reputation layer for AI agents: semantic search over 15,000+ agents and MCP servers, cross-registry reputation, remote MCP over Streamable HTTP, no auth.
An MCP server providing semantic search capabilities for APLCart data.
MCP server for Christian scholarship and research — scripture, Greek/Hebrew word data, cross-references, patristic texts, and semantic search,
Access and search EPUB ebook collections using semantic vector search.
Semantic search for Hex package documentation. Requires local Elixir and Mix installation.
local-first semantic search in Lojban dictionaries
Search 419,000+ space regulatory filings from the FCC, ITU, UNOOSA, and FAA-AST — semantic search, entity dossiers, spectrum holdings, launch licenses, and alerts.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




