Building a local MCP server inside a Rust desktop app
Описание и применение
Встроенный локальный сервер MCP в приложении AssetHoard обеспечивает безопасное и мгновенное взаимодействие ассетов с ИИ-ассистентами, используя HTTP и общий API, предотвращая повреждение базы данных и обеспечивая синхронизацию UI.
Задача
Integrating a local MCP server into a desktop asset manager without corrupting the SQLite database or losing UI sync.
Результат
The embedded MCP server allows real-time, safe asset manipulation via AI assistants while maintaining database integrity and UI responsiveness.
Рабочий процесс
- Run AssetHoard with MCP server enabled via Settings toggle
- MCP server listens on 127.0.0.1:47823 with a bearer token
- Client (Claude, VS Code, etc.) sends HTTP requests with token header
- Server forwards requests to internal library API, performing validation, audit logging, and undo stack entries
- Responses include text results, thumbnails, deep links, and error messages
- Client displays results and updates UI in real time
Доказательства
The server runs inside AssetHoard and only answers while the app is open.
MCP never touches the database
The port is fixed at 47823 by default. It is configurable, but the app never picks another one on its own if it is busy.
- Дата записи: 2026-10-13T05:55:53.783Z