secure-local-mcp
A fully offline, secure MCP server that enables AI agents to search, read, write, and list local markdown notes using SQLite FTS5, with directory traversal protection.
README
Secure Local MCP Agent (Engineering Edition)
A Software Engineer AI Agent system that is 100% offline, secure, and directly interacts with your personal computer via the MCP (Model Context Protocol).
🎯 The Problem Solved
Current Cloud AIs pose a risk of source code data leaks and cannot directly interact with your local operating system.
This project builds a personal AI running 100% offline (Native) on Windows, capable of reading/analyzing your project's source code, as well as executing real system commands (like ping, ipconfig, dir) without being restricted by virtualization layers (Docker).
🏗️ System Architecture (Native Mode)
my_notes/ (Notes) & project_context/ (Source Code)
│
▼
src/indexer.py ──── SQLite FTS5 ──── Scan & Index Code/Text
│
▼
src/server.py ───── FastMCP ──────── 5 Tools (list, read, search, write, execute_command)
│
▼ (stdio / JSON-RPC)
src/ui.py ───────── Streamlit ────── Visual Web Interface (Transparent Tool execution flow)
│
▼
Ollama (Gemma4/Qwen) / Any Local LLM
✨ Highlight Features
| Feature | Details |
|---|---|
| Codebase Indexing | SQLite FTS5 reads and indexes a variety of programming languages (.py, .js, .json, .cpp, .go...) while skipping binary files. Blazing fast O(log N) speed. |
| Native OS Commands | Allows the AI to execute Terminal (Powershell/CMD) commands on the actual Windows machine to query the network or system. |
| Transparent Web UI | Every tool execution (reading files, running network commands) is displayed in detail as an Expander block, hiding nothing. |
| 100% Offline & Un-sandboxed | No Docker is used to avoid network isolation. Data never leaves your machine. |
| Directory Traversal Protection | Blocks payloads like ../../etc/passwd. The AI is strictly restricted to operations within the my_notes and project_context directories. |
🚀 Installation & Usage (1-Click)
The system is designed to run directly on Windows (Native) to fully utilize the operating system's capabilities and permissions.
Requirements:
- Python 3.10+ installed (with PATH configured).
- Ollama installed and running on the default port (
http://localhost:11434).
How to run:
Simply double-click the start.bat file.
The script will automatically:
- Create a virtual environment (venv).
- Install the necessary dependencies (
pip install). - Open the Web UI app (Streamlit) in your browser at
http://localhost:8501.
🛡️ Security Mechanisms
The system applies a robust protection layer against Directory Traversal Attacks (CWE-22):
It utilizes resolve() and is_relative_to() to ensure that the read/write paths absolutely cannot escape the 2 permitted root directories (my_notes and project_context).
📁 Project Structure
secure-local-mcp/
├── my_notes/ # Personal notes repo (.md, .txt)
├── project_context/ # Project source code for AI analysis (.py, .js, .json,...)
├── src/
│ ├── server.py # FastMCP Server (Tool declarations)
│ ├── indexer.py # SQLite FTS5 Indexing Engine (Handles Text & Code)
│ └── ui.py # Streamlit Web Chat Interface
├── start.bat # Windows (Native) automated startup script
├── requirements.txt
└── README.md
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.