LaptopAI-Agent
This MCP server exposes 12 tools for local system inspection, RAG search, paper integrity analysis, command output trimming, and browser history cleanup on a Windows laptop.
System monitoring:
system_status(CPU, memory, disk, battery),top_processes(top 10 by CPU).Git repo inspection:
list_gitrepos(all repos under C:\Gitrepos) andgit_status(status per named repo).Local knowledge base:
rag_queryfor semantic search over ingested documents.Paper integrity (AEGIS):
aegis_analyze_paper(full plagiarism/AI/citation/stylometry scan),aegis_check_citations(fast DOI/predatory-journal check),aegis_compare_papers(self-plagiarism/similarity between two files).Command execution with noise reduction (SignalTrim):
signaltrim_runruns a single non-compound build/test/install argv command and strips noise while preserving error lines;signaltrim_reportshows run history and token savings.Browser history hygiene:
browser_history_status(read-only discovery of profiles and running state) andbrowser_history_cleanup(backs up then clears history for closed profiles, skipping running browsers, with dry-run unlessconfirm=true, configurablebackup_rootandretention_days).
Backs up and then clears the browsing-history database of every locally installed Brave profile, snapshotting each closed profile via SQLite's backup API before deleting rows, skipping (never force-closing) profiles whose browser is running, and running automatically on a 15-day schedule.
Cleans Firefox browsing history in places.sqlite after backing the database up, deleting visit rows and un-bookmarked places while preserving bookmarked entries (only resetting their visit stats).
Read-only git introspection: lists all repositories under a configured root with their remote URLs and current branch, and runs git status --short for a named repo to surface uncommitted changes.
π€ LaptopAI-Agent
Personal Agentic AI for Laptop Management β Private, Secure, Offline-First
Zero API keys. Zero cloud calls. Full system control β with a cryptographic audit trail.
Built by Sunil Gentyala Β· IEEE Senior Member Β· HCL America Inc.
π§ What Is This?
LaptopAI-Agent is a fully local, privacy-first autonomous AI agent that manages and reasons about your laptop. It combines:
A LangGraph reasoning loop β multi-step planning with tool use, up to 10 agentic iterations per query
A local LLM via Ollama β default
qwen2.5-coder:7bfor high tool-calling accuracy, no internet requiredA ChromaDB RAG layer β ingest your git repos, configs, logs, and docs; retrieve relevant context at inference time
An MCP server β expose all tools to Claude Desktop / Claude Code over stdio
A SHA-256 chained audit log β append-only, tamper-evident JSONL record of every agent action
Ask it: "Which of my repos have uncommitted changes?" or "My disk is 87% full β what's taking space in C:\Gitrepos?" and it will reason, call tools, and respond β entirely on your machine.
Related MCP server: AgentLens
β‘ Quick Start
# 1. Pull the recommended local model
ollama pull qwen2.5-coder:7b
# 2. Install Python dependencies
pip install -r requirements.txt
# 3. Start chatting
python main.py chat
# 4. Check system health dashboard
python main.py status
# 5. List all git repos + remote URLs + branch
python main.py repos
# 6. Ingest documents into local RAG
python main.py ingest C:\Gitrepos\LaptopAI-Agent\docs
# 7. Start MCP server (for Claude Desktop / Claude Code)
python main.py mcp
# 8. Verify audit log chain integrity
python main.py verify-audit
# 9. Back up + clear browser history (Chrome/Edge/Brave/Firefox), also runs on a 15-day schedule
python main.py clean-browser-history --dry-runποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User / MCP Client β
β (CLI chat or Claude Desktop) β
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β query
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LangGraph Agent Loop β
β β
β ββββββββββββ tool_calls? ββββββββββββββββ β
β β agent β βββββββββββββββΊ β ToolNode β β
β β (LLM) β βββββββββββββββ β (LangChain) β β
β ββββββββββββ tool results ββββββββββββββββ β
β β β β
β max 10 iterations Permission Guard β
β β + Audit Log β
β βΌ β
β Final response β
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββΌβββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββ
β Ollama (LLM) β β ChromaDB (RAG) β β System Tools β
β β β β β β
β qwen2.5-coder:7b β β all-MiniLM-L6-v2 β β psutil, git, β
β localhost:11434 β β cosine similarity β β pathlib, subprocessβ
β temperature=0.1 β β 512-token chunks β β β
β NO API KEY β β 64-token overlap β β Permission Guard β
ββββββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββπ οΈ Available Tools
Every tool call is intercepted by the Permission Guard and written to the chained audit log.
Tool | Description | Permission |
| CPU %, memory %, disk free GB, battery %, boot time, platform | Read |
| All repos under | Read |
|
| Read (path check) |
| Top N processes ranked by CPU usage via psutil | Read |
| Read any text file β€ 2 MB from an allowed path | Read (allowlist) |
| Write content to a file in an allowed path | Write (allowlist) |
| Semantic search over ingested documents (top-k cosine hits) | Read |
MCP Tools (exposed to Claude Desktop / Claude Code)
MCP Tool | Description |
| CPU, memory, disk, battery snapshot |
| All repos with remote URLs |
| Status for a named repo |
| Top 10 processes by CPU |
| Semantic search over ingested knowledge base |
| Full AEGIS plagiarism/AI-detection/citation scan of a paper file |
| Fast citation-integrity-only scan (hallucinated DOIs, predatory journals) |
| Compare two paper files for self-plagiarism/similarity |
| Run a build/test/install command through SignalTrim, stripping noise from the output while guaranteeing error-shaped lines survive |
| View SignalTrim's run history and token-savings stats |
| Discover every browser profile with a history DB and whether it's currently running (read-only) |
| Back up then clear history for every closed browser profile (Chrome/Edge/Brave/Firefox); running browsers are skipped, never force-closed; requires |
πΆοΈ Browser History Hygiene
src/privacy/history_cleaner.py backs up then clears browsing history for
every locally installed browser profile (Chrome, Edge, Brave, Firefox),
and is registered as a Windows Scheduled Task ("LaptopAI Browser History
Cleanup") that fires every 15 days.
Backup before delete, always. Each closed profile's history DB is snapshotted via SQLite's own backup API into a timestamped folder under
Documents\BrowserHistoryBackupsbefore any row is touched. Old backup runs are pruned afterretention_days(default 180).Never touches a running browser. Chromium browsers hold their History file under an exclusive SQLite lock the entire time they're open, so any external read attempt fails outright β and a raw file copy could capture a torn mid-write snapshot. Rather than risk that (or force-close your browser), a profile that's currently running is skipped entirely for that cycle and reported as
browser_running; it gets swept up on the next run.Firefox keeps its bookmarks.
places.sqliteholds history and bookmarks in the same tables, so the Firefox path deletes visit rows and un-bookmarked places while preserving bookmarked entries (resetting only their visit stats) β the same scope as Firefox's own "Clear Browsing & Download History".
python main.py clean-browser-history --dry-run # preview only
python main.py clean-browser-history # back up + clear nowManage the schedule with scripts/register_browser_history_cleanup_task.ps1
(re-run to update it) or schtasks /Delete /TN "LaptopAI Browser History Cleanup" /F
to remove it.
π Security Model
LaptopAI-Agent is built on the assumption that a local agent with file-write access is a high-privilege process. Three controls enforce safe operation:
1. π‘οΈ Permission Guard
Every tool call passes through PermissionGuard before execution:
Allowed write paths: C:\Gitrepos, C:\Users\Sunil\Documents, C:\Users\Sunil\Desktop
Blocked paths: C:\Windows\System32, C:\Program Files
Allowed commands: git, python, pip, npm, node, powershell, Get-ChildItem, ...
Manual approval for: rm, Remove-Item, Format-*, reg delete
Max file write: 100 MB
Max execution time: 30 secondsAny violation raises PermissionError and the tool call is blocked β the LLM never sees the result.
2. π SHA-256 Chained Audit Log
Every agent action writes to logs/audit.jsonl as a hash chain β each entry commits the hash of the previous entry, making any historical modification detectable:
{
"timestamp": "2026-06-05T00:00:00+00:00",
"event_type": "TOOL_CALL",
"actor": "LaptopAI-Agent",
"action": "read_file",
"target": "C:\\Gitrepos\\ZKP-RA\\paper.tex",
"result": "32650 chars",
"prev_hash": "a3f1cc...",
"hash": "9d2c44..." // SHA-256(this entry + prev_hash)
}Verify the full chain integrity at any time:
python main.py verify-audit
# Chain valid (847 entries)3. π Zero External Calls
Component | Runs Where |
LLM inference | Locally via Ollama ( |
Embeddings | Locally via |
Vector store | Locally via ChromaDB ( |
Audit log | Locally ( |
No tokens, queries, files, or embeddings ever leave your machine.
π§© Claude Desktop / Claude Code Integration
Add to claude_desktop_config.json:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonMac:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"laptop-ai": {
"command": "python",
"args": ["C:\\Gitrepos\\LaptopAI-Agent\\main.py", "mcp"],
"cwd": "C:\\Gitrepos\\LaptopAI-Agent"
}
}
}Once connected, Claude can call system_status, list_gitrepos, git_status, top_processes, and rag_query directly from any conversation β with every call logged to the audit trail.
π RAG Knowledge Base
The RAG layer ingests .txt, .md, .log, .py, .yaml, and .json files using a sliding-window chunker with upsert deduplication:
Parameter | Value |
Vector DB | ChromaDB (persistent local) |
Embedding model |
|
Similarity metric | Cosine |
Chunk size | 512 tokens |
Chunk overlap | 64 tokens |
Deduplication | MD5 hash per |
Default top-k | 5 results |
# Ingest an entire directory recursively
python main.py ingest C:\Gitrepos
# Ask the agent a RAG-grounded question
python main.py chat
> What does the ZKP-RA circuit enforce at the policy layer?βοΈ Configuration
All behaviour is controlled by config.yaml β no code changes needed:
llm:
model: "qwen2.5-coder:7b" # swap to llama3.2, mistral, deepseek-r1, etc.
temperature: 0.1 # low = more deterministic tool calls
rag:
chunk_size: 512
chunk_overlap: 64
top_k: 5
security:
max_file_size_mb: 100
allowed_paths:
- "C:\\Gitrepos"
- "C:\\Users\\Sunil\\Documents"
blocked_paths:
- "C:\\Windows\\System32"
require_approval_for:
- "rm"
- "Remove-Item"
monitoring:
alert_cpu_percent: 90
alert_memory_percent: 85
alert_disk_percent: 80π Project Structure
LaptopAI-Agent/
βββ main.py # CLI entry point
βββ config.yaml # All runtime configuration
βββ requirements.txt
βββ src/
β βββ agent/
β β βββ graph.py # LangGraph StateGraph β agent β ToolNode loop (max 10 iters)
β β βββ tools.py # LangChain @tool definitions + PermissionGuard hooks
β βββ mcp/
β β βββ server.py # MCP stdio server β 12 tools exposed to Claude
β βββ rag/
β β βββ knowledge_base.py # ChromaDB ingestion + cosine semantic query
β βββ security/
β βββ audit.py # SHA-256 chained append-only audit logger
β βββ permissions.py # PermissionGuard β path, command, size enforcement
βββ data/
β βββ chroma_db/ # Local vector store (gitignored)
βββ logs/
βββ audit.jsonl # Tamper-evident audit trail (gitignored)π¬ Recommended Local Models
Model | Size | Strength |
| ~4.7 GB | Tool calling, code reasoning β default |
| ~2.0 GB | Lightweight, fast responses |
| ~4.1 GB | General reasoning, instruction following |
| ~4.7 GB | Multi-step planning, math |
ollama pull qwen2.5-coder:7b # recommended
ollama pull llama3.2:3b # lightweight alternativeπ¦ Key Dependencies
Package | Version | Purpose |
| β₯0.2 | Agentic state machine (agent β tools loop) |
| β₯0.2 | Ollama LLM binding with native tool-calling |
| β₯1.0 | Model Context Protocol server (stdio transport) |
| β₯0.5 | Local persistent vector database |
| β₯3.0 | Local embeddings ( |
| β₯6.0 | CPU, memory, disk, battery, process inspection |
| β₯13.0 | Terminal output formatting |
| β₯0.12 | CLI command routing |
π Research & References
Project | Link |
LangGraph | |
Model Context Protocol | |
RAGFlow | |
Agent-S | |
AIOS | |
SoK: AI Agents for Blockchain |
π€ Author
Sunil Gentyala Lead Cybersecurity and AI Security Consultant β HCL America Inc., Dallas TX IEEE Senior Member No. 101760715 Β· CISM No. 263076408 Β· MBCS Β· ACM Professional Member Β· CIISec Affiliate
How to Cite
If you use LaptopAI-Agent in your research, please cite the software:
@software{gentyala2026laptopai,
author = {Gentyala, Sunil},
title = {LaptopAI-Agent},
year = {2026},
version = {1.3.0},
url = {https://github.com/sunilgentyala/LaptopAI-Agent}
}Machine-readable metadata is in CITATION.cff; GitHub shows it under "Cite this repository".
π License
Apache 2.0 β See LICENSE for details.
Available Tools
12 toolsaegis_analyze_paperAEGIS full paper analysisAIdempotent
Analyze an academic paper (PDF/DOCX/TEX) with AEGIS v2.0 for plagiarism, AI-generated content, citation hallucinations, and stylometric issues. Use before IEEE paper submission or when checking paper integrity.
Inputs: file_path (required), skip_ai, skip_citations.
aegis_check_citationsAEGIS citation checkAIdempotent
Verify citation integrity only (fast): hallucinated DOIs, predatory journals, missing DOIs.
Inputs: file_path (required).
aegis_compare_papersAEGIS compare two papersBRead-onlyIdempotent
Compare two paper files for self-plagiarism or similarity (e.g., conference draft vs journal extension).
Inputs: file1 (required), file2 (required).
browser_history_cleanupBack up and clear browser historyADestructiveIdempotent
Back up then clear browsing history for every closed browser profile on this machine (Chrome, Edge, Brave, Firefox). A backup snapshot of each profile's history DB is written under backup_root before anything is deleted. Any browser that is currently running is left completely untouched and reported as skipped β this tool never closes a running browser. Requires confirm=true to actually make changes; otherwise it behaves like browser_history_status plus a preview of what would be backed up and cleared.
Inputs: confirm, backup_root, retention_days.
browser_history_statusBrowser history statusARead-onlyIdempotent
Discover every installed browser profile (Chrome, Edge, Brave, Firefox) with a history database, and report which are currently running. Read-only β makes no changes. Use before browser_history_cleanup to see what would be affected.
Inputs: no named parameters.
git_statusGit status of a repoCRead-onlyIdempotent
Run git status on a named repo
Inputs: repo_name (required).
list_gitreposList git reposARead-onlyIdempotent
List all git repos in C:\Gitrepos
Inputs: no named parameters.
rag_queryQuery local knowledge baseCRead-onlyIdempotent
Query local knowledge base
Inputs: question (required).
signaltrim_reportSignalTrim reportARead-onlyIdempotent
View SignalTrim's run history and token-savings stats (from its persistent SQLite log).
Inputs: limit.
signaltrim_runRun command via SignalTrimADestructive
Run a build/test/install command (npm, python/pytest, go test, docker build, terraform) through SignalTrim, which strips noise (progress bars, deprecation warnings, repeated lines) from the output while guaranteeing every error-shaped line survives untouched. Use to save context on a verbose command whose full raw output isn't needed. Only single, non-compound commands are supported (no shell pipes/redirects/&&); subject to the same allowed_commands/require_approval_for policy as any other command execution.
Inputs: command (required).
system_statusSystem statusBRead-onlyIdempotent
Get CPU, memory, disk, battery status
Inputs: no named parameters.
top_processesTop processesBRead-onlyIdempotent
List top 10 processes by CPU
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 12 tools
Most tools are clearly distinct by resource and action (system_status vs top_processes vs git_status vs rag_query), and the aegis_* trio separates full analysis, citation-only checks, and paper comparison. The one soft overlap is aegis_check_citations being a fast subset of aegis_analyze_paper and browser_history_cleanup behaving like status when confirm=false, but descriptions explicitly disambiguate both.
There is a recognizable namespace-prefix pattern (aegis_*, signaltrim_*, browser_history_*), but the base conventions are mixed: verb-first (list_gitrepos, top_processes), noun-first (system_status, git_status, rag_query), and inconsistent capitalization in 'gitrepos'. Readable, but no single predictable verb_noun scheme throughout.
12 tools is a comfortable, well-scoped count for a personal agent covering system, git, RAG, paper-integrity, command-output, and browser-history domains. Each tool maps to a real operation; the set is a multi-feature grab-bag rather than one coherent domain, but no tool feels redundant.
The aegis and browser clusters are lifecycle-complete (analyze/check/compare; status/cleanup), and signaltrim pairs run with a reporting tool. However, git is read-only (no commit/log/diff) and rag_query has no ingest/add counterpart, leaving notable gaps that will cause dead ends for common workflows.
Maintenance
Related MCP Connectors
Bitcoin L402 telemetry, OpenTimestamps notarization, and tamper-evident AI audit MCP server.
191Remote MCP server for notes, tasks, kanban boards and docs - the Slates agentic workspace
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceTamper-evident audit logging for AI agents. Append-only, hash-chained, optionally Ed25519-signed log. The MCP server lets an agent keep and verify a record of what it actually did.8MIT
- AlicenseAqualityDmaintenanceAI-agent observability server whose distinguishing feature is a SHA-256 hash-chained, tamper-evident audit log with chain verification and signed export. Works with Claude Desktop, Cursor, and any MCP client.2230MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that lets AI agents query their own LLM call history as a branchable DAG and offload conversation context into immutable, AES-256-GCM-encrypted capsules β restorable in full or per segment, crypto-shreddable, with RAID-style replication. 12 tools, no API keys, no cloud.104 npm3MIT
- FlicenseAqualityCmaintenanceA local-first MCP server that handles daily work tasks through your AI assistant: converts meeting notes into todos, manages todo lifecycle, tracks work hours, generates daily/weekly reports, organizes files via move-only operations, and diagnoses dev environments, all guarded by a human-maintained preview/apply safety model.25-