Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

term_mcp_deepseek

MCP.Pizza Chef: OthmaneBlial

term_mcp_deepseek is a prototype MCP-like server that integrates the DeepSeek API to enable AI assistants to interact with terminal sessions. It exposes endpoints for listing tools, executing shell commands, and supporting AI chat with command triggers. Designed as a proof-of-concept, it demonstrates core MCP concepts but lacks full compliance and production features like JSON-RPC, real-time updates, and advanced security.

Use This MCP server To

Execute shell commands via AI-driven terminal sessions List and manage available terminal tools programmatically Integrate AI chat with terminal command execution Prototype AI-assisted terminal workflows Demonstrate MCP concepts with terminal interaction

README

DeepSeek MCP-like Server for Terminal

This project is a prototype implementation of 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.

Note: While this implementation captures many of the MCP ideas, 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., JSON‑RPC protocol support, real‑time updates via SSE, session management, and improved security) would be needed for production use.

Features

  • Chat Interface:
    A simple web-based chat client (using Flask and Tailwind CSS) where users can interact with the server.

  • 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.

  • MCP Endpoints:
    Provides /mcp/list_tools and /mcp/call_tool endpoints that mimic MCP tool discovery and invocation.

Getting Started

Prerequisites

  • Python 3.8+
  • pip
  • A valid DeepSeek API key

Installation

  1. Clone the repository:

    git clone https://github.com/OthmaneBlial/term_mcp_deepseek.git
    cd term_mcp_deepseek
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Configure your API key:

    Update the DEEPSEEK_API_KEY in .env with your DeepSeek API key.

Running the Server

Run the Flask server with:

python server.py

Visit http://127.0.0.1:5000 to access the chat interface.

Endpoints

Chat Endpoint

  • URL: /chat
  • Method: POST
  • Payload: { "message": "your message here" }
  • Description:
    Adds the user message to the conversation, sends it to the DeepSeek API, looks for any command instructions (CMD:), executes them, and returns the final response.

MCP Endpoints

List Tools
  • URL: /mcp/list_tools
  • Method: POST
  • Response:
    JSON listing available tools (e.g., write_to_terminal, read_terminal_output, send_control_character).
Call Tool
  • URL: /mcp/call_tool
  • Method: POST
  • Payload:
    {
      "name": "tool_name",
      "arguments": { ... }
    }
  • Description:
    Directly invoke a tool command on the server.

Future Improvements

  • Protocol 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.

License

This project is open-source and available under the MIT License.

term_mcp_deepseek FAQ

How does term_mcp_deepseek handle command execution?
It allows AI assistants to invoke commands on an active shell session through exposed endpoints.
Is term_mcp_deepseek fully compliant with the MCP specification?
No, it is a proof-of-concept and lacks full compliance features like JSON-RPC and session management.
What kind of AI integration does term_mcp_deepseek support?
It integrates with the DeepSeek API to enable AI chat that can trigger terminal commands.
Can term_mcp_deepseek be used in production environments?
Currently, it is designed as a prototype and requires enhancements for production use, including improved security and real-time updates.
What user interface does term_mcp_deepseek provide?
It includes a simple web-based chat client built with Flask and Tailwind CSS for user interaction.
How does term_mcp_deepseek demonstrate MCP concepts?
By exposing terminal tools and command execution capabilities to AI models, illustrating real-time context and control.
What improvements are planned for term_mcp_deepseek?
Planned enhancements include JSON-RPC support, server-sent events for real-time updates, session management, and better security.