shell2mcp
Serve a folder as an MCP server that offers the same coding tools as the
Pi agent: read, bash, edit, write, grep, find and ls. Tool names and parameter
schemas match Pi's, so a model that knows Pi's tools can use them as is. Pure Python standard library, no dependencies.
By itself it listens on 127.0.0.1 only. Nothing leaves your machine unless you add --tunnel or run your own tunnel.
Install and run
pip install shell2mcp # or: uvx shell2mcp
shell2mcp # serve the current folder on 127.0.0.1:8765
The MCP URL is printed on stdout (everything else goes to stderr), for example
http://127.0.0.1:8765/3f9c.../mcp. The random path segment is the only access control, so treat the URL as a secret.
shell2mcp [--root DIR] [--port N] [--secret S] [--read-only] [--tunnel] [--version]
| Option | Meaning |
|---|---|
--root DIR |
folder the tools may touch (default: current directory) |
--port N |
local port, 0 for any free port (default 8765) |
--secret S |
fixed URL path secret instead of a random one |
--read-only |
only expose read, grep, find, ls |
--tunnel |
also publish through a cloudflared quick tunnel and print the public URL |
With cloudflared
Built in:
shell2mcp --tunnel # prints https://<random>.trycloudflare.com/<secret>/mcp
URL=$(shell2mcp --tunnel | head -1) # the URL is the only thing on stdout
Or run the tunnel yourself, since the server is a plain local HTTP endpoint:
shell2mcp --port 8765 &
cloudflared tunnel --url http://127.0.0.1:8765
# MCP URL: https://<random>.trycloudflare.com/<secret>/mcp (the secret is printed by shell2mcp)
Add that URL as a remote MCP server (Streamable HTTP, no auth) in any MCP client.
Tools
| Tool | What it does |
|---|---|
read |
read a text file with offset/limit (2000 lines or 50KB max) |
bash |
run a command in the root, 60 s default and 120 s maximum timeout, minimal environment |
edit |
exact-text replacements: edits[{oldText,newText}], each must be unique and non-overlapping |
write |
create or overwrite a file, creating parent folders |
grep |
regex or literal search with glob, ignoreCase, context, limit |
find |
glob file search |
ls |
list a directory |
Paths are relative to --root; absolute paths and .. that leave it are rejected.
Security
bash runs real commands. The folder restriction applies to the file tools, but a shell command can still read
other files your user can read. Only tunnel it on a machine and account you are happy to expose, prefer a
throwaway folder or container, use --read-only when you can, and stop it when you are done. Everything the model
reads is sent to whichever model provider the MCP client uses.
License
MIT
Metadata
Release files for shell2mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shell2mcp-0.1.0.tar.gz | 10.6 kB | Without provenance | Details for shell2mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shell2mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for shell2mcp-0.1.0-py3-none-any.whl |
Total release size: 22.1 kB
Release files / shell2mcp-0.1.0.tar.gz
| Download URL | shell2mcp-0.1.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ad81b8bce9781a308ea7a5b7870a9b54d2d1a908e1ee36500d2d6593801306e
|
|
BLAKE2b-256 checksum How to use checksums |
fb28f33bc8e80cf3149c5ff946b4787850de3ca5f43249dd50db65769d17a186
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / shell2mcp-0.1.0-py3-none-any.whl
| Download URL | shell2mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91a0c2e2e6bd1de57e3438dbe6c9638fdc2a5cde3988cc087c328434dac59ac9
|
|
BLAKE2b-256 checksum How to use checksums |
3b172b001fd49e47591cdb7d5a45f4dc7113c07a97cc567476da30b72efb1baf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for shell2mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.