Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A DeepSeek MCP-like Server for Terminal

README.md

DeepSeek MCP-like Server for Terminal

![Trust Score](https://archestra.ai/mcp-catalog/othmaneblial__term_mcp_deepseek) 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.

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.

Features

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

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
  1. Create and activate a virtual environment:
   python3 -m venv venv
   source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. Install the required dependencies:
   pip install -r requirements.txt
  1. Configure your API key:

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

Running the Server

Quick Start

Use the provided startup script for convenience:

chmod +x startup.sh
./startup.sh

Manual Start

Run the Flask server with:

python server.py

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

Docker

For containerized deployment:

docker-compose up -d

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.

Real-time Streaming

  • URL: /stream?session_id=session_id
  • Method: GET
  • Description: Server-Sent Events endpoint for real-time command output updates.

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.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Other servers.