@markmayandi/bridge 0.0.0-stage β†’ 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@markmayandi/bridge",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": "Universal Local-to-Web AI Coding Harness β€” Connect Local Workspaces to Gemini, Claude, ChatGPT & DeepSeek via Secure MCP",
5
+ "main": "bridge.js",
6
+ "bin": {
7
+ "bridge": "bridge.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bridge.js",
11
+ "test": "node --test secure-folder-mcp/server.js"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "ai",
17
+ "gemini",
18
+ "claude",
19
+ "chatgpt",
20
+ "deepseek",
21
+ "tunnel",
22
+ "local-coding-harness",
23
+ "developer-tools"
24
+ ],
25
+ "author": "Manimaran",
26
+ "license": "MIT",
27
+ "engines": {
28
+ "node": ">=18.0.0"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/Manimaran-tech/bridge.git"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/Manimaran-tech/bridge/issues"
36
+ },
37
+ "homepage": "https://github.com/Manimaran-tech/bridge#readme"
38
+ }
@@ -0,0 +1,142 @@
1
+ # πŸ›‘οΈ Secure Folder MCP Server (`secure-fs-mcp`)
2
+
3
+ Connect your local files directly to LLM chatbots (**Claude Desktop, Gemini, ChatGPT, DeepSeek, Ollama, etc.**) with **strict folder-level security isolation**.
4
+
5
+ ---
6
+
7
+ ## πŸ’‘ Why This Exists
8
+
9
+ | AI IDEs (Cursor, Windsurf, Cline) | Chatbots + Secure Folder MCP |
10
+ | :--- | :--- |
11
+ | πŸ’Έ Expensive ($20–$40/mo or costly per-token API fees) | πŸ†“ Leverages generous free/included chatbot subscriptions |
12
+ | πŸ”’ Full system access or broad workspace scope | πŸ›‘οΈ **Jailed strictly** to a single folder you choose |
13
+ | πŸ“‹ Copy-pasting code between chat & editor | ⚑ Chatbot reads & writes directly to your project files |
14
+
15
+ ---
16
+
17
+ ## πŸ”’ Security Guarantees
18
+
19
+ 1. **Strict Folder Sandboxing**: The server checks every requested file against your designated folder. Any attempt to navigate outside (e.g., `../../Windows`, `/etc/passwd`, or drive root) is blocked with a security violation error.
20
+ 2. **Symlink Attack Protection**: Symlinks pointing outside the allowed root directory are resolved and blocked before access.
21
+ 3. **Sensitive File Blocker**: Sensitive files like `.env`, `.env.*`, `*.pem`, `*.key`, and `id_rsa` are shielded by default (can be overridden with `--allow-env`).
22
+ 4. **Token-Optimized Operations**:
23
+ - `edit_file`: Performs surgical search-and-replace so the chatbot doesn't have to output 500 lines of code just to change 3 lines (saving tokens and avoiding truncated responses).
24
+ - `read_file`: Supports `start_line` and `end_line` ranges to keep context windows clean.
25
+
26
+ ---
27
+
28
+ ## πŸ› οΈ Included Tools
29
+
30
+ | Tool | Description |
31
+ | :--- | :--- |
32
+ | `list_directory` | Lists directory contents with clean tree format, depth limit, and auto-filters (`node_modules`, `.git`, etc.) |
33
+ | `read_file` | Reads text files with line numbers and optional line-range slicing (`start_line`, `end_line`) |
34
+ | `write_file` | Creates or completely overwrites a file (auto-creates subdirectories) |
35
+ | `edit_file` | Surgically replaces a target text block with replacement text (saves tokens!) |
36
+ | `search_files` | Fast grep/regex text search across code files |
37
+ | `get_file_info` | Metadata (size, line count, modified time) |
38
+ | `make_directory` | Creates nested folders safely |
39
+ | `delete_file` | Deletes a file inside the folder (requires `confirm: true`) |
40
+
41
+ ---
42
+
43
+ ## πŸš€ Quick Setup Guide
44
+
45
+ ### 1. Claude Desktop (Anthropic)
46
+ Claude Desktop has built-in native MCP support.
47
+
48
+ #### Automatic Setup (Windows):
49
+ Run the included helper script:
50
+ ```powershell
51
+ .\configure-claude.bat "C:\path\to\your\project"
52
+ ```
53
+ Or with PowerShell:
54
+ ```powershell
55
+ .\configure-claude.ps1 -ProjectDir "C:\path\to\your\project"
56
+ ```
57
+
58
+ #### Manual Setup:
59
+ Open `%APPDATA%\Claude\claude_desktop_config.json` (or `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS) and add:
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "secure-folder": {
64
+ "command": "node",
65
+ "args": [
66
+ "c:/tmp/interview/secure-folder-mcp/server.js",
67
+ "C:/path/to/your/project"
68
+ ]
69
+ }
70
+ }
71
+ }
72
+ ```
73
+ *Restart Claude Desktop. You will see the πŸ”¨ hammer icon with all 8 file tools enabled!*
74
+
75
+ ---
76
+
77
+ ### 2. Multi-Model Chatbots: DeepSeek, Gemini, ChatGPT, Ollama
78
+ To chat with **DeepSeek (V3/R1)**, **Gemini 2.0 (Free via Google AI Studio)**, or **ChatGPT** with native MCP tools, use any open-source desktop client:
79
+
80
+ #### Option A: Cherry Studio (Recommended)
81
+ 1. Download [Cherry Studio](https://cherry-studio.net/) (free, open source).
82
+ 2. Go to **Settings** β†’ **MCP Servers** β†’ **Add Server**.
83
+ - **Type**: `stdio`
84
+ - **Command**: `node`
85
+ - **Arguments**: `C:\tmp\interview\secure-folder-mcp\server.js C:\path\to\your\project`
86
+ 3. Select any model (**DeepSeek V3/R1, Gemini 2.0 Flash, GPT-4o, Claude 3.5**) and chat! The model will automatically invoke `list_directory`, `read_file`, and `edit_file` to work on your code.
87
+
88
+ #### Option B: Goose (by Block)
89
+ ```bash
90
+ goose configure
91
+ # Add extension: command = node, args = ["c:/tmp/interview/secure-folder-mcp/server.js", "C:/path/to/project"]
92
+ ```
93
+
94
+ #### Option C: Chatbox / LibreChat
95
+ In their respective settings, add the stdio command:
96
+ `node c:\tmp\interview\secure-folder-mcp\server.js C:\path\to\your\project`
97
+
98
+ ---
99
+
100
+ ### 3. Web Chatbots (ChatGPT Custom GPTs / Webhooks)
101
+ You can also run the server in HTTP mode to connect with web-based bots or OpenAI Custom Actions:
102
+
103
+ 1. **Start the HTTP Server**:
104
+ ```bash
105
+ node server.js "C:\path\to\your\project" --http 3000
106
+ ```
107
+ 2. **Expose with a secure tunnel** (e.g. Cloudflare or ngrok):
108
+ ```bash
109
+ cloudflared tunnel --url http://localhost:3000
110
+ ```
111
+ 3. **Import OpenAPI Schema**:
112
+ In ChatGPT **Explore GPTs** β†’ **Create a GPT** β†’ **Configure** β†’ **Actions**:
113
+ - Paste the OpenAPI schema from `http://localhost:3000/openapi.json` (or via your tunnel URL).
114
+
115
+ ---
116
+
117
+ ## βš™οΈ Command-Line Options
118
+
119
+ ```bash
120
+ node server.js [folder_path] [options]
121
+ ```
122
+
123
+ - `folder_path`: Directory to sandbox the chatbot to (defaults to current directory).
124
+ - `--read-only`: Disables `write_file`, `edit_file`, and `delete_file` (view-only mode).
125
+ - `--allow-env`: Permits access to `.env` files (shielded by default).
126
+ - `--http <port>`: Runs as an HTTP/REST server on the given port (e.g., 3000).
127
+ - `--token <secret>`: Adds Bearer authentication to the HTTP endpoints.
128
+
129
+ ---
130
+
131
+ ## πŸ§ͺ Verification & Testing
132
+
133
+ To run the built-in automated test suite verifying both protocol compliance and security attack blockades:
134
+ ```bash
135
+ node test_client.js
136
+ ```
137
+ All tests should pass:
138
+ - βœ… JSON-RPC 2.0 handshake
139
+ - βœ… Tool execution (`list`, `read`, `write`, `edit`, `search`)
140
+ - βœ… Path traversal attack blocked (`../../`)
141
+ - βœ… Symlink escape blocked
142
+ - βœ… Sensitive file blocked (`.env`)
@@ -0,0 +1,6 @@
1
+ @echo off
2
+ setlocal
3
+ set "PROJECT_DIR=%~1"
4
+ if "%PROJECT_DIR%"=="" set "PROJECT_DIR=%CD%"
5
+ powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0configure_tunnel.ps1" -ProjectDir "%PROJECT_DIR%"
6
+ pause
@@ -0,0 +1,61 @@
1
+ ο»Ώparam (
2
+ [Parameter(Mandatory=$false)]
3
+ [string]$ProjectDir = (Get-Location).Path
4
+ )
5
+
6
+ $ErrorActionPreference = "Stop"
7
+
8
+ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
9
+ $serverScript = Join-Path $scriptDir "server.js"
10
+
11
+ if (-not (Test-Path $serverScript)) {
12
+ Write-Host "[ERROR] server.js not found at $serverScript" -ForegroundColor Red
13
+ exit 1
14
+ }
15
+
16
+ # Resolve canonical paths
17
+ $resolvedProject = (Resolve-Path $ProjectDir).Path
18
+ Write-Host "`n=== Secure Folder MCP: Universal Tunnel Configurator ===" -ForegroundColor Cyan
19
+ Write-Host "Sandboxing LLM to folder: $resolvedProject" -ForegroundColor Green
20
+ Write-Host "Server executable: $serverScript" -ForegroundColor Gray
21
+
22
+ $claudeDir = Join-Path $env:APPDATA "Claude"
23
+ $configFile = Join-Path $claudeDir "claude_desktop_config.json"
24
+
25
+ if (-not (Test-Path $claudeDir)) {
26
+ New-Item -ItemType Directory -Force -Path $claudeDir | Out-Null
27
+ }
28
+
29
+ $config = @{ mcpServers = @{} }
30
+ if (Test-Path $configFile) {
31
+ try {
32
+ $raw = Get-Content -Raw -Path $configFile
33
+ if ($raw.Trim()) {
34
+ $parsed = ConvertFrom-Json $raw -AsHashtable
35
+ if ($parsed.ContainsKey("mcpServers")) {
36
+ $config = $parsed
37
+ } else {
38
+ $config["mcpServers"] = @{}
39
+ }
40
+ }
41
+ } catch {
42
+ Write-Host "[WARN] Existing config could not be parsed as JSON, backing up to claude_desktop_config.json.bak" -ForegroundColor Yellow
43
+ Copy-Item $configFile "$configFile.bak" -Force
44
+ }
45
+ }
46
+
47
+ # Add or update secure-folder entry
48
+ $config["mcpServers"]["secure-folder"] = @{
49
+ command = "node"
50
+ args = @(
51
+ $serverScript,
52
+ $resolvedProject
53
+ )
54
+ }
55
+
56
+ $jsonOutput = ConvertTo-Json $config -Depth 10
57
+ Set-Content -Path $configFile -Value $jsonOutput -Encoding utf8
58
+
59
+ Write-Host "`n[OK] Claude Desktop configuration updated successfully!" -ForegroundColor Green
60
+ Write-Host "Config file: $configFile" -ForegroundColor Gray
61
+ Write-Host "`nNext Step: Restart Claude Desktop. You will see the tools icon with all 8 file tools enabled!`n" -ForegroundColor Yellow
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "secure-folder-mcp",
3
+ "version": "1.0.0",
4
+ "description": "Secure, folder-sandboxed File Read & Edit Model Context Protocol (MCP) server for Claude, Gemini, ChatGPT, DeepSeek, and other LLMs.",
5
+ "main": "server.js",
6
+ "bin": {
7
+ "secure-fs-mcp": "./server.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node server.js",
11
+ "test": "node test_client.js"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "claude",
17
+ "chatgpt",
18
+ "gemini",
19
+ "deepseek",
20
+ "filesystem",
21
+ "sandbox",
22
+ "security"
23
+ ],
24
+ "author": "Antigravity",
25
+ "license": "MIT"
26
+ }