Provides comprehensive tools for Android app development including project analysis, file creation, UI component generation, database setup, and build management
Integrates with Android Studio for seamless development workflow including project structure analysis, code generation, and build automation
Supports Docker deployment and containerization of the MCP server for consistent development environments
Integrates with GitHub Actions for continuous integration and automated testing workflows
Provides cloud storage integration with Google Cloud services including encrypted file synchronization and backup capabilities
Executes Gradle build tasks, manages dependencies, and handles Android project compilation and testing
Supports GraphQL API integration for network layer setup and data querying in Android applications
Integrates with IntelliJ IDEA for enhanced Kotlin and Android development with MCP tool support
Generates Jetpack Compose UI components, screens, and layouts with Material Design support and best practices
Generates comprehensive unit tests using JUnit5 framework with mocking support and test coverage analysis
Creates and manages Kotlin source files, data classes, and Android-specific code with proper package structure and formatting
Integrates with local Ollama models for privacy-preserving AI code analysis, generation, and assistance without external API calls
Supports ONNX model integration for machine learning capabilities in Android applications
Leverages OpenAI's GPT models for intelligent code generation, analysis, and development assistance with configurable privacy settings
Uses Pydantic for data validation and serialization in MCP tool configurations and API interactions
Implemented in Python with comprehensive tooling for Android development, security compliance, and AI integration
Enables PyTorch Mobile model integration for on-device machine learning in Android applications
Provides database abstraction and ORM capabilities for advanced data management and migration handling
Manages SQLite database operations with encryption support for secure local data storage in Android apps
Supports TensorFlow Lite model integration for machine learning inference in Android applications
Enterprise Kotlin Android MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI agents with enterprise-grade access to Kotlin-based Android development projects. This server enables context-aware assistance with advanced security, privacy compliance, AI integration, and comprehensive development tools.
๐ Revision History
Version 2.1 (Current - August 2025)
Enhanced Release: Unified Intelligent Server
๐ฏ Latest Improvements
- ๐ง Intelligent Tool Management: All 27 tools now use intelligent proxy system with LSP-like capabilities 
- ๐ Server Consolidation: Unified into single - kotlin_mcp_server.pywith enhanced architecture
- ๐ Clean Architecture: Archived redundant server versions for cleaner project structure 
- โก Enhanced Tool Exposure: Complete tool suite properly exposed through intelligent management system 
- ๐ ๏ธ Improved Tool Routing: Smart delegation between native implementations and intelligent proxies 
๐ง Architectural Changes
- Unified Server: Single - kotlin_mcp_server.pyreplaces multiple server versions
- Intelligent Proxy System: Tools without full implementations use smart proxies with AI enhancement 
- Clean File Structure: Legacy servers archived in - archive/legacy-servers/
- Enhanced Tool Manager: Integration with - IntelligentMCPToolManagerfor advanced capabilities
- Complete Tool Coverage: All 32 tools properly exposed and functional 
๐ Tool Implementation Status
- Fully Implemented: 6 tools (format_code, run_lint, generate_docs, create_compose_component, setup_mvvm_architecture, security_hardening) 
- Legacy Integration: 3 core tools (create_kotlin_file, gradle_build, analyze_project) 
- Intelligent Proxies: 23 tools with smart fallback implementations 
- Total Available: 32 tools with comprehensive Android development coverage 
Version 2.0 (August 2025)
Major Release: AI-Enhanced Modular Architecture
๐ฏ Key Improvements
- ๐ค AI Integration: Transformed from template generator to AI-powered development assistant 
- ๐๏ธ Modular Architecture: Refactored monolithic structure into 6 specialized modules 
- ๐ Dynamic Configuration: Eliminated all hardcoded paths for cross-platform portability 
- โก Enhanced Tools: Expanded from 30 to 31 tools with AI-enhanced implementations 
- ๐ก๏ธ Security Hardening: Added configurable audit trails and compliance monitoring 
- ๐ฆ Zero-Config Setup: Intelligent installer with automatic environment detection 
๐ง Technical Changes
- Modular Design: Split into - ai/,- android/,- gradle/,- security/,- testing/,- utils/modules
- AI-Powered Code Generation: Leverages calling LLM for production-ready code (no TODOs) 
- Environment Variable Support: All configurations now use dynamic environment variables 
- Cross-Platform Paths: Universal - ~notation replaces OS-specific hardcoded paths
- Enhanced Error Handling: Comprehensive validation and graceful failure recovery 
- Performance Optimization: Streamlined tool execution with better resource management 
๐ Migration Impact
- Tools: 30 โ 32 tools (107% feature parity + enhancements) 
- File Size: Optimized modular structure vs. monolithic approach 
- Configuration: Zero manual path configuration required 
- Compatibility: Maintains full backward compatibility with existing setups 
Version 1.0 (Legacy - Pre-August 2025)
Initial Release: Template-Based Code Generator
- โ Basic MCP server with 30 tools 
- โ Template-based Kotlin/Android code generation 
- โ Manual configuration with hardcoded paths 
- โ Monolithic architecture 
- โ Basic security and compliance features 
๐ Enterprise Features Overview
๐ Security & Privacy Compliance
- GDPR Compliance - Complete implementation with consent management, data portability, right to erasure 
- HIPAA Compliance - Healthcare-grade security with audit logging, access controls, encryption 
- Data Encryption - AES-256 encryption with PBKDF2 key derivation for sensitive data 
- Audit Trails - Comprehensive logging with compliance flags and security event tracking 
- Privacy by Design - Built-in privacy protection for all operations 
๐ค AI/ML Integration
- Local LLM Support - Ollama, LocalAI, and self-hosted transformers 
- External LLM APIs - OpenAI GPT-4, Anthropic Claude, custom endpoints 
- AI-Powered Code Analysis - Security, performance, and complexity analysis 
- Intelligent Code Generation - Context-aware Kotlin/Android code creation 
- ML Model Integration - TensorFlow Lite, ONNX, PyTorch Mobile for Android apps 
๐ Advanced File Management
- Enterprise File Operations - Backup, restore, sync, encrypt, decrypt with audit trails 
- Real-time Synchronization - File system watchers with automatic sync 
- Cloud Storage Integration - AWS S3, Google Cloud, Azure with end-to-end encryption 
- Smart File Classification - Automatic sensitive data detection and encryption 
- Version Control - Git-aware operations with conflict resolution 
๐ External API Integration
- Comprehensive Auth Support - API Keys, OAuth 2.0, JWT, Basic Auth 
- Security Features - Rate limiting, request logging, response validation 
- Real-time Monitoring - API usage metrics, performance tracking, cost analysis 
- Compliance Validation - GDPR/HIPAA compliant API handling 
๐๏ธ Advanced Android Development
- Architecture Patterns - MVVM, Clean Architecture, Dependency Injection 
- Modern UI Development - Jetpack Compose, custom views, complex layouts 
- Database Integration - Room with encryption, migration handling 
- Network Layer - Retrofit, GraphQL, WebSocket support 
- Testing Framework - Comprehensive test generation and execution 
๐ Quick Start & Installation
โจ Upgrade to V2.0 Highlights
๐ค AI-Enhanced Development: Now leverages your AI assistant for production-ready code generation instead of basic templates!
Before (V1.0):
- โ Template-based code with TODO placeholders 
- โ Manual path editing in config files 
- โ Monolithic architecture (single large file) 
- โ Hardcoded paths and user-specific configurations 
- โ 30 basic tools with limited AI integration 
After (V2.0):
- โ AI-Powered Code Generation: Complete, context-aware implementations 
- โ Zero-Configuration Setup: - python3 install.pyhandles everything
- โ Modular Architecture: Clean, maintainable 6-module structure 
- โ Dynamic Configuration: Cross-platform with environment variables 
- โ 31 Enhanced Tools: AI-integrated with intelligent error handling 
๐ System Requirements
- Python 3.8+ (3.9+ recommended) 
- pip (Python package manager) 
- Git (for cloning repository) 
- IDE with MCP support (VS Code, JetBrains IDEs, Claude Desktop) 
๐ง Installation Steps
1. Clone Repository
2. Automated Installation & Configuration
The project includes an enhanced installation script that handles all configuration automatically:
Installation Types:
- 1- Portable: Run directly from project directory
- 2- System: Install command to PATH (- kotlin-android-mcp)
- 3- Module: Enable- python -m kotlin_mcp_server
Configuration Examples:
What the installer does:
- โ Installs all Python dependencies from - requirements.txt
- โ Creates platform-specific config files (Claude, VS Code, generic) 
- โ Sets up proper file permissions for scripts 
- โ Configures environment variables based on your choices 
- โ Eliminates manual path updates in configuration files 
- โ Provides clear integration instructions for your setup 
3. Manual Installation (Alternative)
If you prefer manual installation:
Key Dependencies Installed:
- Core MCP: - python-dotenv,- pydantic
- Security: - cryptography,- bcrypt,- PyJWT
- Database: - aiosqlite,- sqlalchemy
- HTTP Clients: - aiohttp,- httpx
- File Management: - aiofiles,- watchdog
- Testing: - pytest,- pytest-asyncio,- coverage
- Code Quality: - black,- flake8,- pylint,- mypy
- Security Tools: - bandit,- safety
4. V2.0 Architecture & Tool Enhancements
๐๏ธ Modular Architecture Design
The V2.0 release introduces a clean, maintainable modular structure:
๐ค AI-Enhanced Tool Capabilities
| Tool Category | V1.0 (Templates) | V2.0 (AI-Enhanced) | 
| Code Generation | Basic templates with TODOs | Production-ready, context-aware implementations | 
| Architecture Patterns | Skeleton code | Complete MVVM, Clean Architecture patterns | 
| UI Components | Static layouts | Dynamic Jetpack Compose with business logic | 
| Database Operations | Schema templates | Full Room implementation with migrations | 
| Testing | Test stubs | Comprehensive test suites with edge cases | 
| Security | Basic validation | Enterprise-grade security with compliance | 
โก Performance & Reliability Improvements
- 31 Tools (vs 30 in V1.0) with enhanced AI integration 
- Error Recovery: Graceful handling of AI service interruptions 
- Context Awareness: Tools understand project structure and requirements 
- Resource Optimization: Efficient memory usage and faster execution 
- Cross-Platform Support: Universal configuration system 
5. IDE Integration Setup
After installation, the script generates ready-to-use configuration files:
- mcp_config_claude.json- For Claude Desktop
- mcp_config_vscode.json- For VS Code and Cursor
- mcp_config.json- For other MCP clients
Integration Instructions:
๐น Claude Desktop: Copy content from mcp_config_claude.json to:
- Mac: - ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: - %APPDATA%\Claude\claude_desktop_config.json
- Linux: - ~/.config/claude/claude_desktop_config.json
๐น VS Code/Cursor: Add to your VS Code settings.json:
๐น Other IDEs: Use mcp_config.json with your MCP client
5. Environment Configuration (Advanced)
For advanced users who need custom environment setup:
Create a .env file in the project root (only needed for advanced configurations):
Optional Variables:
๐ก Note: The installation script automatically configures project paths and server settings, so manual environment configuration is only needed for advanced features like AI integration or custom security settings.
6. Install Required IDE Extensions/Plugins
See the Plugin Requirements section below for IDE-specific extensions.
7. Test Installation
โก Quick Setup Commands
๐ฏ Installation Summary
The enhanced installation process has eliminated the need for manual configuration:
โ
 Before (Manual): Users had to manually edit config files, find paths, update environment variables
