Skip to main content

Connect your local terminal to AI agents via MCP (Model Context Protocol). Provides secure shell, file read/write, and directory listing tools over WebSocket.

Project description

Local Terminal MCP Server

PyPI version Python 3.10+ License: MIT

Connect your local terminal to AI agents via MCP (Model Context Protocol). Provides secure shell execution, file read/write, and directory listing — all over an authenticated WebSocket connection.

Installation

pip install local-terminal-mcp

Requires Python 3.10+.

Quick Start

# Connect to Agent Builder (opens browser for authentication)
local-terminal-mcp connect --team <your_team_id>

On first run, a browser window opens for OAuth authentication. Subsequent runs use a cached token — no repeated logins.

Keep the terminal window open while the connection is active. Press Ctrl+C to disconnect.

Available Tools

Once connected, AI agents can use these tools on your machine:

Tool Description
execute_command Run shell commands
read_file Read file contents
write_file Write to files
list_directory List directory contents

Security

All commands are validated before execution. By default, dangerous commands (rm -rf /, shutdown, mkfs, etc.) are blocked, and sensitive system paths (/etc, /sys, /proc, /root) are protected.

For maximum security, enable whitelist mode — only explicitly allowed commands will run:

LT_MCP_WHITELIST_ONLY=true local-terminal-mcp connect --team <team_id>

Security summary

  • Commands validated before execution (dangerous commands blocked)
  • Sensitive system paths are protected
  • All connections require JWT authentication (OAuth PKCE)
  • Configurable whitelist mode

Configuration

Configuration is done via environment variables (prefix LT_MCP_):

Variable Default Description
LT_MCP_WHITELIST_ONLY false Only allow whitelisted commands
LT_MCP_BLOCKED_PATHS ["/etc","/sys","/proc","/root","/boot"] Protected paths
LT_MCP_MAX_COMMAND_TIMEOUT 300 Max command timeout (seconds)
LT_MCP_LOG_LEVEL INFO Logging level

You can also place these in a .env file in the working directory.

CLI Commands

local-terminal-mcp connect    # Connect to Agent Builder
local-terminal-mcp status     # Show auth & config status
local-terminal-mcp logout     # Clear cached tokens
local-terminal-mcp test       # Test tools locally (no server needed)
local-terminal-mcp version    # Show version

Advanced Usage

CI / Headless Environments

Pass a JWT token directly (skips browser auth):

local-terminal-mcp connect --token "YOUR_JWT_TOKEN" --team <team_id>

Custom Server URL

local-terminal-mcp connect --url wss://your-server.example.com --team <team_id>

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

local_terminal_mcp-0.1.0.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

local_terminal_mcp-0.1.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file local_terminal_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: local_terminal_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for local_terminal_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5d514c8f90504ee96530f9abd1f252c17b57e1ccb84d4f04c64af46b8b97f447
MD5 6a496b073b0fcd5d808ada901fe2fc4e
BLAKE2b-256 ebf47b6562ed030bdae11cfb2c9c4692550571eb32e238cdfc551789ec08ba76

See more details on using hashes here.

File details

Details for the file local_terminal_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for local_terminal_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0926e4eab41711e05bc290add73ff02e5d6ad768e6c59fd31e1fa9698ab8cf3
MD5 7f7de75389f4f67cce00b1c874a9c6fa
BLAKE2b-256 d54798ecffe4185219c71a5e4e7ab5cb5de73ff109b86a5cb07ef049e8f7a595

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page