Skip to main content

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 (a free port if that is taken)

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, or a free port if 8765 is taken; an explicit busy port is an error)
--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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shell2mcp 0.1.1
File Size Uploaded Provenance Actions
shell2mcp-0.1.1.tar.gz 11.0 kB Without provenance Details for shell2mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shell2mcp 0.1.1
File Interpreter ABI Platform Actions
shell2mcp-0.1.1-py3-none-any.whl Python 3 none any Details for shell2mcp-0.1.1-py3-none-any.whl

Total release size: 22.7 kB

Release files / shell2mcp-0.1.1.tar.gz

Download URL shell2mcp-0.1.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
13d624f7cb7344208db54c6060d54d566b610af784cdba6dc28c4ab268a44dad
BLAKE2b-256 checksum
How to use checksums
18022d08b81603a3852c11a73c23fb80fbe7da8f054c10e46d99d7678f72f908
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.1-py3-none-any.whl

Download URL shell2mcp-0.1.1-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b70937da8a71c6d0d4eb757bb08a6075a5f4a20bacebd642a19e12fa514be61e
BLAKE2b-256 checksum
How to use checksums
f1da33ce1d01b3c3b5b9b589cdedad2cf619bd136614c5c73e5754b74b25b0ed
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.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page