MCPInstall
mcp_test logo

mcp_test

by Ahmadfareedkhan Ahmadfareedkhan/mcp_test
READMEmain

MCP Command Execution System

A Model Context Protocol (MCP) implementation that enables natural language system commands through LLM integration.

Quick Start

  1. Install Dependencies
pip install mcp groq httpx python-dotenv
  1. Set Up Environment
# Create .env file with your Groq API key
echo "GROQ_API_KEY=your_api_key_here" > .env
  1. Run the System
# Start the server in one terminal
python mcp_server.py

# Run commands in another terminal
python mcp_client.py "list the top CPU processes"
python mcp_client.py "show network adapter configuration"

Features

  • Natural language to system command translation
  • Secure command execution with validation
  • Real-time system information querying
  • Formatted output display

Components

MCP Client

  • Processes natural language queries
  • Integrates with Groq LLM
  • Handles MCP protocol communication
  • Manages command execution

MCP Server

  • Executes system commands securely
  • Provides resource access
  • Formats command output
  • Implements MCP protocol standards

Usage Examples

# System processes
python mcp_client.py "show me the processes using the most memory"

# Network configuration
python mcp_client.py "display network adapter status"

# System information
python mcp_client.py "show CPU information"

Requirements

  • Python 3.10 or higher
  • Groq API key
  • Windows PowerShell (for system commands)

Project Structure

├── mcp_client.py    # Client implementation
├── mcp_server.py    # Server implementation
├── llm_utils.py     # LLM integration
└── .env            # Environment variables

Technical Details

For detailed technical information about the implementation, including:

  • Architecture diagrams
  • Protocol compliance
  • Security considerations
  • Testing procedures

Please refer to the Technical Documentation.

References

Security Notes

  • The server implements command validation
  • Dangerous system commands are blocked
  • All operations are logged
  • Execution timeouts are enforced