โ
 After (Automated): One command creates everything ready-to-use
Key Improvements:
- ๐ Zero Manual Configuration: No more path updates or variable editing 
- ๐๏ธ Interactive & Non-Interactive: Works in both modes for all users 
- ๐ง Platform-Specific Configs: Generates optimized files for each IDE/client 
- ๐ Clear Instructions: Provides exact integration steps for your setup 
- โจ Smart Defaults: Handles environment variables intelligently 
๐ณ Docker Deployment (Optional)
For containerized deployment, the project includes comprehensive Docker support:
Quick Docker Setup
Docker Features
- ๐ Security: Non-root user, minimal attack surface 
- ๐ฆ Optimized: Multi-stage builds, layer caching 
- ๐ Health Checks: Automatic container health monitoring 
- ๐ ๏ธ Development: Volume mounts for live development 
- ๐ Production: Daemon mode for production deployment 
Available Commands
For detailed Docker setup instructions, see
๐ฏ Prove-It: Generate Real Android Apps
Ready to see the system generate complete, production-ready Android apps? Follow these steps to witness the full E2E workflow:
๐ Quick Start: Generate Your First App
What you get:
- โ Complete Gradle project (Kotlin, Compose, Hilt, MVVM) 
- โ Working Android app with HomeScreen + DetailsScreen 
- โ Room database with entities and DAOs 
- โ Retrofit network layer with API service 
- โ Unit tests that pass (Robolectric + JVM tests) 
- โ APK ready to install on device/emulator 
๐ง Available Commands
๐ Generated App Features
The generated e2e/sampleapp includes:
๐๏ธ Architecture:
- MVVM pattern with ViewModels 
- Hilt dependency injection 
- Clean Architecture principles 
๐จ UI/UX:
- Jetpack Compose screens 
- Material3 design 
- Navigation between screens 
๐พ Data Layer:
- Room database with entities 
- Repository pattern 
- Migration skeletons 
๐ Network:
- Retrofit API client 
- OkHttp interceptors 
- Error handling 
๐งช Testing:
- Unit tests for ViewModels 
- DAO tests with Robolectric 
- API service tests 
๐ฑ Build:
- Debug APK generation 
- Lint/format checks 
- Gradle build optimization 
โ๏ธ Environment Variables
๐ Troubleshooting
Gradle build fails:
Sidecar connection issues:
APK not generated:
๐ Performance Benchmarks
The system is optimized for:
- Sidecar startup: < 2 seconds 
- Code generation: < 5 seconds per component 
- Build time: < 30 seconds for debug APK 
- Test execution: < 10 seconds for unit tests 
๐ Success Indicators
When everything works correctly:
- โ - kotlin-sidecar.jarbuilds successfully
- โ - e2e/sampleappdirectory created with full project
- โ - ./gradlew assembleDebugcompletes without errors
- โ APK file exists: - app/build/outputs/apk/debug/app-debug.apk
- โ - ./gradlew testDebugUnitTestpasses tests
- โ No TODO placeholders in generated code 
- โ All lint/format checks pass 
๐ฏ The generated app is production-ready and can be opened in Android Studio immediately!
๏ฟฝ Migration from V1.0 to V2.0
โก Quick Migration Steps
If you have an existing V1.0 installation:
- Backup Current Setup: # Backup your existing configuration cp mcp_config*.json ~/backup/
- Update to V2.0: # Pull latest changes git pull origin main # Run V2.0 installer python3 install.py 1
- Verify Migration: # Test the new modular architecture python3 -c "from kotlin_mcp_server import KotlinMCPServer; print('โ V2.0 Ready!')"
๐ What's Automatically Migrated
- โ All 30 original tools preserved with enhanced AI capabilities 
- โ Configuration files updated with dynamic environment variables 
- โ Project paths converted to cross-platform format 
- โ Dependencies updated to latest versions 
- โ Security settings enhanced with new compliance features 
โ ๏ธ Migration Notes
- Backward Compatibility: V2.0 maintains full compatibility with V1.0 project structures 
- Enhanced Output: Code generation now produces complete implementations instead of templates 
- New Environment Variables: Optional new configuration options (see - .env.example)
- Modular Structure: Internal architecture improved (no user action needed) 
๐๏ธ Project Root Resolution Policy
Overview
All tools in the Kotlin MCP Server have been refactored to work exclusively on the user's project workspace, never on the MCP server's current working directory. This ensures safe, predictable tool behavior and prevents accidental modifications outside your project.
Path Resolution Priority
Tools resolve the project root in this order:
- Explicit Input: - project_rootor- projectRootparameter
- Environment Variables: - PROJECT_PATHor- WORKSPACE_PATH
- IDE Metadata: Workspace root from MCP client (VS Code, Cursor, etc.) 
- Fail-Safe: Tools will error rather than use server CWD 
Input Synonyms
Tools accept both camelCase and snake_case parameter names:
IDE Integration Defaults
When using IDE extensions (VS Code, Cursor), tools automatically detect:
- Workspace Root: Active workspace directory 
- Active File: Currently open file for file-based operations 
- Selection: Text selection for refactoring operations 
Security Safeguards
- Path Traversal Protection: All file paths validated to be under project root 
- Server CWD Guard: Runtime checks prevent accidental server directory operations 
- Audit Logging: All tool operations logged with project context 
Example Tool Calls
With Explicit Project Root:
With Environment Variable:
IDE Auto-Detection:
Error Handling
Tools provide clear errors when project root cannot be resolved:
๐ Comprehensive Usage Guide
๐ Complete Tool Reference
The Kotlin MCP Server provides 31 comprehensive tools for Android development, organized by category:
Core Development Tools
1. gradle_build - Build Android Projects
Executes Gradle build tasks for your Android project.
Parameters:
- task(string): Gradle task to execute (e.g., "assembleDebug", "build", "test")
- clean_build(boolean, optional): Whether to clean before building
- parallel(boolean, optional): Enable parallel execution
Usage Examples:
2. run_tests - Execute Test Suites
Runs unit tests, integration tests, or UI tests with comprehensive reporting.
Parameters:
- test_type(string): "unit", "integration", "ui", or "all"
- test_class(string, optional): Specific test class to run
- generate_report(boolean, optional): Generate HTML test report
3. create_kotlin_file - Generate Kotlin Files
Creates structured Kotlin files with proper package declaration and imports.
Parameters:
- file_path(string): Relative path for the new file
- class_name(string): Name of the main class
- class_type(string): "class", "data_class", "sealed_class", "object", "interface"
- properties(array, optional): List of properties for data classes
- package_name(string, optional): Package declaration
4. create_layout_file - Generate XML Layouts
Creates Android XML layout files with proper structure.
5. analyze_project - Project Analysis
Provides comprehensive analysis of your Android project structure, dependencies, and architecture.
Analysis Types:
- architecture: Overall project structure and patterns
- dependencies: Gradle dependencies and versions
- security: Security vulnerabilities and best practices
- performance: Performance bottlenecks and optimizations
6. format_code - Code Formatting
Formats Kotlin code according to style guidelines.
7. run_lint - Static Code Analysis
Runs lint analysis to detect code issues.
8. generate_docs - Documentation Generation
Generates project documentation in various formats.
UI Development Tools
9. create_compose_component - Jetpack Compose Components
Generates Jetpack Compose UI components with best practices.
Component Types:
- composable: Standard composable function
- stateful: Composable with internal state
- stateless: Pure UI composable
- layout: Layout composable with children
10. create_custom_view - Custom Android Views
Creates custom View classes with proper lifecycle management.
Architecture & Pattern Tools
11. setup_mvvm_architecture - MVVM Implementation
Sets up complete MVVM architecture with ViewModel, Repository, and UI layers.
Generated Files:
- ViewModel with state management 
- Repository with data source abstraction 
- Use cases for business logic 
- UI composables or fragments 
- State classes and sealed classes for events 
12. setup_dependency_injection - DI Framework Setup
Configures dependency injection using Hilt or Dagger.
13. setup_room_database - Database Setup
Creates Room database implementation with entities, DAOs, and migrations.
14. setup_retrofit_api - Network Layer
Sets up Retrofit API interfaces with proper error handling and interceptors.
Security & Compliance Tools
15. encrypt_sensitive_data - Data Encryption
Encrypts sensitive data using industry-standard encryption.
16. implement_gdpr_compliance - GDPR Implementation
Implements complete GDPR compliance framework.
Generated Components:
- Consent management UI and logic 
- Data export functionality 
- User data deletion workflows 
- Privacy policy templates 
- Audit logging system 
17. implement_hipaa_compliance - HIPAA Implementation
Implements HIPAA-compliant security measures.
18. setup_secure_storage - Secure Data Storage
Configures encrypted storage for sensitive data.
AI/ML Integration Tools
19. query_llm - Language Model Queries
Queries local or remote language models for code assistance.
Supported Providers:
- local: Ollama, LocalAI
- openai: GPT-4, GPT-3.5
- anthropic: Claude models
- custom: Custom API endpoints
20. analyze_code_with_ai - AI Code Analysis
Uses AI to analyze code for various aspects.
Analysis Types:
- security: Security vulnerabilities and best practices
- performance: Performance optimization suggestions
- bugs: Potential bug detection
- style: Code style improvements
- complexity: Code complexity analysis
- maintainability: Maintainability assessment
21. generate_code_with_ai - AI Code Generation
Generates code using AI based on natural language descriptions.
File Management Tools
22. manage_project_files - Advanced File Operations
Performs comprehensive file management operations.
Operations:
- backup: Create encrypted backups
- restore: Restore from backup
- sync: Synchronize with cloud storage
- encrypt: Encrypt sensitive files
- decrypt: Decrypt files (with proper authorization)
- organize: Organize files by type/category
23. setup_cloud_sync - Cloud Storage Integration
Configures cloud storage synchronization with encryption.
API Integration Tools
24. setup_external_api - API Configuration
Sets up external API integrations with security and monitoring.
25. call_external_api - API Calls
Makes secured API calls with comprehensive monitoring.
Testing Tools
26. generate_unit_tests - Unit Test Generation
Generates comprehensive unit tests for Kotlin classes.
27. setup_ui_testing - UI Test Configuration
Sets up UI testing framework with Espresso or Compose testing.
Git Tools
28. gitStatus - Git Repository Status
Get comprehensive Git repository status including branch, changes, and ahead/behind counts.
Returns:
- Current branch name 
- List of changed files with status 
- Ahead/behind counts relative to remote 
- Whether repository has uncommitted changes 
29. gitSmartCommit - Intelligent Commit Messages
Create conventional commit messages based on code changes analysis.
Features:
- Analyzes changed files to determine commit type 
- Generates conventional commit message 
- Automatically stages changes 
- Supports feat, fix, docs, refactor, test types 
30. gitCreateFeatureBranch - Safe Branch Creation
Create feature branches with validation and naming conventions.
Features:
- Creates - feature/branch-nameformat
- Validates branch name format 
- Checks for existing branches 
- Switches to new branch automatically 
31. gitMergeWithResolution - Intelligent Merge
Attempt merge with conflict resolution and advice.
Features:
- Attempts automatic merge 
- Provides conflict resolution suggestions 
- Returns structured conflict hunks 
- Offers merge strategy advice 
External API Tools
32. apiCallSecure - Secure API Calls
Make authenticated API calls with monitoring and compliance.
Features:
- Multiple authentication types (Bearer, API Key, OAuth, Basic) 
- Automatic retries with backoff 
- Request/response monitoring 
- Compliance validation 
33. apiMonitorMetrics - API Metrics Monitoring
Get real-time API usage metrics and performance data.
Returns:
- Request count and success rate 
- Average latency 
- Error counts 
- Windowed metrics (1m to 7d) 
34. apiValidateCompliance - API Compliance Validation
Validate API usage against GDPR/HIPAA compliance rules.
Validates:
- Data handling practices 
- Privacy policy compliance 
- Audit logging requirements 
- Provides actionable remediation steps 
Quality of Life Development Tools
35. projectSearch - Fast Project Search
Perform fast grep searches across project files with context.
Features:
- Uses ripgrep for speed 
- Context lines around matches 
- Regex pattern support 
- File type filtering 
36. todoListFromCode - TODO/FIXME Extraction
Parse and organize TODO/FIXME comments from codebase.
Returns:
- Organized by priority (FIXME > TODO > XXX > HACK) 
- File location and line numbers 
- Full comment context 
- Summary statistics 
37. readmeGenerateOrUpdate - README Management
Generate or update README with badges, setup instructions, and tool catalog.
Generates:
- Build status badges 
- Setup and usage instructions 
- Complete tool catalog 
- Environment variable documentation 
38. changelogSummarize - Changelog Processing
Summarize conventional commits into grouped release notes.
Groups commits by type:
- Features 
- Bug fixes 
- Documentation 
- Breaking changes 
39. buildAndTest - Build and Test Pipeline
Run Gradle/Maven builds and return detailed test results.
Returns:
- Build success/failure 
- Failing test details 
- Build artifacts 
- Performance metrics 
40. dependencyAudit - Dependency Security Audit
Audit Gradle dependencies for vulnerabilities and license compliance.
Checks:
- OSV vulnerability database 
- License compatibility 
- Outdated dependencies 
- Security advisories 
41. securityHardening - Security Hardening Management
Manage security hardening features including RBAC, rate limiting, caching, and monitoring.
Operations:
- get_metrics- Get security metrics and monitoring data
- assign_role- Assign user roles (admin, developer, readonly, guest)
- check_permission- Check user permissions for operations
- clear_cache- Clear the security cache
- export_telemetry- Export telemetry data
Features:
- Role-Based Access Control (RBAC) 
- Sliding window rate limiting 
- Circuit breaker pattern 
- TTL-based caching 
- Comprehensive metrics collection 
- Telemetry export capabilities 
๐ Quick Start Tool Examples
Complete Project Setup Workflow
Here's a step-by-step workflow to set up a new Android project with enterprise features:
AI-Powered Development Examples
๐ ๏ธ Tool Usage Best Practices
File Path Conventions
Always use relative paths from your project root:
Package Naming
Follow Android package naming conventions:
Security Best Practices
- Always use encryption for sensitive data 
- Implement proper compliance features from the start 
- Use secure storage for API keys and secrets 
- Enable audit logging for compliance requirements 
Performance Optimization
- Use - parallel: truefor Gradle builds when possible
- Generate tests incrementally rather than all at once 
- Use local LLM providers for privacy-sensitive code analysis 
- Enable caching for API setups 
Error Handling
All tools provide comprehensive error information:
๐ Tool Response Formats
Success Response
Error Response
๏ฟฝ๐ Security & Privacy Features
GDPR Compliance Implementation
Generated Features:
- Consent management UI components 
- Data export functionality 
- User data deletion workflows 
- Privacy policy templates 
- Legal basis tracking 
HIPAA Compliance Implementation
Generated Features:
- Comprehensive audit logging system 
- Role-based access control framework 
- PHI encryption utilities 
- Secure messaging infrastructure 
- Risk assessment tools 
Data Encryption
Secure Storage Setup
๐ค AI Integration Features
Local LLM Queries
AI-Powered Code Analysis
Analysis Types:
- security- Vulnerability and security best practices
- performance- Performance optimization suggestions
- bugs- Potential bug detection
- style- Code style and formatting improvements
- complexity- Code complexity analysis
AI Code Generation
Code Types:
- class- Kotlin classes with methods
- function- Standalone functions
- layout- XML layout files
- test- Unit and integration tests
- component- Jetpack Compose components
๐ File Management Operations
Advanced Backup
Real-time Synchronization
Cloud Storage Sync
Supported Operations:
- backup- Create encrypted backups with manifests
- restore- Restore from backup with integrity checking
- sync- Two-way synchronization with conflict resolution
- encrypt- Encrypt sensitive files in place
- decrypt- Decrypt files with proper authorization
- archive- Create compressed archives
- extract- Extract archives with validation
- search- Content-based file discovery
- analyze- File structure and usage analysis
๐ External API Integration
API Integration Setup
API Usage Monitoring
Authentication Types:
- none- No authentication required
- api_key- API key in header or query
- oauth- OAuth 2.0 flow
- jwt- JSON Web Token
- basic- Basic HTTP authentication
๐๏ธ Advanced Android Development
MVVM Architecture Setup
Jetpack Compose Components
Room Database Setup
Retrofit API Client
Dependency Injection (Hilt)
ML Model Integration
๐ ๏ธ Tool-Specific Troubleshooting
Gradle Build Issues
AI Integration Issues
File Creation Issues
Security Tool Issues
Database Setup Issues
Network/API Issues
๐งช Testing & Quality Assurance
Comprehensive Test Generation
Test Types:
- unit- Unit tests with mocking
- integration- Integration tests with real dependencies
- ui- UI tests with Espresso
๐ฅ Industry-Specific Examples
Healthcare Application
Financial Application
๐ง Configuration & Deployment
Docker Deployment
AI Agent Integration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
VS Code Extension
Use the configuration from mcp_config_vscode.json
โ๏ธ Configuration & Plugin Requirements
This section provides detailed instructions on configuring the MCP server for different IDEs and the required plugins.
๐ Required Plugins/Extensions
VS Code Extensions
Manual Installation via VS Code Marketplace:
- Python (ms-python.python) - Core Python support 
- Pylint (ms-python.pylint) - Code linting 
- Black Formatter (ms-python.black-formatter) - Code formatting 
- isort (ms-python.isort) - Import sorting 
- Jupyter (ms-toolsai.jupyter) - Notebook support (optional) 
- MCP for VS Code - Model Context Protocol support (if available) 
JetBrains IDEs (IntelliJ IDEA, Android Studio)
Required Plugins:
- Python Plugin - For Python script execution 
- MCP Plugin - Model Context Protocol support (check JetBrains marketplace) 
- Kotlin Plugin - Built-in for Android Studio, install for IntelliJ 
- Android Plugin - Built-in for Android Studio 
Claude Desktop Integration
No additional plugins required - uses built-in MCP support.
๐ ๏ธ IDE Configuration
Visual Studio Code
- Install Python Extension Pack: code --install-extension ms-python.python
- Configure MCP Server: The installation script generates - mcp_config_vscode.jsonwith the correct paths. Simply add to VS Code- settings.json(- Cmd/Ctrl + Shift + Pโ "Preferences: Open Settings (JSON)"):{ "mcp.server.configFiles": [ "/absolute/path/to/your/kotlin-mcp-server/mcp_config_vscode.json" ], "python.defaultInterpreterPath": "/usr/bin/python3", "python.linting.enabled": true, "python.formatting.provider": "black", "python.sortImports.path": "isort" }- ๐ก Pro Tip: The installation script provides the exact path you need to use. 
- Workspace Settings (.vscode/settings.json): { "python.pythonPath": "python3", "mcp.server.autoStart": true, "mcp.server.logLevel": "info" }
JetBrains IDEs (IntelliJ IDEA, Android Studio)
- Install Required Plugins: - Go to - File > Settings > Plugins(Windows/Linux) or- IntelliJ IDEA > Preferences > Plugins(Mac)
- Search and install "MCP" plugin from marketplace 
- Install "Python" plugin if not already available 
 
