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.py
with 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.py
replaces multiple server versionsIntelligent 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
IntelligentMCPToolManager
for advanced capabilitiesComplete 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/
modulesAI-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 pathsEnhanced 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.py
handles 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 directory2
- System: Install command to PATH (kotlin-android-mcp
)3
- Module: Enablepython -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 Desktopmcp_config_vscode.json
- For VS Code and Cursormcp_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.jar
builds successfully✅
e2e/sampleapp
directory created with full project✅
./gradlew assembleDebug
completes without errors✅ APK file exists:
app/build/outputs/apk/debug/app-debug.apk
✅
./gradlew testDebugUnitTest
passes 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:
Update to V2.0:
Verify Migration:
🔍 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_root
orprojectRoot
parameterEnvironment Variables:
PROJECT_PATH
orWORKSPACE_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 buildingparallel
(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 rungenerate_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 fileclass_name
(string): Name of the main classclass_type
(string): "class", "data_class", "sealed_class", "object", "interface"properties
(array, optional): List of properties for data classespackage_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 patternsdependencies
: Gradle dependencies and versionssecurity
: Security vulnerabilities and best practicesperformance
: 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 functionstateful
: Composable with internal statestateless
: Pure UI composablelayout
: 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, LocalAIopenai
: GPT-4, GPT-3.5anthropic
: Claude modelscustom
: 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 practicesperformance
: Performance optimization suggestionsbugs
: Potential bug detectionstyle
: Code style improvementscomplexity
: Code complexity analysismaintainability
: 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 backupsrestore
: Restore from backupsync
: Synchronize with cloud storageencrypt
: Encrypt sensitive filesdecrypt
: 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-name
formatValidates 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 dataassign_role
- Assign user roles (admin, developer, readonly, guest)check_permission
- Check user permissions for operationsclear_cache
- Clear the security cacheexport_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: true
for Gradle builds when possibleGenerate 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 practicesperformance
- Performance optimization suggestionsbugs
- Potential bug detectionstyle
- Code style and formatting improvementscomplexity
- Code complexity analysis
AI Code Generation
Code Types:
class
- Kotlin classes with methodsfunction
- Standalone functionslayout
- XML layout filestest
- Unit and integration testscomponent
- Jetpack Compose components
📁 File Management Operations
Advanced Backup
Real-time Synchronization
Cloud Storage Sync
Supported Operations:
backup
- Create encrypted backups with manifestsrestore
- Restore from backup with integrity checkingsync
- Two-way synchronization with conflict resolutionencrypt
- Encrypt sensitive files in placedecrypt
- Decrypt files with proper authorizationarchive
- Create compressed archivesextract
- Extract archives with validationsearch
- Content-based file discoveryanalyze
- File structure and usage analysis
🌐 External API Integration
API Integration Setup
API Usage Monitoring
Authentication Types:
none
- No authentication requiredapi_key
- API key in header or queryoauth
- OAuth 2.0 flowjwt
- JSON Web Tokenbasic
- 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 mockingintegration
- Integration tests with real dependenciesui
- 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:
Configure MCP Server: The installation script generates
mcp_config_vscode.json
with the correct paths. Simply add to VS Codesettings.json
(Cmd/Ctrl + Shift + P
→ "Preferences: Open Settings (JSON)"):💡 Pro Tip: The installation script provides the exact path you need to use.
Workspace Settings (.vscode/settings.json):
JetBrains IDEs (IntelliJ IDEA, Android Studio)
Install Required Plugins:
Go to
File > Settings > Plugins
(Windows/Linux) orIntelliJ 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.json
with 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:
💡 Note: Replace
your-server-name
with 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.json
file to your Claude Desktop configuration file. The installation script has already configured all paths and settings correctly.Example of generated configuration:
✅ 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.json
configuration as VS Code. Add to Cursor'ssettings.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
.flake8
exists (not inpyproject.toml
)GitHub Actions: Update to latest versions:
actions/checkout@v4
actions/setup-python@v4
actions/cache@v4
Code Formatting: Run
make format
to fix style issues
Deprecated Dependencies
Performance Issues
Slow Server Response
Memory Usage
Getting Help
Check Logs: Look in
mcp_security.log
for detailed error informationRun Diagnostics: Use
python3 comprehensive_test.py --verbose
Validate Configuration: Run
python3 breaking_change_monitor.py
Test Individual Components:
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_FOLDER
environment variableFalls back to current working directory
Available Endpoints
Health Check:
Tool Execution:
Supported Tools via Bridge
gradle_build
- Build Android projectrun_tests
- Execute testscreate_kotlin_file
- Create Kotlin source filescreate_layout_file
- Create Android layout filesanalyze_project
- Project structure analysisAll 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
.env
filesEncryption 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
.env
fileInstall 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_compliance
orimplement_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_project
andcreate_kotlin_file
Set Up Architecture: Use
setup_mvvm_architecture
for clean code structureAdd Security: Implement
encrypt_sensitive_data
and compliance featuresGenerate Code: Leverage AI tools for rapid development
Test Everything: Use
generate_unit_tests
andrun_tests
for 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
- AsecurityAlicenseAqualityA 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 -8236Apache 2.0
- AsecurityAlicenseAqualityAn 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
- -securityAlicense-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 -10MIT License
- -securityAlicense-qualityAn MCP server for Android's Tasker automation appLast updated -20MIT License