my-pi
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Local-first MCP runtime for coding agents — safer workspace access without an unrestricted shell
Bounded filesystem · content-preconditioned writes · Tree-Sitter AST search · LSP navigation · Git tooling
What is my-pi?
**my-pi** is a deterministic local coding capability runtime exposed through the official **Model Context Protocol (MCP)**. It gives MCP-capable coding agents controlled access to a real workspace through explicit workspace authority, bounded reads, guarded writes, structural search, language-server intelligence, and Git operations.
It is aimed at developers who want agentic coding tools to understand and modify code **without handing the agent a general-purpose shell or silently granting the current working directory**.
Why use it?
- **Local-first:** source code and detailed workspace state remain on the host.
- **Read-only by default:** writes and language-server process startup require explicit trusted elevation.
- **Safer mutation:** writes can require SHA-256 content preconditions instead of blind overwrite semantics.
- **Code-aware search:** Tree-Sitter structural search across TypeScript, JavaScript, Python, Rust, and Go.
- **Semantic navigation:** LSP symbols, definitions, references, hover, and diagnostics for supported host language servers.
- **Git-aware context:** bounded status and diff operations with secret filtering and large-diff spillover.
- **No secondary paid LLM dependency:** the core runtime executes locally and does not select models or spawn agents.
> **Release channel:** Alpha. The npm badge above is authoritative for the currently published package version. This repository may contain a newer release candidate before publication completes. Suitable for evaluation and controlled local development; review the security model before enabling the trusted profile.
Install in under a minute
Requires Node.js >=24.0.0 (Node 24 LTS is the normative runtime).
The server starts read-only. For a workspace you explicitly trust:
Or inspect a host configuration without a global install:
Generate host-specific configuration snippets:
Starting without --workspace or MY_PI_WORKSPACE_ROOT fails closed. Use --allow-cwd only when granting the current directory is intentional.
The published npm package is the stable MCP server. The coordination daemon and
local UI are private workspace packages used by the experimental source build;
build the repository before using those components.
13-tool MCP surface
| Area | Tools | Purpose |
| :--- | :--- | :--- |
| Filesystem | fs_read, fs_write, fs_patch, fs_stat | Bounded reads, guarded writes/patches, metadata |
| Search & workspace | search, workspace_info | Repository exploration and authoritative workspace state |
| AST & LSP | ast_search, lsp_status, lsp_symbols, lsp_navigate, lsp_diagnostics | Structural and semantic code intelligence |
| Git | vcs_status, vcs_diff | Repository status and bounded/filtered diffs |
Key guarantees
| Capability | Behavior |
| :--- | :--- |
| Content-preconditioned mutation | File updates verify raw SHA-256 fingerprints and reject stale guarded overwrites |
| Pre-read sensitive-path policy | Sensitive paths such as .env*, .aws/, .ssh/, and *.key are denied before content is allocated to model context |
| Explicit security profiles | Default is read-only; mutation and LSP process startup require explicit elevation |
| Encoding/mode fidelity | File replacement preserves relevant encoding, line endings, BOM, and POSIX executable mode behavior |
| Cancellation | Long-running Git/search/LSP subprocess work supports cancellation and cleanup |
Architecture
The stable public claim is the 13-tool MCP capability surface. The repository also contains two opt-in candidates that never change the default mode: