local-env-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
local-env-mcp
A stateless, Dockerized Model Context Protocol (MCP) server built with TypeScript. It exposes your local machine β filesystem, git, shell, network, databases, and system β to any MCP-compatible LLM client over HTTP.
Built natively in TypeScript on the @modelcontextprotocol/sdk utilizing Express, Zod schemas, and a fully decoupled, layered architecture.
Quick Start
# 1. Clone and install
git clone <repo-url>
cd local-mcp
npm install
# 2. Build the TypeScript source
npm run build
# 3. Start the server (runs on port 3000 by default)
npm start
# OR Start with Docker (multi-stage build)
docker compose up -d --build
# 4. Expose via ngrok (in a separate terminal)
ngrok http 3001
# 5. Copy the ngrok URL and add to Claude.ai
# Settings β Integrations β Add MCP Server
# URL: https://your-ngrok-url.ngrok-free.app/mcpRelated MCP server: remote-access-mcp
Table of Contents
Architecture
LLM Client (Claude / Cursor / API)
β HTTPS POST /mcp
βΌ
Express Routing Layer (src/app.ts)
β
βββ GET /health β System Checks
βββ POST /mcp β Create Server Session
βββ GET /mcp β Resume Session
βββ DELETE /mcp β Purge Session
β
βΌ
Layered Tool Registry (src/tools/registry.ts)
β
βββββββββββ¬ββββ΄ββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ
βΌ βΌ βΌ βΌ βΌ βΌ
FS Git Network Shell System Postgres
(9) (11) (8) (9) (8) (3)Stateless Mode: Each POST request spins up a fresh McpServer instance dynamically managed by a singleton Session Manager.
Project Structure
Migrated from legacy monolithic JS, the project now follows a strictly typed layered framework:
local-mcp/
βββ src/
β βββ server.ts # Listener & bootstrap
β βββ app.ts # Express routing & middleware wiring
β βββ config.ts # Zod-validated env loader (.env handled via dotenv)
β βββ logger.ts # Winston configuration
β βββ routes/ # Separated Controllers (health.ts, mcp.ts)
β βββ services/ # Core Logic (processManager, sessionManager)
β βββ types/ # Shared TS definitions
β βββ tools/ # All 48 MCP Tools separated by domain
β βββ filesystem/
β βββ git/
β βββ network/
β βββ postgres/ # Dynamic Database capabilities
β βββ shell/
β βββ system/
β βββ registry.ts # Injects toolsets into active MCP SessionsTransport & Session Model
Uses the Streamable HTTP transport.
Route | Purpose |
| Initiates tool requests (tools/list, tools/call) β hooks into new or cached session. |
| Streams Server-Sent Events (SSE) for continuous clients. |
| Gracefully terminate an active server. |
Tool Reference
Currently bundling 48 Native Tools mapped through specific modules.
π Filesystem
(All paths resolved relative to FS_ROOT protecting against directory traversal)
read_file,write_file,list_dir,make_dir,delete_path,copy_path,move_path,search_files,file_info
πΏ Git
(Powered by simple-git, targets directories relative to FS_ROOT)
git_status,git_diff,git_log,git_branch,git_add,git_commit,git_push,git_pull,git_clone,git_stash,git_show
π Network
http_request,ping,dns_lookup,port_scan,whois,traceroute,download_file,check_connectivity
π» Shell
(Managed by the injected ProcessManager service isolating spawn logs in memory)
run_command,spawn_process,list_processes,get_process_logs,kill_process,system_info,get_env,which,ps
π₯οΈ System
cron_list,disk_usage,open,notify,clipboard_write,clipboard_read,screenshot,list_installed
π Postgres
(Connects dynamically on-the-fly rather than hardcoded global connections)
pg_query: Execute parameterized raw SQL queries directly.pg_list_tables: Enumerate all active tables ignoring system schemas.pg_describe_table: Interrogate type formats, nullability, and default requirements for a target schema table.
Note: The Postgres tools require you to provide a connectionString argument directly through the LLM interface, keeping your server completely credential-less by design.
Environment Variables
Handled seamlessly using dotenv.
Variable | Required | Default | Description |
| No |
| HTTP port the Express server binds to. |
| No |
| Root directory for File operations. Path constraints enforce this border. |
| Yes (prod) | (none) | Bearer auth token for |
| No |
| Setting to |
Extending with New Tools
Adding tools is significantly easier with the Modular Architecture:
Create a strictly-typed configuration inside your target domain layer (e.g.
src/tools/custom/myTool.ts):
import { z } from "zod";
import type { ToolDefinition } from "../../types/index.js";
import { ok } from "../../utils/response.js";
export const myCustomTool: ToolDefinition = {
name: "custom_tool",
description: "Does something specific",
schema: {
target: z.string().describe("What to target"),
},
handler: async ({ target }) => {
return ok(`Executed logic on ${target}`);
}
};Import and append your tool array to
registerAllToolsinsrc/tools/registry.ts.
Security Model
Concern | Mitigation |
Path traversal |
|
Secret leakage |
|
Docker Isolation | Runs natively as unescalated |
DB Access | Handled dynamically avoiding persistent |
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
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Nifty's MCP server β exposes tasks, projects, messages, and files as tools for AI agents.
A full backend your AI coding agent can set up over MCP
Hosted MCP server for live public-data APIs and Skills for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceProduction-grade MCP server that gives AI agents safe access to your local dev environment: filesystem, databases, processes, and OpenAPI specs.1555 npm4MIT
- AlicenseNot gradedqualityBmaintenanceTurns any Linux server into an AI-agent-accessible machine over HTTPS, allowing MCP clients like ChatGPT, Claude, and Grok to securely control files, run shell commands, inspect system state, query SQLite, and work with git behind a bearer token.76 npm4MIT
- FlicenseNot gradedqualityAmaintenanceExposes 38 OAuth-gated tools over one MCP endpoint so web-based AI clients like Claude, ChatGPT, and Grok can read and edit local files, run whitelisted shell commands, search content, use Git, SQLite, browser automation, DevTools, clipboard, notifications, ports, and background jobs on your own machine. A strict command whitelist and folder restrictions keep the local operating surface governable and safe by default.-
- AlicenseNot gradedqualityAmaintenanceEnables web-based AI clients like Claude, ChatGPT, and Grok to securely operate a local machine through OAuth-gated MCP tools covering files, shell, Git, databases, browser automation, and background tasks.MIT