local-os-brain
Локальный ассистент ОС & второй мозг (MCP & OpenAI)
Автономный кроссплатформенный локальный настольный ассистент на базе Model Context Protocol (MCP) и OpenAI (gpt-4o). Он безопасно выполняет локальные системные команды, читает и записывает файлы, отслеживает диагностику оборудования и запоминает контекст проекта между сеансами с помощью локальной базы данных SQLite (brain.db).
Возможности
MCP FastMCP Server (
server.py):read_local_file: Безопасно читает текстовое содержимое локальных файлов.write_local_file: Записывает содержимое в локальные файлы, автоматически создавая недостающие каталоги.list_directory: Форматированный просмотр каталога с указанием размера и типа файлов.execute_terminal_command: Выполняет команды оболочки с защитными подсказками для опасных ключевых слов (rm,del,rmdir,format,drop).open_application_or_url: Запускает настольные приложения или открывает URL-адреса в браузере по умолчанию на всех платформах (Windows, macOS, Linux).get_system_metrics: Получает диагностику в реальном времени: CPU, RAM, диск и батарея с помощьюpsutil.save_memory: Сохраняет заметки пользователя, контекст стека проекта и предпочтения в SQLitebrain.db.search_memory: Полнотекстовый поиск и поиск по шаблону по сохранённым воспоминаниям.
Интерактивный терминальный ассистент (
client.py):Динамическое обнаружение инструментов через MCP stdio transport.
Загрузка памяти при запуске из
brain.db.Постоянное приглашение CLI REPL (
You >/Brain >).
Готов к Claude Desktop (
claude_desktop_config.json):Готовый к использованию файл конфигурации для интеграции с Claude Desktop.
Related MCP server: Desktop Commander MCP
Установка и настройка
Предварительные требования
Python 3.10 или выше.
Ключ API OpenAI (
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"
]
}
}
}Примечание: Замените "python" на абсолютный путь к исполняемому файлу Python вашего виртуального окружения, если вы используете venv.
Структура проекта
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