A simple Model Context Protocol (MCP) server built with FastMCP.
The Model Context Protocol (MCP) is a standardized way to connect LLMs to external data sources and tools. Think of it as an API specifically designed for LLM interactions.
This server provides essential MCP tools that extend LLM capabilities with real-world actions:
get_current_time()- Get current timestampgreet(name, enthusiastic)- Generate greeting messages
read_file(path)- Read file contentswrite_file(path, content)- Write content to filelist_directory(path)- List directory contentsfile_exists(path)- Check if file/directory existsget_file_size(path)- Get file size in bytes
search_docs(query, directory)- Search documentation files for querysummarize_file(path)- Summarize a documentation filegenerate_readme(directory)- Generate README template
update_documentation(directory, doc_file)- Update existing docs with current codebase infogenerate_api_collection(directory, format)- Generate Postman or Swagger/OpenAPI collectiongenerate_integration_doc(directory, output_file)- Generate integration documentation for frontend-backend integrationanalyze_api_endpoints(directory)- Analyze and list all API endpoints in codebaseextract_data_models(directory)- Extract data models and schemasgenerate_api_client_stub(directory, language)- Generate API client stub (TypeScript/Python/JavaScript)
validate_email_format(email)- Validate email format
get_system_info()- Get OS, CPU, memory infoget_disk_usage(path)- Get disk usage statisticsget_cpu_percent()- Get current CPU usageget_memory_info()- Get detailed memory info
fetch_url(url)- Fetch content from URLcheck_url_status(url)- Check if URL is accessibleextract_domain(url)- Extract domain from URL
send_email(to, subject, body, html)- Send email via Gmailsend_email_with_attachment(to, subject, body, file_path)- Send email with attachmentparse_email_address(email_string)- Parse email name and address
Data sources that LLMs can read:
info://server- Server information and capabilitiesconfig://settings- Configuration settingsdata://user/{user_id}- User data (dynamic template)
Reusable templates for LLM interactions:
summarize_text(text)- Generate summarization promptscode_review(code, language)- Generate code review prompts
Note
This server focuses on tools that provide real capabilities LLMs cannot do themselves:
- File system access
- Documentation search and indexing
- System information
- Network requests
- Email sending
Redundant tools (string manipulation, JSON parsing, base64 encoding) have been removed since LLMs can handle these natively.
Tip
See tools.json for a complete catalog of all tools with detailed parameter descriptions.
- Python 3.10 or higher (FastMCP requires Python 3.10+)
You can check your Python version with:
python3 --version- Install dependencies:
pip install -r requirements.txtOr using uv (recommended):
uv pip install -r requirements.txtTo enable email functionality via Gmail SMTP:
-
Copy the environment template:
cp .env.example .env
-
Generate a Gmail App Password:
- Enable 2-Factor Authentication on your Google Account
- Go to https://myaccount.google.com/apppasswords
- Generate an app password for "Mail"
- Copy the 16-character password
-
Configure your
.envfile:GMAIL_USER=your-email@gmail.com GMAIL_APP_PASSWORD=your-16-char-app-password SMTP_SERVER=smtp.gmail.com SMTP_PORT=587
-
See detailed instructions: EMAIL_SETUP.md
Important
The .env file is gitignored and will never be committed. Keep your credentials secure!
Run the server using the entry point:
# Option 1: Direct Python execution
./venv/bin/python run_server.py
# Option 2: Make it executable and run directly
chmod +x run_server.py
./run_server.pyImportant
Always use the virtual environment Python to ensure dependencies are available.
You can test the server using an MCP client like Claude Desktop or by using FastMCP's built-in testing tools.
FastMCP provides a development mode for testing:
fastmcp dev server.pyTo use this MCP server with Cursor IDE:
- Add to Cursor Settings:
- Open Cursor Settings (Cmd+,)
- Search for "MCP" or go to Features β Model Context Protocol
- Click "Edit Config" and add:
{
"mcpServers": {
"simple-server": {
"command": "/Users/tanmay/Developer/mymcp/venv/bin/python",
"args": ["/Users/tanmay/Developer/mymcp/server.py"]
}
}
}-
Restart Cursor completely (Cmd+Q, then reopen)
-
Verify - The server tools and resources will be available to Cursor's AI
mymcp/
βββ src/
β βββ mymcp/ # Main package
β βββ __init__.py # Package exports
β βββ server.py # Server initialization
β βββ config.py # Environment & settings
β βββ tools/ # Tool modules
β β βββ __init__.py
β β βββ basic.py # Basic utilities
β β βββ files.py # File operations
β β βββ docs.py # Documentation tools
β β βββ code.py # Code analysis & integration
β β βββ validation.py # Email validation
β β βββ system.py # System info
β β βββ web.py # Web utilities
β β βββ email.py # Email tools
β βββ resources/ # Resource modules
β β βββ __init__.py
β β βββ info.py # Server info
β βββ prompts/ # Prompt modules
β βββ __init__.py
β βββ templates.py
βββ run_server.py # Entry point
βββ mcp.json # MCP client configuration
βββ tools.json # Tool catalog with descriptions
βββ requirements.txt # Dependencies
βββ .env.example # Env template
βββ .env # Your credentials (gitignored)
βββ EMAIL_SETUP.md # Gmail setup guide
βββ MCP_SETUP.md # MCP configuration guide
βββ README.md # This file
To extend this server further, you can:
- Add more specialized tools for your use case
- Connect to databases or external APIs
- Create custom prompts for specific workflows
- Add authentication for other services (GitHub, Azure, etc.)
- Deploy to production using FastMCP Cloud
- Integrate with other email providers (SendGrid, Mailgun, etc.)
| Category | Tools | Description |
|---|---|---|
| π§ Basic Utilities | 2 | Time and greetings |
| π File Operations | 5 | Read, write, list files |
| π Documentation | 3 | Search, summarize, generate docs |
| π» Code Analysis | 6 | Integration docs, API analysis, Postman/Swagger generation |
| β Validation | 1 | Email format validation |
| π» System Info | 4 | CPU, memory, disk usage |
| π Web Utilities | 3 | HTTP requests, URL parsing |
| π§ Email | 3 | Gmail SMTP integration |
| Total | 27 | Focused on real capabilities |
Philosophy: This server provides only tools that give LLMs real-world capabilities they cannot achieve through text generation alone. Redundant tools for string manipulation, JSON parsing, and encoding have been removed.