- Configure MCP Server: The installation script generates - mcp_config.jsonwith proper configuration. In your IDE:- Go to - File > Settings > Tools > MCP Server
- Click - +to add new server:- Name: Your custom server name (as configured during installation) 
- Configuration File: Select the generated - mcp_config.json
- Auto Start: Enable 
 
 
- Android Studio Specific: <!-- Add to .idea/workspace.xml --> <component name="MCPServerManager"> <option name="servers"> <server name="your-server-name" configFile="mcp_config.json" autoStart="true"/> </option> </component>- ๐ก Note: Replace - your-server-namewith the server name you chose during installation.
Claude Desktop
- Configuration File Location: - Mac: - ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: - %APPDATA%\Claude\claude_desktop_config.json
- Linux: - ~/.config/claude/claude_desktop_config.json
 
- Configuration Content: Simply copy the content from the generated - mcp_config_claude.jsonfile to your Claude Desktop configuration file. The installation script has already configured all paths and settings correctly.- Example of generated configuration: { "mcpServers": { "your-server-name": { "command": "python3", "args": ["kotlin_mcp_server.py"], "cwd": "/absolute/path/to/kotlin-mcp-server", "env": { "PROJECT_PATH": "${workspaceRoot}" } } } }- โ Ready to Use: No manual path updates needed - everything is pre-configured! 
Cursor IDE
- Install Extensions: - Same extensions as VS Code (Cursor is VS Code-based) 
- Python, Pylint, Black Formatter, isort 
 
- Configuration: Use the same - mcp_config_vscode.jsonconfiguration as VS Code. Add to Cursor's- settings.json:{ "mcp.server.configFiles": [ "/absolute/path/to/your/kotlin-mcp-server/mcp_config_vscode.json" ] }
VS Code Bridge Server (Alternative Integration)
For VS Code extensions that need HTTP API access to MCP tools, the project includes a bridge server.
1. Start the Bridge Server:
2. Health Check:
3. Using the Bridge API:
4. VS Code Extension Integration:
5. Configuration:
Other IDEs
For IDEs with MCP support:
- Vim/Neovim: Use coc-mcp or similar MCP plugins 
- Emacs: Install mcp-mode package 
- Sublime Text: Install MCP package via Package Control 
๏ฟฝ๏ธ Troubleshooting
Common Installation Issues
Python Version Compatibility
Dependency Installation Errors
Import Errors
Configuration Issues
Using the New Installer (Recommended)
Most configuration issues are now resolved automatically:
Legacy Manual Configuration Issues
If you're still using manual configuration from older versions:
๐ก Pro Tip: The new installer eliminates these manual steps entirely!
Environment Variable Issues
MCP Server Not Starting
- Check configuration file paths in your IDE settings 
- Verify Python interpreter path in IDE settings 
- Ensure environment variables are set correctly 
- Check logs for specific error messages 
IDE Plugin Issues
VS Code Bridge Server Issues
Permission Errors
Runtime Issues
AI Integration Failures
File Operation Errors
Security/Compliance Errors
Known Issues & Fixes
GitHub Actions Build Failures
If you encounter CI/CD issues:
- Configuration Files: Ensure - .flake8exists (not in- pyproject.toml)
- GitHub Actions: Update to latest versions: - actions/checkout@v4
- actions/setup-python@v4
- actions/cache@v4
 
- Code Formatting: Run - make formatto fix style issues
Deprecated Dependencies
Performance Issues
Slow Server Response
Memory Usage
Getting Help
- Check Logs: Look in - mcp_security.logfor detailed error information
- Run Diagnostics: Use - python3 comprehensive_test.py --verbose
- Validate Configuration: Run - python3 breaking_change_monitor.py
- Test Individual Components: # Test core server python3 kotlin_mcp_server.py --test # Test enhanced features python3 kotlin_mcp_server.py --test # Test AI integration python3 kotlin_mcp_server.py --test
- Contact Support: Include logs, system info, and error messages when reporting issues 
๐ VS Code Bridge Server
The VS Code Bridge Server provides HTTP API access to MCP tools for VS Code extensions and other applications that can't directly use the MCP protocol.
When to Use the Bridge Server
- VS Code Extensions: When building custom VS Code extensions that need MCP functionality 
- HTTP Clients: When integrating with tools that only support HTTP APIs 
- Remote Access: When you need to access MCP tools from another machine 
- Testing: For easy testing of MCP tools using curl or Postman 
- Web Applications: For web-based interfaces to MCP functionality 
Bridge Server Features
Workspace Detection
- Automatically detects current VS Code workspace 
- Uses - VSCODE_WORKSPACE_FOLDERenvironment variable
- Falls back to current working directory 
Available Endpoints
Health Check:
Tool Execution:
Supported Tools via Bridge
- gradle_build- Build Android project
- run_tests- Execute tests
- create_kotlin_file- Create Kotlin source files
- create_layout_file- Create Android layout files
- analyze_project- Project structure analysis
- All other MCP tools (see full list via - /health)
Configuration
Environment Variables
Security Considerations
Usage Examples
Start Bridge Server
Health Check
Create Kotlin File
Run Gradle Build
Format Kotlin Code
Run Static Analysis
Generate Documentation
VS Code Extension Integration
TypeScript/JavaScript Example
Troubleshooting Bridge Server
Common Issues
Debug Mode
Performance Notes
- Lightweight: Minimal HTTP server with low memory footprint 
- Workspace-aware: Automatically uses current VS Code workspace 
- Error handling: Graceful error responses with details 
- CORS support: Includes CORS headers for web applications 
๐งช Testing & Quality Assurance
This project includes a comprehensive testing and quality assurance system. For detailed testing information, see TESTING_GUIDE.md.
Quick Testing Commands
Quality Metrics
- Test Coverage: 80% minimum 
- Performance: < 5s tool listing, < 2s file operations 
- Security: Zero high-severity vulnerabilities 
- Code Quality: Pylint score 8.0+/10.0 
๏ฟฝ๐ Monitoring & Analytics
The server provides comprehensive monitoring:
- Security Events - Real-time security monitoring and alerts 
- API Usage - Request/response metrics, error rates, costs 
- File Operations - Backup status, sync health, storage usage 
- Compliance Status - GDPR/HIPAA compliance reporting 
- Performance Metrics - Response times, throughput, resource usage 
๐ก๏ธ Security Best Practices
- Environment Variables - Store sensitive data in - .envfiles
- Encryption Keys - Use strong, unique encryption passwords 
- API Keys - Rotate API keys regularly 
- Audit Logs - Review security logs periodically 
- Access Controls - Implement least privilege principles 
- Data Classification - Properly classify and handle sensitive data 
๐ License & Compliance
This MCP server is designed to help you build compliant applications:
- GDPR Ready - Full Article 25 "Privacy by Design" implementation 
- HIPAA Compatible - Meets Technical Safeguards requirements 
- SOC 2 Type II - Security controls framework 
- ISO 27001 - Information security management standards 
๐ค Contributing
We welcome contributions! Please see our contributing guidelines for:
- Code style and standards 
- Security review process 
- Testing requirements 
- Documentation standards 
๐ Support & Resources
- Documentation - Complete API documentation in - /docs
- Examples - Industry-specific examples in - /examples
- Issues - Report bugs and feature requests 
- Security - Report security issues privately 
๐ Getting Started Checklist
Installation & Setup
- Install Python 3.8+ and pip 
- Clone repository: - git clone <repo-url>
- Install dependencies: - pip install -r requirements.txt
- Configure environment variables in - .envfile
- Install required IDE plugins/extensions 
- Validate installation: - python3 validate_config.py
Basic Tool Testing
- Test project analysis: - {"name": "analyze_project", "arguments": {"analysis_type": "architecture"}}
- Test file creation: - {"name": "create_kotlin_file", "arguments": {"file_path": "Test.kt", "class_name": "Test"}}
- Test build: - {"name": "gradle_build", "arguments": {"task": "assembleDebug"}}
- Test AI integration: - {"name": "query_llm", "arguments": {"prompt": "Hello world", "llm_provider": "local"}}
Advanced Features
- Set up MVVM architecture: - setup_mvvm_architecture
- Configure dependency injection: - setup_dependency_injection
- Implement security features: - encrypt_sensitive_data
- Set up compliance (if needed): - implement_gdpr_complianceor- implement_hipaa_compliance
- Configure cloud sync: - setup_cloud_sync
- Set up external APIs: - setup_external_api
Testing & Quality
- Generate unit tests: - generate_unit_tests
- Run comprehensive tests: - run_tests
- Perform code analysis: - analyze_code_with_ai
- Run lint checks: - run_lint
- Generate documentation: - generate_docs
Optional Integrations
- Test VS Code bridge server: - python3 vscode_bridge.py
- Configure Claude Desktop integration 
- Set up cloud storage backup 
- Enable AI code generation features 
๐ Ready to build enterprise-grade Android applications with 31 AI-enhanced tools at your disposal!
๐ Next Steps
- Explore the Tools: Start with basic tools like - analyze_projectand- create_kotlin_file
- Set Up Architecture: Use - setup_mvvm_architecturefor clean code structure
- Add Security: Implement - encrypt_sensitive_dataand compliance features
- Generate Code: Leverage AI tools for rapid development 
- Test Everything: Use - generate_unit_testsand- run_testsfor quality assurance
๐ Getting Help
- Tool Reference: Each tool has detailed parameter documentation above 
- Examples: Industry-specific examples in the README 
- Troubleshooting: Comprehensive troubleshooting section included 
- Best Practices: Follow the tool usage guidelines for optimal results 
๐ Version Information
Current Version: V2.0 - AI-Enhanced Modular Architecture
Release Date: August 2025
Compatibility: Backward compatible with V1.0 projects
Next Release: V2.1 planned for minor enhancements and bug fixes
Release Notes:
- ๐ค AI-powered code generation with production-ready implementations 
- ๐๏ธ Modular architecture for better maintainability 
- ๐ Dynamic configuration system for cross-platform compatibility 
- โก Enhanced performance and reliability improvements 
- ๐ก๏ธ Advanced security and compliance features 
For detailed version history, see the Revision History section at the top of this document.
๐ง Kotlin Sidecar Setup
The Kotlin sidecar provides AST-aware code analysis and refactoring capabilities using the Kotlin Analysis API.
Building the Sidecar
Running the Sidecar
Sidecar Protocol
The sidecar communicates via NDJSON over stdin/stdout:
Request Format:
Response Format:
Error Format:
โ๏ธ Environment Variables Reference
| Variable | Default | Description | 
| 
 | 
 | Command to start Kotlin sidecar | 
