local-os-brain
ローカルOSアシスタント&セカンドブレイン(MCP & OpenAI)
Model Context Protocol (MCP) と OpenAI(gpt-4o) を搭載した、自律型・クロスプラットフォーム対応のローカルデスクトップアシスタントです。ローカルシステムコマンドを安全に実行し、ファイルの読み書きを行い、ハードウェア診断を監視し、ローカルのSQLiteデータベース(brain.db)を使用してセッションをまたいだプロジェクトコンテキストを記憶します。
機能
MCP FastMCPサーバー(
server.py):read_local_file: ローカルファイルのテキスト内容を安全に読み取ります。write_local_file: ローカルファイルにコンテンツを書き込み、不足しているディレクトリを自動的に作成します。list_directory: サイズとファイルタイプの詳細を含む、フォーマット済みのディレクトリ情報を表示します。execute_terminal_command: 破壊的なキーワード(rm、del、rmdir、format、drop)に対する安全プロンプトのガードレール付きでシェルコマンドを実行します。open_application_or_url: デスクトップアプリケーションを起動するか、デフォルトのWebブラウザでURLを開きます(Windows、macOS、Linuxに対応)。get_system_metrics:psutilを使用して、CPU、RAM、ディスク、バッテリーのリアルタイム診断情報を取得します。save_memory: ユーザーノート、プロジェクトスタックコンテキスト、設定をSQLiteのbrain.dbに永続化します。search_memory: 保存されたメモリ全体を全文検索・パターン検索します。
対話型ターミナルアシスタント(
client.py):MCP stdioトランスポートによる動的なツール検出。
brain.dbからの起動時メモリハイドレーション。永続的なCLI REPLプロンプト(
You >/Brain >)。
Claude Desktop対応(
claude_desktop_config.json):Claude Desktopとの統合にすぐ使える設定ファイル。
Related MCP server: Desktop Commander MCP
インストールとセットアップ
前提条件
Python 3.10以上。
OpenAI APIキー(
OPENAI_API_KEY)。
1. 仮想環境のセットアップ
プロジェクトのルートディレクトリに移動し、仮想環境を作成します:
# Windows
python -m venv venv
venv\Scripts\activate
# macOS / Linux
python3 -m venv venv
source venv/bin/activate2. 依存関係のインストール
requirements.txt から固定された依存関係をインストールします:
pip install -r requirements.txt3. 環境設定
プロジェクトのルートディレクトリに .env ファイルを作成するか、環境変数を設定します:
OPENAI_API_KEY=your_openai_api_key_hereアシスタントの実行
オプションA: 対話型CLIクライアント
対話型アシスタントターミナルを起動します:
python client.pyセッション例:
You > Save a memory under key 'favorite_editor' value 'VS Code with Vim binding' tags ['preference', 'tools']
Brain > I've stored your preference for VS Code with Vim binding in the brain database.
You > What are my current system metrics?
Brain > Your system is running at 15.4% CPU usage with 12.2 GB / 32 GB RAM used and 78% battery remaining.オプションB: Claude Desktopとの統合
このローカルMCPサーバーを Claude Desktop で使用するには、claude_desktop_config.json の設定をClaude Desktopの設定ファイルに追加します:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
サーバー定義を追加します:
{
"mcpServers": {
"local-os-brain": {
"command": "python",
"args": [
"C:/Users/acer/.gemini/antigravity-ide/scratch/mcp_local_brain/server.py"
]
}
}
}注: venvを使用する場合は、"python" を仮想環境のPython実行ファイルの絶対パスに置き換えてください。
プロジェクト構造
mcp_local_brain/
├── brain.db # SQLite database auto-generated on first run
├── server.py # FastMCP Server with OS & Brain Tools
├── client.py # Interactive Terminal AI Assistant
├── claude_desktop_config.json # Claude Desktop configuration snippet
├── requirements.txt # Pinned python dependencies
└── README.md # Documentation & Setup Guideライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes local file I/O, a restricted shell whitelist, and SQLite helpers for safe integration with AI clients like Cursor and Claude Desktop.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to search, update, and manage files, run and control terminal commands and processes, execute code in memory, and work with Excel, PDF, and DOCX documents on local desktops.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to access the local machine over MCP for terminal commands, file operations, code search, process management, and reading or editing PDF, Excel, and Word documents, with no telemetry.394 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to perform sandboxed file-system operations, read-only SQLite querying and schema inspection, environment diagnostics, and cryptographic hashing over Stdio or HTTP using JSON-RPC.2MIT