local-pc-mcp
Provides tools to inspect local Git repositories, including working tree status, staged or unstaged diffs, and up to 100 commits of history.
Click on "Deploy 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., "@local-pc-mcp show me the staged diff in my project"
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.
local-pc-mcp
A stdio MCP server for working with files and Git repositories on your machine. Give a client a project directory and it can search source, read a PDF page, inspect a staged diff, or write a UTF-8 file there.
Quickstart
Install Python 3.12 or later and Git. Install Poppler's pdftoppm on PATH for PDF page images and the full test suite. PDF text extraction uses pypdf.
From the project directory on Linux or macOS:
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[dev]'
mkdir -p example-workspace
export ALLOWED_ROOTS="$(pwd)/example-workspace"
local-pc-mcpThe server waits for MCP messages on standard input. Stop it with Ctrl+C. For a client that supports stdio servers, replace both paths below with absolute paths. The client launches the process itself.
{
"mcpServers": {
"local-pc": {
"command": "/absolute/path/to/local-pc-mcp/.venv/bin/local-pc-mcp",
"env": { "ALLOWED_ROOTS": "/absolute/path/to/example-workspace" }
}
}
}On Windows, create the environment with py -3.12 -m venv .venv, install with .venv\Scripts\python.exe -m pip install -e ".[dev]", and point the client at .venv\Scripts\local-pc-mcp.exe using an absolute path. Escape backslashes in JSON. Set environment variables directly in the client configuration or shell. The server does not load dotenv files.
To check the connection, ask the client to call file_list with {"path":"."}. With one configured workspace, the result contains that directory's entries.
Related MCP server: fsguard-mcp
Architecture and tools
The Python MCP SDK registers ten tools in server.py. Each tool resolves its path through sandbox.py before invoking a local filesystem operation or one of the modules below.
Tools | Behavior |
| List one directory, preview text or PDF content, and create or overwrite a UTF-8 file in an existing directory. Ordinary text reads and writes are limited to 1 MiB. |
| Page through text, search for a literal in names or text, or select a JSON value by JSON Pointer. Search visits up to 600 files and returns up to 30 matches. JSON input is limited to 4 MiB. |
| Extract up to 20 pages of text or render one page as a PNG. PDF input is limited to 256 MiB. Rendering uses Poppler and performs no OCR. |
| Inspect a working tree, staged or unstaged changes, and up to 100 commits. Returned diff text is truncated at 1 MiB plus a marker. |
Security model
ALLOWED_ROOTSis a semicolon-separated list of absolute directories on all platforms. A missing or empty value makes tool calls fail closed. Relative paths require exactly one root. Canonical path checks resolve links before comparing directory boundaries.gitops.pychecks the repository top level and builds argument lists forstatus,diff,log, and internalrev-parse. The caller supplies a path, a staging flag, or a count. Git runs without a shell and has a 30-second timeout.Run the server as a low-privilege user and expose only directories and repositories you trust. Clients can overwrite files in those directories. The checks run in the server process and rely on trusted local Git configuration, executables, and a filesystem that other users cannot change during a call. Directory listings and Git status can grow with the workspace.
Tests
With the development dependencies, Git, and Poppler installed:
python -m pytest -qThe suite creates temporary directories, Git repositories, worktrees, and a sample PDF. It exercises path boundaries, size limits, the registered tool list, and the MCP client/server calls.
Available Tools
10 toolsfile_json_getSelect JSON valueBRead-only
Read one bounded JSON value by JSON Pointer under the local read policy.
Inputs: path (required), pointer (required). Returns: path, content, pointer
file_listList filesARead-only
List a directory under the local read policy. Does not follow symlink entries.
Inputs: path (required). Returns: path, entries
file_readRead fileARead-only
Read UTF-8 text or a PDF text preview. PDF continuation/images: file_read_pdf.
Inputs: path (required). Returns: path, content
file_read_linesRead text linesBRead-only
Read a bounded line range of a UTF-8 file under the local read policy.
Inputs: path (required), max_lines, start_line. Returns: path, reason, content, end_line, +3 more
file_read_pdfRead PDF pagesARead-only
Read PDF pages (1-based, max 20). render=true returns one page image for scans/figures. Local read policy applies.
Inputs: path (required), render, max_pages, start_page.
file_searchSearch textBRead-only
Bounded literal text or filename search in one directory under the local read policy.
Inputs: path (required), query (required), mode, max_results. Returns: mode, path, query, limits, +3 more
file_writeWrite fileADestructiveIdempotent
Create or overwrite a UTF-8 text file inside ALLOWED_ROOTS. Does not delete files.
Inputs: path (required), content (required). Returns: path, bytes_written
git_diffGit diffBRead-only
Show git diff --no-ext-diff. Set staged=true for --cached.
Inputs: path (required), staged. Returns: diff, repo, staged
git_logGit logBRead-only
Show recent git commits. max_count is capped at 100.
Inputs: path (required), max_count. Returns: repo, commits
git_statusGit statusARead-only
Show git status --porcelain for a repository whose root is inside ALLOWED_ROOTS.
Inputs: path (required). Returns: repo, status
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
The file-reading tools overlap: file_read, file_read_lines, and file_read_pdf all read file content, and file_read even mentions a PDF preview that competes with file_read_pdf. Descriptions do help distinguish bounded line ranges and PDF-specific behavior, but an agent can easily misselect among the three read tools.
Names consistently use snake_case with clear file_/git_ prefixes and mostly follow a resource_action pattern. Minor deviations like file_json_get (action not at the end) and compound suffixes in file_read_pdf/file_read_lines keep it from being perfectly uniform.
Ten tools is well within the ideal 3-15 range and each tool maps to a distinct operation on local files or git repositories. The set is compact and purpose-scoped without obvious filler.
Read coverage is strong (text, lines, PDF, JSON pointer, search, list) and git inspection is covered, but the write lifecycle is incomplete: no delete, move, append, or directory creation, and git is read-only with no commit/add/branch operations. These are notable gaps agents cannot fully work around with the current surface.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Browse and manage files in your Moxt AI workspace from any MCP client.
Find authorized project files, read supported text, and save new files or versions with permission.
MCP server for the GitCore API, enabling AI agents to interact with GitCore repositories, issues, pull requests, and more.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceExposes a secure, path-confined bridge to a local workspace and git remotes, enabling MCP clients to search, read, write, reset files, and perform git operations.-
- AlicenseAqualityDmaintenanceEnables safe filesystem and git operations confined within a single allowed directory tree, using symlink-resolved path containment to protect against path traversal. Users can read, write, list, and search files, as well as initialize repos and run status, stage, commit, diff, and log operations through MCP.11MIT
- AlicenseBqualityDmaintenanceEnables any MCP client to read, search, patch, and execute commands in a codebase, including interactive sessions and git operations, with permission modes and safety boundaries.18Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to manage files in an isolated workspace and perform lightweight Git operations through a protected Streamable HTTP endpoint, including listing, reading, writing, searching, replacing, and deleting files plus checking status and diffs.1-