Command-Line MCP Server
Provides native Git passthrough tools for inspecting repository status, diffs, logs, and file contents, enabling agents to work with Git repositories on the host machine.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Command-Line MCP Servershow me the git log for the last 5 commits"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Command-Line MCP Server
A remote Model Context Protocol server that exposes a
single tool, run_command, allowing Claude (via the Claude Desktop Connectors feature)
to execute shell commands on the machine running this server.
The server implements OAuth 2.1 (Dynamic Client Registration + PKCE) because Claude Desktop connectors require an OAuth handshake — a connector with no auth server is rejected at sign-in. This server auto-approves authorization (no user prompt), which is fine for a personal, tunnel-exposed server.
⚠️ Security warning: Anyone who can reach this server and complete the (automatic) OAuth flow can run arbitrary commands as the user running it. Only expose it through a private tunnel (cloudflared / ngrok) and never on a public network.
How it works
Transport: Streamable HTTP (the transport Claude Desktop connectors require).
Stateless: every request spins up a fresh server/transport instance (no session store needed).
Endpoint:
POST /mcpHealth check:
GET /health
Tools
run_command
Execute a shell command. On Windows the default shell is cmd.exe (use dir, cd, not ls/pwd) unless you pass shell: "powershell".
Parameter | Type | Required | Description |
| string | yes | The shell command to run. |
| string | no | Working directory. |
| number | no | Hard timeout (max 600000). Default 120000. |
| string | no |
|
get_info
Returns OS, architecture, default shell (cmd.exe on Windows), and current working directory — call once so the client knows which shell to use.
read_file
Read a text file (optional offset/limit line range). path is absolute or relative to cwd.
list_files
List a directory. recursive: true walks the tree (depth-limited to 4).
edit_file
Exact string replace — the preferred way to edit code (no shell escaping needed).
path, old_text, new_text, optional replace_all. old_text must be unique unless replace_all is set. Returns a short diff.
apply_patch
Apply a unified diff via git apply (with a --3way fallback). cwd = repo root, patch = diff text.
write_file
Write full content to a file (overwrite, or append).
batch_read
Read several files in one call. files: array of { path, offset?, limit? }.
batch_edit
Apply many exact-text edits across one or more files in a single call. Transactional: every old_text is validated before any file is written, so a missing/ambiguous match aborts the whole batch (nothing changes). Each edit: { path, old_text, new_text, replace_all? }.
Native git passthrough
git_status (-sb), git_diff (staged + paths options), git_log (max_count, revision), git_show (revision). Each takes an optional cwd.
All file paths are resolved on the host running the server — they point at this machine, not Claude's sandbox.
Run locally
npm install
npm start
# server listens on http://localhost:3000/mcpOptional env vars: PORT, CMD_TIMEOUT_MS, CMD_MAX_BUFFER.
npm start runs start.js, which frees port 3000 (kills any process holding it)
before launching the server, so you never hit EADDRINUSE.
Expose it to Claude Desktop
Option A — Cloudflare Worker (stable URL, no trycloudflare, no domain needed)
A small local agent keeps a WebSocket open to a Cloudflare Worker, which becomes
your stable public *.workers.dev MCP endpoint. The Worker only relays to your
machine while the agent (authenticated with PROXY_SECRET) is connected.
wrangler login(free Cloudflare account).Deploy:
wrangler deploy→ note your URL, e.g.https://command-line-mcp.<subdomain>.workers.dev.Set the secret (same value already in your gitignored
.dev.vars):wrangler secret put PROXY_SECRET(paste thePROXY_SECRETfrom.dev.vars).Point the agent at the deployed Worker: set
WORKER_URLin.dev.varsto that URL.On your machine, run both:
npm start # the MCP server on :3000 npm run agent # connects to the Worker with the secretIn Claude Desktop: Customize → Connectors → Add custom connector, paste
https://command-line-mcp.<subdomain>.workers.dev/mcp.
Local testing without deploying: wrangler dev --port 8787 (Worker on :8787),
then npm run agent — the agent reads WORKER_URL from .dev.vars.
Option B — cloudflared / ngrok tunnel (ephemeral URL)
Claude Desktop connectors need an HTTPS URL, so run the server locally and tunnel it:
cloudflared tunnel --url http://localhost:3000 --protocol http2
# or: ngrok http 3000Copy the generated https://… URL and append /mcp, e.g.
https://abc-123.trycloudflare.com/mcp.
Add to Claude Desktop
Open Customize → Connectors → Add custom connector.
Paste the URL (with
/mcp), e.g. the Worker URL from Option A.Name it Command-Line.
Save. Claude discovers the OAuth metadata, registers a client, and opens a browser to the (auto-approving) authorize endpoint, then redirects back and is ready. No "OAuth Client ID" needs to be entered manually — DCR handles it.
Testing without Claude
Use the MCP Inspector:
npx @modelcontextprotocol/inspector
# Transport: Streamable HTTP, URL: http://localhost:3000/mcpHardening (for non-personal use)
OAuth is already implemented (see oauthProvider.js). For anything beyond a personal
tunnel you should:
Replace the auto-approve
authorize()with a real consent screen, or at least an allow-listed set of redirect URIs / clients.Persist clients/tokens (currently in-memory — they reset on restart).
Host behind a stable HTTPS domain (e.g. a VPS, Cloudflare Workers, Fly.io).
Consider an allow-list of permitted commands to limit blast radius.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SynacNipo/command-line-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server