terminal-mcp
An agent-capable MCP server with terminal access, filesystem control, and persistent memory. Built-in sandboxing, access control, activity logging, and a file-backed memory store — so Claude can run commands, manage files, and remember context across conversations.
What it does
terminal-mcp provides 10 tools across two categories:
Terminal Tools
| Tool | Access Scope | Description |
|---|---|---|
run_command |
Full ROOT_DIR | Execute shell commands with dangerous-command blocking |
read_file |
Allowed dirs only | Read files from whitelisted paths |
write_file |
Allowed dirs only | Write/overwrite files in whitelisted paths |
list_files |
Full ROOT_DIR | Browse directory contents (recursive supported) |
run_workflow |
Full ROOT_DIR | Named workflows: npm_install, npm_run, python_run, shell_script |
Memory Tools
| Tool | Description |
|---|---|
memory_store |
Save a memory with name, type, tags, and content |
memory_recall |
Retrieve a specific memory by name |
memory_search |
Search all memories by keyword and/or type |
memory_delete |
Remove a memory |
memory_list |
List all stored memories (returns the MEMORY.md index) |
Memory System
The memory system gives Claude persistent context that survives across conversations. Memories are stored as individual markdown files with YAML frontmatter inside claude_playground/memory/, with an auto-maintained MEMORY.md index.
Memory Types
| Type | Purpose | Example |
|---|---|---|
user |
Who the user is, their preferences, expertise | "Senior backend engineer, prefers Go" |
feedback |
How to approach work (corrections + confirmations) | "Don't mock the database in integration tests" |
project |
Ongoing work context, goals, deadlines | "Auth rewrite driven by compliance, due March 15" |
reference |
Pointers to external resources | "Pipeline bugs tracked in Linear project INGEST" |
note |
General-purpose memory | Anything that doesn't fit above |
How it works
claude_playground/
└── memory/
├── MEMORY.md # Auto-generated index (grouped by type)
├── user_role.md # Individual memory files
├── feedback_testing.md
├── project_auth_rewrite.md
└── ...
Each memory file looks like:
---
name: testing preferences
type: feedback
tags: [testing, database]
created: 2025-01-15T14:30:00
updated: 2025-01-20T09:15:00
---
Integration tests must hit a real database, not mocks.
**Why:** Prior incident where mock/prod divergence masked a broken migration.
**How to apply:** Any test touching the data layer should use the test database.
The MEMORY.md index is automatically rebuilt whenever a memory is stored or deleted:
# Memory Index
## User
- [user role](user_role.md) — Senior backend engineer, prefers Go
## Feedback
- [testing preferences](feedback_testing.md) — Integration tests must hit a real database
Usage
Claude can use memory tools naturally in conversation:
- "Remember that I prefer concise responses with no trailing summaries"
- "What do you know about the auth rewrite?"
- "Search your memory for anything about testing"
- "Forget the note about the old API endpoint"
- "What's in your memory?"
Safety Features
- Path sandboxing —
read_fileandwrite_filerestricted to allowed directories - Dangerous command blocking —
rm -rf /,mkfs, disk overwrites, fork bombs blocked - Dynamic access control — edit
path.txtto grant access without restarting - Activity logging — every action (including memory operations) logged with timestamps
- Configurable root — restrict the entire server to a specific directory tree
Installation
pip install terminal-mcp
Or from source:
git clone https://github.com/koushikmaji/terminal-mcp.git
cd terminal-mcp
pip install -e .
Setup
Configure Claude Desktop
{
"mcpServers": {
"terminal": {
"command": "terminal-mcp"
}
}
}
To restrict the root directory:
{
"mcpServers": {
"terminal": {
"command": "terminal-mcp",
"env": {
"TERMINAL_MCP_ROOT": "/Users/you/projects"
}
}
}
}
Granting File Access
By default, read_file and write_file only work inside $ROOT/claude_playground/. To grant access to additional paths, add them to claude_playground/path.txt:
# One absolute path per line
/Users/you/projects/my-app
/Users/you/Documents/notes
Changes take effect immediately — no restart needed.
Environment Variables
| Variable | Default | Description |
|---|---|---|
TERMINAL_MCP_ROOT |
$HOME |
Base directory for all operations |
TERMINAL_MCP_PLAYGROUND |
claude_playground |
Playground subdirectory name |
TERMINAL_MCP_SHELL |
/bin/zsh (macOS) or /bin/bash |
Shell for command execution |
TERMINAL_MCP_TIMEOUT |
30 |
Default command timeout (seconds) |
Architecture
run_command / list_files / run_workflow
┌─────────────────────────────────────────┐
│ Full ROOT_DIR │
│ │
│ read_file / write_file │
│ ┌──────────────────────────┐ │
│ │ claude_playground/ │ │
│ │ + paths in path.txt │ │
│ │ │ │
│ │ memory_* │ │
│ │ ┌────────────────┐ │ │
│ │ │ memory/ │ │ │
│ │ │ MEMORY.md │ │ │
│ │ │ *.md files │ │ │
│ │ └────────────────┘ │ │
│ └──────────────────────────┘ │
└─────────────────────────────────────────┘
Logging
All actions are logged to claude_playground/terminal.log:
[2025-01-15 14:32:01] [RUN] CMD: ls -la | CWD: /Users/you
[2025-01-15 14:32:05] [READ] FILE: /Users/you/projects/app/config.json
[2025-01-15 14:33:00] [MEMORY] STORE: user role (user)
[2025-01-15 14:33:10] [MEMORY] SEARCH: q=testing type=None hits=2
Requirements
- Python 3.10+
- MCP-compatible client (Claude Desktop, Claude Code, etc.)
License
MIT
Metadata
Release files for terminal-mcp-agent 0.1.1
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 | |
|---|---|---|---|---|
| terminal_mcp_agent-0.1.1.tar.gz | 18.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| terminal_mcp_agent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / terminal_mcp_agent-0.1.1.tar.gz
| Download URL | terminal_mcp_agent-0.1.1.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05e6fafde46491b52a2ba068b42f6b3c77b62c501cea592ab1eeb4a15c2e88c9
|
|
BLAKE2b-256 checksum How to use checksums |
311c319bb95e7967bb0af9ecca3ea2601adb7107edae4c31e04e2e5b1e8dfd8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / terminal_mcp_agent-0.1.1-py3-none-any.whl
| Download URL | terminal_mcp_agent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ddf25159b870fc177cf594f38940b6bf649d067926f24d72813c53ccda14975
|
|
BLAKE2b-256 checksum How to use checksums |
8b462d99f48fda9fd9adf73b1e02473bc12046f48f0a4d428d26c4b5ed2ac3d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for terminal-mcp-agent 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.