This project is an MCP‑like server using the DeepSeek API. It aims to demonstrate the core concepts behind the Model Context Protocol (MCP) by exposing endpoints that allow AI assistants to: - List available tools. - Invoke commands on an active shell session. - Integrate with an AI chat (DeepSeek) that can include special instructions (e.g., CMD: lines) to trigger command execution. - Chat Interf
Add this skill
npx mdskills install OthmaneBlial/term-mcp-deepseekWell-documented MCP-like server with terminal execution via DeepSeek API, though not fully MCP-compliant
This project is an MCP‑like server using the DeepSeek API. It aims to demonstrate the core concepts behind the Model Context Protocol (MCP) by exposing endpoints that allow AI assistants to:
CMD: lines) to trigger command execution.Note: While this implementation captures many of the MCP ideas and includes features like real-time streaming, session management, and basic security, it is not yet a fully compliant MCP server as defined by Anthropic. It is designed as a proof-of-concept, and further enhancements (e.g., complete JSON‑RPC protocol support, advanced authentication, and comprehensive error handling) would be needed for production use.
Chat Interface: A modern web-based chat client (using Flask and Tailwind CSS) where users can interact with the server, now with real-time updates and improved error handling.
AI Integration:
Uses the DeepSeek API to generate responses. The AI can instruct the server to execute terminal commands by including lines beginning with CMD:.
Terminal Command Execution:
Executes shell commands via a persistent Bash session using the pexpect library and returns output to the client, with added real-time streaming capabilities.
MCP Endpoints:
Provides /mcp/list_tools and /mcp/call_tool endpoints that mimic MCP tool discovery and invocation, with expanded protocol support including prompts, resources, and roots.
Real-time Streaming: Server-Sent Events (SSE) for live command execution updates and terminal output.
Security Enhancements: Basic authentication, rate limiting, input validation, and security headers for safer operation.
Multiple Transport Options: Supports both HTTP REST API and STDIO command-line interface for flexibility.
Session Management: Improved session handling and conversation storage.
Docker Support: Containerization for easier deployment and testing.
Clone the repository:
git clone https://github.com/OthmaneBlial/term_mcp_deepseek.git
cd term_mcp_deepseek
Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Install the required dependencies:
pip install -r requirements.txt
Configure your API key:
Update the DEEPSEEK_API_KEY in .env with your DeepSeek API key.
Use the provided startup script for convenience:
chmod +x startup.sh
./startup.sh
Run the Flask server with:
python server.py
Visit http://127.0.0.1:8000 to access the chat interface.
For containerized deployment:
docker-compose up -d
/chatPOST{ "message": "your message here" }CMD:), executes them, and returns the final response./mcp/list_toolsPOSTwrite_to_terminal, read_terminal_output, send_control_character)./mcp/call_toolPOST{
"name": "tool_name",
"arguments": { ... }
}
/stream?session_id=session_idGETProtocol Standardization: Implement JSON‑RPC for a more robust and standardized communication protocol.
Real-time Communication: Add Server‑Sent Events (SSE) or WebSockets for live command output streaming.
Session & Security Enhancements: Introduce per‑user sessions, proper authentication, input sanitization, and comprehensive error handling.
Modular Code Architecture: Further separate API logic from business logic for better maintainability and scalability.
This project is open-source and available under the MIT License.
Install via CLI
npx mdskills install OthmaneBlial/term-mcp-deepseekDeepSeek MCP-like Server for Terminal is a free, open-source AI agent skill. This project is an MCP‑like server using the DeepSeek API. It aims to demonstrate the core concepts behind the Model Context Protocol (MCP) by exposing endpoints that allow AI assistants to: - List available tools. - Invoke commands on an active shell session. - Integrate with an AI chat (DeepSeek) that can include special instructions (e.g., CMD: lines) to trigger command execution. - Chat Interf
Install DeepSeek MCP-like Server for Terminal with a single command:
npx mdskills install OthmaneBlial/term-mcp-deepseekThis downloads the skill files into your project and your AI agent picks them up automatically.
DeepSeek MCP-like Server for Terminal works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.