# ๐Ÿš€ Appwrite MCP Server
![Appwrite MCP](https://img.shields.io/badge/Appwrite-MCP-red?style=for-the-badge&logo=appwrite) ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white) ![Claude](https://img.shields.io/badge/Claude-AI-orange?style=for-the-badge) **Transform Claude into your intelligent Appwrite management assistant** *12 optimized tools โ€ข Core Appwrite operations โ€ข Context-efficient design โ€ข Production-ready*
--- A **context-optimized Model Context Protocol (MCP)** server that provides Claude with essential Appwrite integration. This version focuses on core functionality with action-based combined tools, offering database operations, user management, storage, and team management in an efficient package designed to stay under MCP context limits. ## ๐Ÿš€ Features **๐ŸŽฏ Core Appwrite Operations:** - **Database Management** - Create, get, list, update, and delete databases with enabled status - **Collection Operations** - Full collection lifecycle with document security and search support - **Document CRUD** - Complete document operations with bulk support and advanced queries - **User Management** - User operations including bulk processing and preferences - **Storage Management** - Complete bucket operations with advanced configuration (file size limits, allowed extensions, compression, encryption, antivirus) and file upload/download - **Team Management** - Team CRUD operations - **Attribute & Index Management** - Schema management with array support and bulk operations - **Health Monitoring** - System health checks **โšก Action-Based Design:** - **Single tools handle multiple operations** using action parameters - **Bulk operations integrated** into respective categories - **Context-optimized** - Efficient tool design for reduced token usage - **Advanced features** - Document security, file download, bucket encryption, array attributes ## ๐Ÿ“ฆ Quick Start ### 1๏ธโƒฃ Installation ```bash # Clone the repository git clone cd appwrite-mcp-server # Install dependencies npm install # Build the TypeScript code npm run build # On Linux/macOS: Make the compiled file executable chmod +x dist/index.js ``` ### 2๏ธโƒฃ Configuration Create a `.env` file in your **current working directory** (where you run Claude Code from): ```bash # Copy the example file to your current working directory cp /path/to/app-write-mcp/.env.example ./.env ``` Edit your `.env` file with your Appwrite credentials: ```env APPWRITE_PROJECT_ID=your-project-id-here APPWRITE_API_ENDPOINT=https://cloud.appwrite.io/v1 APPWRITE_API_KEY=your-api-key-here ``` > ๐Ÿ’ก **Tip:** The MCP server looks for `.env` in the directory where Claude Code is running, allowing different configurations for different projects. ### 3๏ธโƒฃ Integration Options #### Option A: Claude Code (CLI) Integration ```bash # Add the MCP server to Claude Code claude mcp add appwrite-mcp-server "C:\path\to\your\app-write-mcp\dist\index.js" # Example with actual path claude mcp add appwrite-mcp-server "C:\Users\moh12\app-write-mcp\dist\index.js" ``` #### Option B: Cursor IDE Integration > ๐Ÿ’ก **Note:** Cursor doesn't support `.env` files for MCP servers, so we pass environment variables directly in the configuration. 1. **Open Command Palette** (`Ctrl/Cmd + Shift + P`) 2. **Type "Preferences: Open Settings (JSON)"** 3. **Add MCP Server Configuration to your settings.json:** ```json { "mcp.servers": { "appwrite-mcp-server": { "command": "node", "args": ["C:\\path\\to\\your\\app-write-mcp\\dist\\index.js"], "env": { "APPWRITE_PROJECT_ID": "your-project-id-here", "APPWRITE_API_ENDPOINT": "https://cloud.appwrite.io/v1", "APPWRITE_API_KEY": "your-api-key-here" } } } } ``` 4. **Replace the configuration values:** - **Path**: Update `C:\\path\\to\\your\\app-write-mcp\\dist\\index.js` with your actual path - **Project ID**: Your Appwrite project ID - **API Endpoint**: Your Appwrite endpoint (Cloud or self-hosted) - **API Key**: Your Appwrite API key with required permissions 5. **Example configuration:** ```json { "mcp.servers": { "appwrite-mcp-server": { "command": "node", "args": ["C:\\Users\\username\\app-write-mcp\\dist\\index.js"], "env": { "APPWRITE_PROJECT_ID": "6612345a000818bb9d2e", "APPWRITE_API_ENDPOINT": "https://cloud.appwrite.io/v1", "APPWRITE_API_KEY": "standard_1234567890abcdef..." } } } } ``` 6. **Save the file and restart Cursor** to load the MCP server #### Option C: Continue.dev Integration 1. **Open your Continue configuration file** (`~/.continue/config.json`) 2. **Add the MCP server to your configuration:** ```json { "mcpServers": [ { "name": "appwrite-mcp-server", "command": "node", "args": ["C:\\path\\to\\your\\app-write-mcp\\dist\\index.js"], "env": { "APPWRITE_PROJECT_ID": "your-project-id-here", "APPWRITE_API_ENDPOINT": "https://cloud.appwrite.io/v1", "APPWRITE_API_KEY": "your-api-key-here" } } ] } ``` 3. **Replace with your actual credentials** (same as Cursor configuration above) 4. **Restart your IDE** to apply the changes ### 4๏ธโƒฃ Verification Once integrated, you should be able to use commands like: - "List my Appwrite databases" - "Create a new user with email test@example.com" - "Show me all collections in my database" ## ๐Ÿ› ๏ธ Available Tools (12 Total)
๐Ÿ—„๏ธ Database Operations (1 tool) | Tool | Actions | Description | |------|---------|-------------| | `manage_database` | create, get, list, update, delete | Comprehensive database management with enabled status |
๐Ÿ“ Collection Operations (1 tool) | Tool | Actions | Description | |------|---------|-------------| | `collection_operations` | create, get, list, update, delete | Complete collection lifecycle with document security, enabled status, and search |
๐Ÿท๏ธ Attribute Management (1 tool) | Tool | Actions | Description | |------|---------|-------------| | `attribute_operations` | create, get, list, update, delete, bulk_create, bulk_delete | Full attribute management with array support and bulk operations |
๐Ÿ“Š Index Management (1 tool) | Tool | Actions | Description | |------|---------|-------------| | `index_operations` | create, get, list, delete | Complete index management |
๐Ÿ“„ Document Operations (2 tools) | Tool | Actions/Description | |------|--------------------| | `document_operations` | create, get, update, delete, bulk_create, bulk_update, bulk_delete | | `list_documents` | List documents with advanced queries and pagination |
๐Ÿ‘ฅ User Management (2 tools) | Tool | Actions/Description | |------|--------------------| | `user_operations` | create, get, update, delete, update_preferences, update_labels, bulk_create, bulk_update, bulk_delete | | `list_users` | List users with advanced filtering and pagination |
๐Ÿ—‚๏ธ Storage Operations (3 tools) | Tool | Actions/Description | |------|--------------------| | `bucket_operations` | create, get, list, update, delete - with advanced configuration (file size limits, allowed extensions, compression, encryption, antivirus) | | `file_operations` | get, create, update, delete, list, download - with actual file download implementation | | `get_file_url` | Generate download, preview, or view URLs with transformations |
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Team Management (1 tool) | Tool | Actions | Description | |------|---------|-------------| | `team_operations` | create, get, list, update, delete | Complete team management |
๐Ÿฅ Health Monitoring (1 tool) | Tool | Description | |------|-------------| | `get_health` | Get overall health status of Appwrite services |
--- ## โš™๏ธ Configuration Guide ### ๐Ÿ”‘ Getting Appwrite Credentials 1. **๐Ÿ†” Project ID**: Found in your Appwrite console under **Settings > General** 2. **๐ŸŒ API Endpoint**: - **Appwrite Cloud**: `https://cloud.appwrite.io/v1` - **Self-hosted**: `https://your-domain.com/v1` 3. **๐Ÿ” API Key**: Create a new API key in your Appwrite console under **Settings > API Keys** - โœ… Required scopes: `databases.read`, `databases.write`, `users.read`, `users.write`, `storage.read`, `storage.write`, `teams.read`, `teams.write`, `health.read` ### ๐ŸŽฏ VS Official Implementation | Feature | Our Implementation | Official Appwrite MCP | |---------|-------------------|----------------------| | **Tools Available** | ๐ŸŸข 12 optimized tools (context-efficient) | ๐ŸŸก 195 tools (selective enabling) | | **Context Usage** | ๐ŸŸข Optimized token usage | ๐Ÿ”ด Over 60,000 tokens | | **Tool Design** | ๐ŸŸข Action-based combined tools | ๐ŸŸก Individual tools for each operation | | **Core Operations** | ๐ŸŸข All essential database, user, storage, and team features | ๐ŸŸก Database tools only (context limits) | | **Storage Operations** | ๐ŸŸข Complete file operations with download & advanced bucket config | ๐ŸŸก Basic bucket operations | | **User Management** | ๐ŸŸข CRUD + preferences + bulk operations | ๐ŸŸก Basic CRUD only | | **Advanced Features** | ๐ŸŸข Document security, file encryption, array attributes, compression | ๐Ÿ”ด Limited | | **Bulk Operations** | ๐ŸŸข Integrated into respective categories | ๐Ÿ”ด Not available | | **Error Handling** | ๐ŸŸข Comprehensive with validation | ๐ŸŸก Basic | | **Language** | ๐ŸŸก TypeScript/Node.js | ๐ŸŸข Python | | **Maintenance** | ๐ŸŸข Easier with fewer tools | ๐ŸŸก Complex with many tools | ## ๐ŸŽฏ Usage Examples Once integrated, you can use natural language commands with Claude to interact with Appwrite:
๐Ÿ—„๏ธ Database & Collection Management ``` โœจ "Create a new database called 'ecommerce'" โœจ "List all my databases" โœจ "Create a collection called 'products' in the ecommerce database" โœจ "Show me all collections in the ecommerce database" โœจ "Delete the old 'test' database" ```
๐Ÿท๏ธ Schema & Attributes ``` โœจ "Create a string attribute called 'name' in the products collection" โœจ "Add multiple attributes with bulk create operation" โœจ "List all attributes in the products collection" โœจ "Update attribute settings for existing fields" โœจ "Create a unique index on the 'sku' attribute" โœจ "Remove old attributes with bulk delete" ```
๐Ÿ“„ Document Operations ``` โœจ "Create a new product document with name 'iPhone 15' and price 999" โœจ "List all documents in the products collection" โœจ "Update document xyz123's price to 899" โœจ "Get document abc456 from the products collection" โœจ "Delete all out-of-stock products" ```
๐Ÿ‘ฅ User Management ``` โœจ "Create a new user with email john@example.com" โœจ "List all users in the project with filtering" โœจ "Update user xyz123's name and email" โœจ "Update user labels for admin permissions" โœจ "Delete inactive user accounts" โœจ "Update user preferences for notifications" โœจ "Bulk create 10 test users for demo" โœจ "Bulk update user information from CSV" ```
๐Ÿ—‚๏ธ Storage & File Management ``` โœจ "Create a new storage bucket for user uploads" โœจ "List all files in the images bucket" โœจ "Get download URL for file abc123" โœจ "Generate preview URL for image with 300x200 dimensions" โœจ "Get file view URL for document xyz456" โœจ "Delete old file from storage bucket" ```
### ๐ŸŽฌ **Real-World Scenarios** **E-commerce Setup:** ``` 1. "Create an ecommerce database" 2. "Create a products collection with attributes" 3. "Bulk create product documents from inventory" 4. "Set up user authentication for customers" 5. "Create indexes for search optimization" ``` **Content Management:** ``` 1. "Create a blog database with posts and comments collections" 2. "Create string and datetime attributes for blog posts" 3. "List all blog posts with pagination" 4. "Update blog post content and metadata" ``` --- ## ๐Ÿ”ง Development ```bash # Build TypeScript to JavaScript npm run build # Watch mode for development npm run dev # Run the built server npm start ``` ## ๐Ÿ› Troubleshooting
Common Issues & Solutions | Issue | Solution | |-------|----------| | **โŒ Configuration not found** | Make sure `.env` file exists in your working directory | | **โŒ API Key issues** | Ensure your API key has all required scopes enabled | | **โŒ Connection failed** | Verify your API endpoint is correct (check for typos) | | **โŒ Tools not loading** | Restart your IDE after adding the MCP server | | **โŒ Permission denied** | Check that your API key has `databases.write`, `users.write` permissions | | **โŒ Schema validation errors** | Use `attribute_operations` with list action to check collection schema |
## ๐Ÿค Contributing 1. Fork the repository 2. Create a feature branch: `git checkout -b feature/amazing-feature` 3. Commit your changes: `git commit -m 'Add amazing feature'` 4. Push to the branch: `git push origin feature/amazing-feature` 5. Open a Pull Request ## ๐Ÿ“„ License MIT License - see [LICENSE](LICENSE) file for details ---
**โญ Star this repo if it helped you!** Built with โค๏ธ for the Appwrite and Claude communities [Report Bug](https://git.nebulm.com/smoido/app-write-mcp/issues) โ€ข [Request Feature](https://git.nebulm.com/smoido/app-write-mcp/issues) โ€ข [Documentation](https://git.nebulm.com/smoido/app-write-mcp/wiki)