Used as the web framework for building the MCP server, enabling the creation of API endpoints that handle client requests
Implements file system operations through a dedicated file server component, providing secure file reading, writing, and directory listing capabilities
Integrates quality assurance checks that run automatically before code is committed, ensuring consistent code quality
Provides data validation and serialization for the MCP server, ensuring request and response data adheres to defined schemas
Provides comprehensive testing framework integration for validating MCP server functionality
Serves as the primary programming language for implementing the MCP server framework
Integrated for code linting to maintain code quality and consistency
Enables database functionality for the MCP server with examples for safely executing queries with SQL injection prevention
Python MCP Server Development with Cursor Rules
A comprehensive development framework for Python MCP servers with enforced incremental development practices
🌟 What This Is
This repository showcases a production-ready development framework for building Python MCP (Model Context Protocol) servers using Cursor Rules. The system enforces incremental development practices and provides comprehensive guidelines for building reliable, secure, and maintainable MCP servers.
🚀 Key Features
🎯 Enforced Incremental Development
- NEVER create multiple untested files at once
- Mandatory TODO.md and TASKS.md management
- Step-by-step development workflow
- Built-in quality gates
🔧 Comprehensive Tooling
- UV integration for modern Python dependency management
- Type checking with mypy
- Code formatting with black and isort
- Testing with pytest and pytest-asyncio
- Pre-commit hooks for quality assurance
🛡️ Security First
- File path validation and directory traversal protection
- SQL injection prevention
- Input sanitization and validation
- Comprehensive error handling
📋 Smart Rule System
- Auto-attached rules based on file location
- Manual rules for deployment and troubleshooting
- Always-active rules for global standards
- Context-aware development guidelines
📁 Repository Structure
🎯 Development Philosophy
The Incremental Approach
This framework is built around a strict incremental development methodology:
- 📋 Plan First - Update TODO.md with specific tasks
- 🔨 Implement One Thing - Build one component at a time
- 🧪 Test Immediately - Write and run tests before proceeding
- ✅ Verify - Ensure current step works completely
- 📝 Document - Update progress and notes
Why This Matters
- Reduces bugs by catching issues early
- Improves code quality through focused development
- Enhances maintainability with clear progression
- Increases reliability through comprehensive testing
- Accelerates debugging with smaller change sets
🛠️ How the Rule System Works
Auto-Attached Rules
Rules automatically apply based on your file location:
Manual Rules
Call specific rules in Cursor chat when needed:
Always-Active Rules
Core development standards apply everywhere:
- Type hints are mandatory
- Error handling is required
- Tests must be written
- Documentation is enforced
🚀 Quick Start
1. Copy the Rules
2. Initialize Your Project
3. Create Task Files
4. Start Development
The rules will automatically guide you through:
- Creating minimal implementations first
- Writing tests immediately
- Following security best practices
- Maintaining proper documentation
📊 Examples
File Server Example
Database Server Example
📚 Documentation
Core Rules
- Main Development Rules - Primary development guidelines
- Global Standards - Universal development standards
- File Server Rules - File operation specific guidelines
- Database Server Rules - Database operation guidelines
Operational Guides
- Deployment Guide - Production deployment procedures
- Troubleshooting - Debugging and problem resolution
🎯 Benefits
For Developers
- Faster development with clear guidelines
- Fewer bugs through incremental approach
- Better code quality with enforced standards
- Easier debugging with comprehensive logging
For Teams
- Consistent code style across projects
- Reduced onboarding time for new developers
- Better collaboration with clear practices
- Improved maintainability of codebases
For Projects
- Higher reliability through comprehensive testing
- Better security with built-in protections
- Easier deployment with detailed guides
- Faster troubleshooting with comprehensive documentation
🔄 Development Workflow Example
🤝 Contributing
This showcase demonstrates best practices for MCP server development. Feel free to:
- Use these rules in your own projects
- Adapt the system to your specific needs
- Share improvements through issues and discussions
- Contribute examples for different use cases
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built for the Cursor AI IDE
- Designed for MCP (Model Context Protocol)
- Powered by UV for Python package management
Remember: The key to successful development is not speed, but consistency and quality. This framework helps you achieve both through disciplined, incremental development practices.
🚀 Ready to transform your MCP server development? Copy the .cursor
directory to your project and start building better, faster, and more reliably!
This server cannot be installed
A comprehensive framework for building reliable Python MCP servers that enforces incremental development practices through Cursor Rules, featuring built-in security measures and a smart rule system.
Related MCP Servers
- -securityFlicense-qualityThis is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.Last updated -Python
- AsecurityAlicenseAqualityA server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.Last updated -33PythonMIT License
- -securityAlicense-qualityA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.Last updated -14PythonMIT License
- -securityAlicense-qualityA template repository for creating custom Model Context Protocol (MCP) servers in Python that can be integrated with applications like Claude Desktop or Cursor.Last updated -4PythonMIT License