Simple MCP
A modular MCP server that provides comprehensive system automation capabilities including file operations, Telegram integration, job scheduling, system control, and YouTube downloads. Features persistent data storage and a clean architecture for easy extension and maintenance.
README
MCP Server - Modular Architecture
This MCP (Model Context Protocol) server is built with a clean, modular architecture for maintainable, scalable, and robust development.
š Project Structure
MCP-test/
āāā main.py # Main entry point
āāā config.py # Configuration and constants
āāā persistence.py # Data persistence layer
āāā scheduler.py # Job scheduling functionality
āāā tools/ # MCP tools organized by concern
ā āāā __init__.py # Tools package initialization and registry
ā āāā basic_tools.py # Basic utility tools
ā āāā control_tools.py # Server control tools (restart, shutdown, etc)
ā āāā file_tools.py # File system operations
ā āāā persistence_tools.py # Persistence management tools
ā āāā scheduling_tools.py # Scheduling-related tools
ā āāā system_tools.py # System information and commands
ā āāā telegram_tools.py # Telegram integration
ā āāā youtube_tools.py # YouTube-related tools
āāā requirements.txt # Python dependencies
āāā .env # Environment variables (create this)
āāā README.md # This file
š Quick Start
-
Install dependencies:
pip install -r requirements.txt -
Create environment file:
# Create .env file with your configuration TG_TOKEN=your_telegram_bot_token ADMIN_ID=your_telegram_chat_id -
Run the server:
python main.py
š Available Tools
Basic Tools
echoā Echo back input text
File Tools
read_fileā Read the contents of a filewrite_fileā Write content to a filecreate_fileā Create a new empty filecreate_folderā Create a new directorylist_filesā List files and folders in a directorydelete_fileā Delete a filerename_fileā Rename or move a filemove_folderā Move a folder (directory) to a new location
System Tools
system_infoā Get basic system information (platform, memory, CPU, etc.)list_processesā List running processes (PID, name, user)run_python_codeā Execute a Python code snippet and return the outputinstall_python_libraryā Install a Python library (via pip) and update requirements.txt
Telegram Integration
send_telegram_messageā Send Telegram messages, audio, video, or documents (with optional metadata)receive_telegram_updatesā Receive and download incoming Telegram messages and files
Scheduling & Job Tools (still in testing)
schedule_telegram_messageā Schedule a Telegram message to be sent at a specific time (supports ISO datetime or relative times like "in 10 minutes")schedule_function_callā Schedule any registered function to run once at a specified timeschedule_recurring_jobā Schedule recurring jobs using cron expressions or intervals (e.g., "every 5 minutes", "0 9 ** 1-5")list_scheduled_jobsā List all currently scheduled jobs with detailscancel_scheduled_jobā Cancel a scheduled job by its IDget_available_functionsā List all functions available for schedulingget_job_execution_logā View the execution history and results of scheduled jobs
Persistence Tools
update_persistent_infoā Add or update a key-value pair in persistent storageget_persistent_infoā Retrieve all persistent data, or a specific key's valuedelete_persistent_info_keyā Delete a key from persistent storage
Control Tools
type_textā Simulate typing text using the keyboardpress_hotkeyā Press a combination of keys as a hotkey (e.g., Ctrl+Tab)switch_to_windowā Switch focus to a window with a specified titlelist_open_windowsā List the titles of all currently open windowsmove_mouse_toā Move the mouse cursor to specified screen coordinatesclick_mouseā Click the mouse at specified coordinates or at the current position
YouTube Tools
youtube_download_videoā Download a YouTube video as MP4youtube_download_audioā Download YouTube audio as MP3youtube_video_infoā Get detailed YouTube video information
š§ Architecture Benefits
Separation of Concerns
- config.py: Centralized configuration
- persistence.py: Data storage abstraction
- scheduler.py: Scheduling logic isolated
- tools/: Tools organized by functionality
Maintainability
- Add new tools by creating new modules
- Clear dependencies between components
- Consistent error handling and logging
Scalability
- Modular design for easy extension
- Shared MCP instance prevents conflicts
- Function registry enables dynamic scheduling
š Data Persistence
The server automatically persists:
- Scheduled Jobs: Survives server restarts
- Execution Logs: Detailed job run history
- Persistent Info: Custom key-value storage
Files created:
scheduled_jobs.jsonā Job definitionsjob_execution_log.jsonā Execution historypersistent_info.jsonā Custom datamain.logā Application logserror.logā Error logs
š ļø Development
Adding New Tools
- Create a new module in
tools/ - Import the shared MCP instance:
from . import mcp - Define your tool function with
@mcp.tool()decorator - Register the function in
tools/__init__.pyif needed
Adding New Persistence Functions
- Add functions to
persistence.py - Import and use them in your tools
- Follow the existing pattern for error handling
š Troubleshooting
- Check logs in
main.loganderror.log - Verify environment variables in
.env - Ensure all dependencies are installed
- Check file permissions for persistence
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.