Terminal MCP Server
Enables AI agents to create and interact with isolated tmux terminal sessions in real time, supporting command execution, output capture, and session management.
README
Terminal MCP Server
An MCP (Model Context Protocol) server that allows AI agents to create and interact with isolated tmux terminal sessions in real time.
Features
- Create sessions — spin up isolated tmux terminals on demand
- Send commands — execute shell commands in any session
- Read output — capture live terminal screen content
- Interrupt — send Ctrl+C to running processes
- Close sessions — clean up when done
Tools
| Tool | Description | Parameters |
|---|---|---|
create_session |
Create a new isolated tmux terminal session | session_id (optional string) |
send_keys |
Send a command to a specific tmux session | session_id (string), command (string) |
get_screen |
Return the current screen output of a tmux session | session_id (string) |
interrupt |
Send Ctrl+C to a running tmux session | session_id (string) |
close_session |
Kill a tmux terminal session | session_id (string) |
Requirements
- Python 3.10+
- tmux
mcppackage (mcp>=1.28.0)
Installation
pip install -r requirements.txt
Usage
Run the server
python Server.py
Configure in opencode
Add to your opencode.json:
{
"mcp": {
"terminal": {
"type": "local",
"command": ["python", "/path/to/Server.py"],
"enabled": true
}
}
}
Test manually
from mcp import StdioClient
import asyncio
async def test():
async with StdioClient("python Server.py") as client:
result = await client.call_tool("create_session", {"session_id": "test-1"})
print(result)
result = await client.call_tool("send_keys", {"session_id": "test-1", "command": "echo hello"})
screen = await client.call_tool("get_screen", {"session_id": "test-1"})
print(screen)
asyncio.run(test())
How it works
Each session is backed by a tmux window. Commands are sent via tmux send-keys, output is captured via tmux capture-pane. Sessions persist until explicitly closed.
You can attach to any running session to watch the AI interact in real time:
tmux attach -t <session_id>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.