| 
 | 
 | Maximum API retry attempts | 
| 
 | 
 | API timeout in milliseconds | 
| 
 | 
 | Rate limit queries per second | 
| 
 | 
 | Audit database path | 
| 
 | 
 | Logging level | 
| 
 | 
 | Enable telemetry collection | 
| 
 | 
 | Circuit breaker failure threshold | 
| 
 | 
 | Circuit breaker reset timeout | 
Security & Compliance
| Variable | Description | 
| 
 | AES-256 encryption key for sensitive data | 
| 
 | Days to retain audit logs | 
| 
 | Enable GDPR compliance features | 
| 
 | Enable HIPAA compliance features | 
AI/ML Configuration
| Variable | Description | 
| 
 | LLM provider (openai, anthropic, local) | 
| 
 | API key for external LLM providers | 
| 
 | Endpoint for local LLM server | 
| 
 | Specific AI model to use | 
File Management
| Variable | Description | 
| 
 | Days to retain file backups | 
| 
 | Maximum backup size in MB | 
| 
 | File sync interval | 
| 
 | File extensions to auto-encrypt | 
๐ Tool Catalog & Examples
Core Development Tools
refactorFunction
Refactor Kotlin functions with AST-aware transformations.
formatCode
Format Kotlin code using ktlint or spotless.
optimizeImports
Optimize and organize Kotlin imports.
Git Tools
gitStatus
Get Git repository status.
gitSmartCommit
Create intelligent commit message.
gitCreateFeatureBranch
Create a new feature branch.
API Tools
apiCallSecure
Make secure API calls with authentication.
apiMonitorMetrics
Get API monitoring metrics.
Quality of Life Tools
projectSearch
Fast grep search with context.
todoListFromCode
Parse TODO/FIXME comments.
readmeGenerateOrUpdate
Generate or update README.
buildAndTest
Run build and return test results.
dependencyAudit
Audit dependencies for vulnerabilities.
๐ Security & RBAC
Role-Based Access Control
The server implements comprehensive RBAC with the following roles:
- admin: Full access to all tools and configurations 
- developer: Access to development tools (refactor, format, build) 
- analyst: Read-only access to analysis and monitoring tools 
- auditor: Access to audit trails and compliance reports 
Rate Limiting
Configurable rate limiting protects against abuse:
- Global QPS Limit: - MCP_RATE_LIMIT_QPS(default: 10)
- Per-User Limits: Configurable per role 
- Burst Handling: Token bucket algorithm for smooth traffic 
Telemetry
Optional telemetry collection for usage analytics:
- Enable: Set - MCP_ENABLE_TELEMETRY=true
- Data Collected: Tool usage statistics, performance metrics 
- Privacy: No sensitive data or code content collected 
- Opt-out: Disabled by default 
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Kotlin MCP Server for Android app development using OpenAI, Gemini, or OpenRouter. Enables AI-assisted coding via Aider, Gradle build/test integration, Kotlin LSP, and Docker-based portability.
- ๐ Revision History
- ๐ Enterprise Features Overview
- ๐ Quick Start & Installation
- ๐ฏ Prove-It: Generate Real Android Apps
- ๏ฟฝ Migration from V1.0 to V2.0
- ๐๏ธ Project Root Resolution Policy
- ๐ Comprehensive Usage Guide- ๐ Complete Tool Reference
- ๐ Quick Start Tool Examples
- ๐ ๏ธ Tool Usage Best Practices
- ๐ Tool Response Formats
- ๏ฟฝ๐ Security & Privacy Features
- ๐ค AI Integration Features
- ๐ File Management Operations
- ๐ External API Integration
- ๐๏ธ Advanced Android Development
- ๐ ๏ธ Tool-Specific Troubleshooting
- ๐งช Testing & Quality Assurance
 
- ๐ฅ Industry-Specific Examples
- ๐ง Configuration & Deployment
- โ๏ธ Configuration & Plugin Requirements
- ๏ฟฝ๏ธ Troubleshooting
- ๐ VS Code Bridge Server
- ๐งช Testing & Quality Assurance
- ๏ฟฝ๐ Monitoring & Analytics
- ๐ก๏ธ Security Best Practices
- ๐ License & Compliance
- ๐ค Contributing
- ๐ Support & Resources
- ๐ Getting Started Checklist
- ๐ Version Information
- ๐ง Kotlin Sidecar Setup
- โ๏ธ Environment Variables Reference
- ๐ Tool Catalog & Examples
- ๐ Security & RBAC
Related MCP Servers
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.Last updated -8243Apache 2.0
- Asecurity-licenseAqualityAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.Last updated -223MIT License
- -security-license-qualityAn MCP server that provides deep knowledge about OpenAI APIs and SDKs, enabling users to query technical information through various MCP clients including ChatGPT Deep Research, Cursor, and OpenAI Responses API.Last updated -12MIT License
- -security-license-qualityAn MCP server for Android's Tasker automation appLast updated -22MIT License