SQLite Project Memory MCP
SQLite Project Memory MCP
プロジェクトのメモリをグラフフレンドリーなリレーショナルコアとして保存するためのSQLiteベースのMCPサーバー。
このプロジェクトの目的
SQLiteに信頼できる唯一の情報源(Single Source of Truth)として状態を保持します。
グラフセマンティクス(
entities、relationships、content、tags)を提供します。構造化された読み取り(
query_view)と、明示的に生成されたMarkdownビューをサポートします。AIエージェントにとって安全なワークフローを想定して設計されています。
Related MCP server: @contextable/mcp
コアモデル
entitiesattributesrelationshipscontenttagsevents、snapshots、snapshot_entities(監査/履歴)
サポートされている sync-document ターゲット
コアドキュメント:
architecture、decisions、plan、notes、roadmap拡張ドキュメント:
kpi、okr、strategy、risk、issue、epic、story、feature、milestone、release、dependency、objective、initiative、metric、capability、assumption、problem_statement、retrospective、action_item
インストール
リポジトリをプロジェクトの sqlite-mcp サブフォルダーにクローンし、インストーラーを一度実行します。
スクリプトは自身の場所を検出し、すべてのランタイムファイルを Project Memory/ 内に配置し、.vscode/mcp.json を書き込みます。
Pythonのインストールは不要です。 インストーラーは uv をダウンロードし、それを使用して固定されたCPython 3.12.9インタープリターを自動的に取得します。インタープリターは Project Memory/.uv/python/ にキャッシュされ、仮想環境は Project Memory/.venv に作成されます。
uv のダウンロードが失敗した場合(ファイアウォールの背後など)、インストーラーはマシン上に既に存在するPython 3.11+にフォールバックします。
重要: VS Codeは sqlite-mcp サブフォルダーではなく、プロジェクトのルート(親フォルダー)で開いてください。
MCP設定はプロジェクトルートの .vscode/mcp.json に書き込まれます。
Windows (PowerShell)
# from your project root
git clone https://github.com/WebRTCGame/SQLITE-MCP.git sqlite-mcp
.\sqlite-mcp\install.ps1オプションフラグ:
-LogFile install.log— デバッグ用に完全なトランスクリプトを保存します-AppendInstructions— 推奨される指示ファイルにスニペットを追記します(冪等)
Linux / macOS
# from your project root
git clone https://github.com/WebRTCGame/SQLITE-MCP.git sqlite-mcp
chmod +x ./sqlite-mcp/install.sh
./sqlite-mcp/install.shオプションフラグ:
--log-file install.log— デバッグ用に完全なトランスクリプトを保存します--append-instructions— 推奨される指示ファイルにスニペットを追記します(冪等)
更新方法: ネストされたインストールが成功した後、スクリプトは Project Memory/ 配下に存在します(sqlite-mcp のチェックアウトがそこに移動されるため)。プロジェクトルートから Project Memory\install.ps1 (Windows) または Project Memory/install.sh (Linux/macOS) を使用してインストーラーを再実行してください。インプレース/開発者インストールの場合も、同じコマンドを再実行します。
pipのみ(開発者/上級者向け)
環境を自分で管理したい場合に使用します(Python 3.11+が必要):
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\Activate.ps1 on Windows
pip install -e .または uv を直接使用する場合(システムPythonは不要 — uv が自動的にPythonをダウンロードします):
uv venv --python 3.12.9 .venv
uv pip install -e .完全な例:
./sqlite-mcp/install.shサーバーの起動
& ".\Project Memory\.venv\Scripts\python.exe" -m sqlite_mcp_serverパス
Project Memory/.venv— 仮想環境(固定されたPython 3.12.9)Project Memory/.uv/bin/uv[.exe]—uvランタイムマネージャー(インストーラーによってダウンロード)Project Memory/.uv/python/— 固定されたCPythonインタープリター(初回実行時にuvが取得)Project Memory/pm_data/project_memory.dbProject Memory/pm_exports.vscode/mcp.json.vscode/settings.jsonは、Copilot/VS Codeによってsqlite-project-memory用のchat.mcp.serverSamplingエントリと共に自動的に作成される場合があります。これは想定通りの動作です。
固定されたPythonバージョンを上書きするには:
$env:SQLITE_MCP_PYTHON_VERSION = "3.13.0"; .\sqlite-mcp\install.ps1SQLITE_MCP_PYTHON_VERSION=3.13.0 ./sqlite-mcp/install.shCLIツール
sqlite-project-memory-admin bootstrap-self --repo-root .
sqlite-project-memory-admin project-state
sqlite-project-memory-admin health
sqlite-project-memory-admin sync-document architecture --input-path architecture.md
sqlite-project-memory-admin sync-document decisions --input-path decisions.md
sqlite-project-memory-admin sync-document roadmap --input-path roadmap.md
sqlite-project-memory-admin export-views --user-requested --request-reason "User asked for a roadmap export" --require-existing-dir exports todo roadmap architecture
sqlite-project-memory-admin export-views --user-requested --request-reason "User asked for refreshed generated docs" --force todo roadmap architecture
sqlite-project-memory-admin export-json --output-path exports/project_memory.snapshot.json
sqlite-project-memory-admin import-json --input-path exports/project_memory.snapshot.json設定
環境変数:
SQLITE_MCP_PROJECT_ROOTSQLITE_MCP_DB_PATHSQLITE_MCP_EXPORT_DIRSQLITE_MCP_TRANSPORT(stdioまたはstreamable-http)SQLITE_MCP_LOG_LEVEL(デフォルトはINFO)SQLITE_MCP_LOG_FORMAT(jsonまたはtext)
インストール後のフック
.scripts/post_install.ps1(PowerShell) または.scripts/post_install.shを作成します。インストールスクリプトは、フックが存在する場合にそれを実行します。
クイックスタート (Windows)
リポジトリをプロジェクトにクローンします。
インストーラーを実行します:
git clone https://github.com/WebRTCGame/SQLITE-MCP.git sqlite-mcp .\sqlite-mcp\install.ps1インストール後、VS Codeが
C:\CODE\TestProject\sqlite-mcpではなく、親プロジェクトルート(例:C:\CODE\TestProject)で開かれていることを確認してください。ランタイムvenvをアクティブ化します:
& ".\Project Memory\.venv\Scripts\Activate.ps1"自己診断を実行します:
sqlite-project-memory-admin --db-path "Project Memory/pm_data/project_memory.db" project-state sqlite-project-memory-admin --db-path "Project Memory/pm_data/project_memory.db" healthサーバーを起動します:
python -m sqlite_mcp_server
クイックスタート (Linux/macOS)
リポジトリをプロジェクトにクローンします。
インストーラーを実行します:
git clone https://github.com/WebRTCGame/SQLITE-MCP.git sqlite-mcp chmod +x ./sqlite-mcp/install.sh ./sqlite-mcp/install.shインストール後、VS Codeが
sqlite-mcpサブフォルダーではなく、親プロジェクトルートで開かれていることを確認してください。ランタイムvenvをアクティブ化します:
source "Project Memory/.venv/bin/activate"自己診断を実行します:
sqlite-project-memory-admin --db-path "Project Memory/pm_data/project_memory.db" project-state sqlite-project-memory-admin --db-path "Project Memory/pm_data/project_memory.db" healthサーバーを起動します:
python -m sqlite_mcp_server
注意事項
render_markdown_views/export_markdown_viewsにはuser_requested=trueとrequest_reasonが必要です。sync-documentはアンカーされています(ロードマップの状態に非構造化のフリーテキストレコードはありません)。project_stateとhealthが主要な診断情報です。
AIファースト設計
エンティティ/コンテンツはMCPツールを通じて書き込みます。
ドキュメントはユーザーの明示的な要求があった場合にのみ生成します。
プロジェクトへのAI指示の追加
インストーラーを実行した後、以下のスニペットをAI指示ファイル(copilot-instructions.md、AGENTS.md、CLAUDE.md など)に貼り付けてください。
インストーラーは、リマインダーとしてこのスニペットをターミナルにも出力します。
## SQLite Project Memory
This project uses the **`sqlite-project-memory` MCP server** as the single source of truth for all project state.
### Mandatory rules
- **NEVER** create, modify, or delete `.md` files for notes, tasks, decisions, roadmaps, or architecture.
- **ALWAYS** use `sqlite-project-memory` MCP tools to store and retrieve project knowledge.
- `README.md` is the **only** markdown file you may edit directly.
- Files in `Project Memory/pm_exports/` are read-only derived artifacts — never edit them directly.
### Tool usage guide
| Intent | Tool to use |
|--------|-------------|
| Add a task / todo | `create_entity` (entity_type: `task`) |
| Record a decision | `create_entity` (entity_type: `decision`) |
| Document a component | `create_entity` (entity_type: `component`) + `write_content` |
| Add a note to an item | `write_content` or `append_content` |
| Query project state | `query_view`, `list_entities`, `get_entity` |
| Search knowledge | `search_content` |
| Link two items | `add_relationship` or `connect_entities` |
| Export to markdown | `export_markdown_views` with `user_requested: true` — only when explicitly asked |
### First action each session
Before making changes, call `get_project_context` to confirm the database path and project root, then call `get_recent_activity` or `query_view` to orient yourself.使用ゲートチェックリスト
信頼性を最大限に高めるため、以下をすべて確認してください:
.vscode/mcp.jsonにsqlite-project-memoryサーバーが含まれていること。このワークスペースに対してVS CodeのMCP承認/信頼プロンプトが許可されていること。
チャットがエージェントモードになっていること(通常のチャット/編集モードではない)。
エージェントのドロップダウンで
Project Memoryエージェントが利用可能であること。スラッシュコマンドで
/sqlite-project-memoryスキルが利用可能であること。プロジェクトの指示ファイルにSQLite Project Memoryのスニペットが含まれていること。
各セッションの開始時に
get_project_contextを実行し、次にget_recent_activityまたはquery_viewを実行すること。
インストーラーは、自動的に検証可能なゲートについて PASS または ACTION REQUIRED を含む Usage Gates Report を出力します。
ツールが表示されない場合は、まずVS Codeを完全にリロードまたは再起動し、新しいエージェントチャットセッションを開始してください。
再起動後にサーバーが実行されていない場合は、コマンドパレットから MCP: Start Server を実行し、sqlite-project-memory を選択して、チャットセッションを再起動してください。
Available Tools
41 toolsadd_relationshipC
Create a typed graph edge between two entities.
Inputs: relationship_id (required), from_entity (required), to_entity (required), relationship_type (required). Returns: object
append_contentD
Add a piece of content to an entity.
Inputs: entity_id (required), content_type (required), body (required), content_id. Returns: object
apply_performance_tuningC
Tune SQLite settings for throughput during heavy project-memory workloads.
Inputs: journal_mode, synchronous, temp_store, cache_size, +2 more. Returns: object
archive_entityA
Archive an entity without deleting its history or related project memory.
Inputs: entity_id (required), reason, archived_status. Returns: object
bootstrap_project_memoryC
Initialize a project root entity and standard memory-area anchor entities.
Inputs: project_id (required), project_name (required), description, tags. Returns: object
connect_entitiesC
Create a relationship if missing, otherwise return the existing edge.
Inputs: from_entity (required), to_entity (required), relationship_type (required), relationship_id. Returns: object
create_entityC
Create a new authoritative project entity.
Inputs: entity_id (required), entity_type (required), name, description, +3 more. Returns: object
create_snapshotC
Create a named snapshot of current project state.
Inputs: snapshot_id (required), name (required), description, entity_ids. Returns: object
delete_entityA
Delete an entity with guardrails; non-forced deletion requires prior archiving and no critical dependents.
Inputs: entity_id (required), force. Returns: object
delete_relationshipB
Delete a relationship by id and record the removal in project history.
Inputs: relationship_id (required). Returns: object
export_markdown_viewsB
Write generated markdown views only after an explicit user request for a human-readable artifact.
Inputs: view_names, output_dir, overwrite, require_existing_dir, +2 more. Returns: object
find_similar_entitiesB
Find likely duplicate or related entities before creating a new one.
Inputs: name (required), entity_type, limit. Returns: result
get_architecture_summaryB
Return a compact architecture-oriented node and relationship summary.
Inputs: node_limit, relationship_limit, compact. Returns: object
get_database_healthB
Report likely duplicates, low-quality records, and retention pressure in project memory.
Inputs: limit. Returns: object
get_decision_logB
Return decisions and recent supporting note excerpts without requiring ad hoc SQL.
Inputs: limit, offset, compact. Returns: object
get_dependency_viewC
Return dependency-oriented graph data with stable compact fields.
Inputs: root_entity_id, max_depth, relationship_types, limit, +1 more. Returns: object
get_entityC
Fetch an entity and optionally include related metadata, content, and events.
Inputs: entity_id (required), include_related. Returns: object
get_entity_graphC
Traverse outward relationship dependencies from an entity.
Inputs: entity_id (required), max_depth, relationship_type, edge_limit, +2 more. Returns: object
get_or_create_entityB
Reuse an exact entity when it already exists or create one with a generated stable id.
Inputs: entity_type (required), name (required), entity_id, description, +3 more. Returns: object
get_project_contextA
Return the current project root, DB path, and export directory.
Inputs: no named parameters. Returns: object
get_recent_activityC
Return recent entities, content, and events to help an AI resume context quickly.
Inputs: limit, offset, compact. Returns: object
get_recent_reasoningC
Return recent reasoning excerpts for quick AI context recovery.
Inputs: limit, offset, compact. Returns: object
get_snapshotB
Fetch a named snapshot and its captured entities.
Inputs: snapshot_id (required). Returns: object
list_entitiesC
List entities with optional type, status, attribute, tag, and text filters.
Inputs: entity_type, status, attribute_key, attribute_value, +4 more. Returns: result
list_relationshipsC
List graph edges, optionally constrained to an entity and direction.
Inputs: entity_id, relationship_type, direction, limit. Returns: result
list_viewsB
List available view names for query_view discovery.
Inputs: no named parameters. Returns: result
merge_entitiesB
Merge a duplicate source entity into a target entity with deterministic conflict handling.
Inputs: source_entity_id (required), target_entity_id (required), attribute_conflict. Returns: object
prune_content_retentionC
Prune older reasoning/log content while keeping the most recent records per entity and type.
Inputs: content_types, keep_latest, entity_id, dry_run. Returns: object
query_viewB
Query a named SQL view for generic reporting and model projections.
Inputs: view_name (required), params. Returns: object
refresh_task_summaryB
Rebuild a task summary materialized table for faster open task queries.
Inputs: no named parameters. Returns: object
render_markdown_viewsA
Render markdown document views only after an explicit user request for a human-readable artifact.
Inputs: view_names, user_requested, request_reason. Returns: object
resolve_entity_by_nameC
Resolve a human-readable name to an existing entity when possible.
Inputs: name (required), entity_type, limit. Returns: object
run_read_queryC
Run a constrained read-only SQL query for diagnostics, analytics, and ad hoc retrieval.
Inputs: sql (required), parameters, limit. Returns: object
search_contentC
Search narrative content using FTS5 when available.
Inputs: query (required), limit. Returns: result
server_infoB
Return server metadata and schema settings.
Inputs: no named parameters. Returns: object
set_project_rootB
Switch project context (root + db + export path) and reconnect database.
Inputs: project_root (required). Returns: object
set_tagsC
Set or merge tag labels for an entity.
Inputs: entity_id (required), tags (required), replace. Returns: object
update_entityC
Update an existing entity's top-level state.
Inputs: entity_id (required), name, description, status. Returns: object
upsert_attributesB
Create or update flexible metadata for an entity.
Inputs: entity_id (required), attributes (required), replace. Returns: object
upsert_entityC
Create an entity if missing or merge updates into an existing entity.
Inputs: entity_id (required), entity_type (required), name, description, +5 more. Returns: object
write_contentC
Write narrative content in one unified API with append|replace semantics.
Inputs: entity_id (required), mode (required), content (required), content_type (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
The tools cover distinct operations like entity management, graph relationships, content handling, and queries, but there is notable overlap in some areas. For example, create_entity, get_or_create_entity, and upsert_entity have overlapping purposes for entity creation, and append_content vs. write_content could cause confusion in content addition. Descriptions help clarify, but agents might misselect between these similar tools.
Most tools follow a consistent verb_noun or verb_adjective_noun pattern (e.g., create_entity, list_entities, get_entity_graph), with clear and descriptive names. There are minor deviations like server_info (noun_verb) and apply_performance_tuning (verb_noun_noun), but overall the naming is predictable and readable across the set.
With 41 tools, the count is excessive for a project memory server, leading to potential cognitive overload and inefficiency. While the domain is broad, many tools could be consolidated or streamlined (e.g., multiple entity creation tools, overlapping content tools), making it feel heavy and less well-scoped than ideal for agent use.
The tool set provides comprehensive coverage for project memory management, including full CRUD operations for entities and relationships, content handling, graph traversal, queries, snapshots, health checks, and context management. There are no obvious gaps; agents can perform all core workflows from initialization to archiving and reporting without dead ends.
Maintenance
Related MCP Connectors
Shared project memory for people and AI agents: documents, ERD, diagrams, boards, design mockups.
Project memory, documentation and controlled secret access for AI coding agents.
The system of record for AI agents — open-source (MIT) database where agents and people share data.
Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
Related MCP Servers
- AlicenseAqualityDmaintenanceA knowledge graph memory server using SQLite to provide persistent, isolated contexts for organizing information into searchable categories like work and personal projects. It features unique ID-based operations and a token-efficient serialization format designed to optimize interactions with LLMs.11MIT
- AlicenseNot gradedqualityDmaintenanceA persistent AI memory server that enables storage and retrieval of context and project artifacts across conversations. It features full-text search, version history, and automatic content chunking using local SQLite or hosted cloud storage.13 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceA persistent memory server for AI agents that stores structured notes in a local SQLite database with full-text search and graph-based relationships. It features 32 specialized tools for managing long-term context, including version history, automated TTL expiration, and complex filtering.12 npmMIT
- AlicenseNot gradedqualityDmaintenanceA database-backed MCP server that acts as a project memory bank, enabling AI assistants to store, retrieve, and search structured context like decisions, tasks, and architecture using SQLite and vector embeddings.Apache 2.0