Skip to main content

AI cross-context synchronization layer — shared knowledge base MCP server for Claude Code, Copilot, and Codex

Project description

kb

複数プロジェクト × 複数AIの共通コンテキスト基盤。ローカルMCPサーバーとして動作する。

技術スタック

  • Python + uv
  • MCP SDK(公式Python版)
  • Obsidian CLI 1.12+
  • git

Installation

Prerequisites

  • uv
  • Obsidian 1.12+ (CLI 有効化: Settings > General > Advanced > Command Line Interface)

1. Install

uv tool install kb-mcp

2. Setup

kb-mcp setup

対話形式で以下を設定:

  • Obsidian Vault のパス(新規作成 or 既存 Vault に統合)
  • タイムゾーン

設定は ~/.config/kb/config.yml に保存される。

3. MCP サーバー登録

使用する AI ツールに合わせて登録する。複数ツールから同じ kb-mcp を共有できる。

Claude Code

claude mcp add kb --scope user -- kb-mcp serve

Codex CLI

~/.codex/config.tomlCODEX_HOME 設定時はそちら)に追加:

[mcp_servers.kb]
command = "kb-mcp"
args = ["serve"]

GitHub Copilot CLI

~/.copilot/mcp-config.jsonCOPILOT_HOME 設定時はそちら)を作成(または追記):

{
  "mcpServers": {
    "kb": {
      "command": "kb-mcp",
      "args": ["serve"]
    }
  }
}

4. Hooks インストール(オプション)

kb-mcp install hooks --all                 # 全ツールにフック配置

5. 動作確認

kb-mcp doctor

データ配置

ノートはこのリポジトリには含まれない。kb-mcp setup で設定した Obsidian Vault に保存される。

<vault_path>/<kb_root>/
  projects/<project-name>/
    adr/            # 意思決定ログ
    gap/            # AI指摘 → 本当はどうしてほしかったか
    session-log/    # セッションログ
    knowledge/      # 開発中に得た知識
    draft/          # やりたいこと・アイデアメモ
  inbox/            # プロジェクトに紐づかないアイデア
  general/
    knowledge/      # プロジェクト横断の共通知見
    requirements/   # ユーザーがAIに求めることの集約

MCP Tools

tool 役割
kb_init プロジェクト初期化
kb_adr 意思決定ログ保存
kb_gap 反省記録保存
kb_knowledge 知識保存
kb_session セッションログ保存
kb_draft アイデア・やりたいことメモ
kb_search 検索
kb_read ノート読み込み
kb_lint ルール整合性チェック
kb_organize リンク候補の発見・提案
kb_graduate general/への昇格提案

CLI コマンド

コマンド 役割
kb-mcp setup 初期設定(Vault パス、タイムゾーン)
kb-mcp serve MCP サーバー起動
kb-mcp config get <key> 設定値取得
kb-mcp install hooks フック配置
kb-mcp doctor 環境診断

ファイル命名

  • adr / gap / knowledge / draft: {slug}--{ULID}.md
  • session-log: {yyyymmdd-hhmm}--{ULID}.md

frontmatter

---
id: ULID
summary: 要約
ai_tool: claude | copilot | codex
ai_client: claude-code | copilot-cli | codex-cli  # optional
repo: github.com/owner/repo  # optional
tags: []                      # optional
related: []                   # optional
status: accepted              # ADR用 optional
created: YYYY-MM-DDTHH:MM+09:00
updated: YYYY-MM-DDTHH:MM+09:00
---

ライセンス

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kb_mcp-0.3.0.tar.gz (71.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kb_mcp-0.3.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file kb_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: kb_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 71.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kb_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7699f0c99ab9f61f65f8326654b2e0180fb0b2d70248b56705f3e2779c8a3c3c
MD5 3ed5cfc754cbeaf5359ea491b048d87c
BLAKE2b-256 2d3e869f75331c0fa7d109e8921a7bbf13b764b78169f0161c689389ce5756ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for kb_mcp-0.3.0.tar.gz:

Publisher: publish.yml on okash1n/kb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kb_mcp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: kb_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kb_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a94a401437427baf896eb38e2173781c4d42d9253974829a450d6f26838a2ab
MD5 9f018df008f4e69d1b5d193ab65fa981
BLAKE2b-256 e403fbe759a8a1b512b591e254317607089e0b5bb9d4708634dac15861d8b47b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kb_mcp-0.3.0-py3-none-any.whl:

Publisher: publish.yml on okash1n/kb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page