Skip to content

jyotirmoy-devops/mcp-shellserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShellServer MCP Example

This project demonstrates a simple MCP server using the MCP Python SDK. The server exposes a single tool, call_terminal, which allows users to run terminal commands asynchronously and receive their output.

Features

  • Exposes a single tool: call_terminal
  • Allows running terminal commands from MCP-compatible clients
  • Asynchronous implementation for non-blocking command execution

Prerequisites

Installation

  1. Clone the repository (if you haven't already):

    git clone <your-repo-url>
    cd shellserver
  2. Install dependencies (using pip):

    pip install "mcp[cli]"

    Or with uv:

    uv pip install "mcp[cli]"

Usage

Start the MCP Server

Run the server script:

python server.py

Or, for development/testing with the MCP CLI:

mcp dev server.py

How the Tool Works

The server exposes a tool called call_terminal that takes a single argument:

  • command (str): The shell command to execute.

It returns the standard output or error from the command.

Example Usage

If you connect to this server using an MCP-compatible client, you can call the tool like this:

  • Tool name: call_terminal
  • Arguments:
    • command: echo Hello, MCP!

Response:

Hello, MCP!

Security Note

This tool executes arbitrary shell commands. For demonstration and local use only. Do not expose this server to untrusted users or production environments.

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors