Skip to main content
Glama
xuj1nfan

terminal_kb

by xuj1nfan

Terminal Knowledge Base

ターミナルのみを対象としたローカル知識ベースで、PDF、Markdown ノート、論文執筆のエビデンスを管理します。Obsidian や Zotero に依存せず、CLI、スクリプト、MCP エージェントから直接利用できます。

特徴

  • SQLite FTS5 による全文検索で、中国語と英語に対応

  • PDF をページ単位で解析し、citekey・ページ番号・原文の抜粋を返します

  • Markdown ノートを再帰的にインポートし、安定した citekey を保持します

  • BibTeX 書誌ファイルと研究ドラフトのディレクトリ

  • stdio 上の JSON-RPC MCP サーバーにより、Codex などのターミナルエージェントに接続可能

  • LanceDB + Sentence Transformers によるオプションのベクトルインデックス

  • すべてのインデックスと解析結果はローカルで再構築可能なファイルです

Related MCP server: search-docs

動作環境

  • Linux/macOS

  • Python 3.11+

  • pdftotextpdfinfopdftoppmpoppler の導入を推奨)

基本的な全文検索に追加の Python 依存関係は不要です。Python 3.12 の仮想環境と uv を推奨します。

uv python install 3.12
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python -e .

オプションの依存:

# 向量检索(CPU 环境)
uv pip install --python .venv/bin/python lancedb sentence-transformers

# 更复杂的 PDF 版面、表格和公式解析
uv pip install --python .venv/bin/python docling

NVIDIA カード以外の場合:

uv pip install --python .venv/bin/python \
  torch==2.6.0+cpu \
  --index-url https://download.pytorch.org/whl/cpu

クイックスタート

./kb init
./kb add ~/Books/paper.pdf --title "Paper title" --author "Doe, Jane" --year 2024
./kb add ~/notes/method.md --title "Method notes"
./kb index --all
./kb search "retrieval augmented generation" --limit 5

よく使うコマンド:

./kb status
./kb doctor
./kb show <citekey> --page 2
./kb passage --citekey <citekey> --page 2
./kb cite <citekey> --page 2
./kb page-image <citekey> 2 --dpi 150

論文の引用形式は、[@citekey, p. 2] です。

既存ディレクトリのインポート

kb add でファイルを1つずつ追加できます。多数のファイルを一括でインポートする場合はシェルを使います:

find ~/Books/final -type f \( -iname '*.pdf' -o -iname '*.md' \) -print0 |
  while IFS= read -r -d '' file; do
    ./kb add "$file"
  done
./kb index --all --force

MCP エージェントとの連携

serve-mcp は stdin/stdout で JSON-RPC を転送するため、追加の MCP SDK は必要ありません:

[mcp_servers.terminal_kb]
command = "/absolute/path/to/knowledge-base/kb"
args = ["--root", "/absolute/path/to/knowledge-base", "serve-mcp"]

提供されるツールは以下の通りです:

  • search_library: PDF と Markdown のエビデンスを検索

  • get_passage: ページ番号付きの正確な引用を取得

  • get_document: ドキュメントのメタデータとステータスを表示

  • get_page_image: PDF ページをレンダリングして数式・表・図を確認

  • スクリプトでエビデンスを探す: find_evidence

  • index_status: インデックスの状態を確認

ベクトル検索

ベクトルインデックスはオプション機能で、.kb/config.toml で有効にします:

enable_vectors = true
embedding_model = "BAAI/bge-small-zh-v1.5"

その後、再構築します:

./kb index --all --force

初回実行時に Hugging Face からモデルをダウンロードします。

検証

./kb doctor
.venv/bin/python -m unittest discover -s tests -v
Install Server
F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to search local Markdown documents using natural language, with automatic indexing and section-level retrieval.
    9
    2
    1
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    A local-first document retrieval engine that mounts as an MCP tool for agents to index files, search for relevant passages, and let the agent's own LLM answer.
    4
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to search, read, and traverse a local knowledge base of Markdown files using full-text search and relationship graph, reducing token usage.
    MIT

View all related MCP servers

Related MCP Connectors

  • Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.

  • Token-efficient search for coding agents over public and private documentation.

  • Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xuj1nfan/knowledge_base'

If you have feedback or need assistance with the MCP directory API, please join our Discord server