BM 25 Search
БесплатноНе проверенMCP server and CLI for BM25 keyword search over a local Markdown corpus — drop .md files into data/ and query from any MCP-compatible client or the command line
Описание
MCP server and CLI for BM25 keyword search over a local Markdown corpus — drop .md files into data/ and query from any MCP-compatible client or the command line.
README
A lightweight BM25 search server for querying a folder of Markdown files, exposed as an MCP server.
Repository layout
bm-25/
├── mcp_server.py # MCP server exposing the `search` tool over stdio
├── search.py # BM25 indexing + search logic (also usable as a CLI)
├── requirements.txt # Python dependencies
└── data/ # Place your .md files here
├── information_retrieval.md
├── machine_learning.md
└── python_intro.md
Setup
Install Python 3.9+ (if not already installed).
Install dependencies:
pip install -r requirements.txt
Usage
MCP server
Run the server over stdio:
python mcp_server.py
It registers a single tool, search(query: str, top_n: int = 3), which returns the top-N BM25 matches (score, path, line range, and chunk text) from the markdown corpus in data/. OpenTelemetry spans are emitted to stderr so stdout stays clean for JSON-RPC.
Example client config (e.g. ~/.config/claude/mcp.json or equivalent):
{
"mcpServers": {
"bm25-search": {
"command": "python",
"args": ["/absolute/path/to/bm-25/mcp_server.py"]
}
}
}
Docker
Build the image:
docker build -t bm25-mcp-server .
Configure Claude Desktop to use the containerized server (in claude_desktop_config.json):
{
"mcpServers": {
"bm25-search": {
"command": "docker",
"args": ["run", "-i", "--rm", "bm25-mcp-server"]
}
}
}
CLI: interactive mode
Run the script without arguments to enter an interactive query loop:
python search.py
Loading documents from '.../data' …
Indexed 3 document(s): ['information_retrieval.md', 'machine_learning.md', 'python_intro.md']
Enter a search query (or 'quit' to exit):
> machine learning algorithms
1. machine_learning.md (score: 0.4210)
2. python_intro.md (score: 0.1898)
3. information_retrieval.md (score: 0.0751)
> quit
CLI: single-query mode
Pass a query directly on the command line:
python search.py "BM25 ranking"
Loading documents from '.../data' …
Indexed 3 document(s): ['information_retrieval.md', 'machine_learning.md', 'python_intro.md']
Query: 'BM25 ranking'
1. information_retrieval.md (score: 1.6854)
Adding your own documents
Drop any .md files into the data/ directory.
They are automatically discovered and indexed the next time search.py is run.
How it works
- All
.mdfiles indata/are read and tokenized (lowercased, punctuation stripped). - A BM25Okapi index is built over the token lists.
- Each query is tokenised the same way, and the top-scoring documents are returned.
BM25 key parameters (can be tuned inside search.py):
| Parameter | Default | Effect |
|---|---|---|
k1 |
1.5 | Term-frequency saturation |
b |
0.75 | Document-length normalization |
Установка BM 25 Search
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/Mandoa-Labs/BM-25-SearchFAQ
BM 25 Search MCP бесплатный?
Да, BM 25 Search MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для BM 25 Search?
Нет, BM 25 Search работает без API-ключей и переменных окружения.
BM 25 Search — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить BM 25 Search в Claude Desktop, Claude Code или Cursor?
Открой BM 25 Search на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare BM 25 Search with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
