mcp-server-appwrite 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_server_appwrite/server.py +50 -18
- {mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/METADATA +47 -41
- {mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/RECORD +6 -6
- {mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/WHEEL +0 -0
- {mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/entry_points.txt +0 -0
- {mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/licenses/LICENSE +0 -0
mcp_server_appwrite/server.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
from typing import List
|
1
3
|
import asyncio
|
2
4
|
import os
|
5
|
+
import argparse
|
3
6
|
import mcp.server.stdio
|
4
7
|
import mcp.types as types
|
5
8
|
from mcp.server import NotificationOptions, Server
|
@@ -19,6 +22,19 @@ from appwrite.exception import AppwriteException
|
|
19
22
|
from .tool_manager import ToolManager
|
20
23
|
from .service import Service
|
21
24
|
|
25
|
+
def parse_args():
|
26
|
+
parser = argparse.ArgumentParser(description='Appwrite MCP Server')
|
27
|
+
parser.add_argument('--databases', action='store_true', help='Enable Databases service')
|
28
|
+
parser.add_argument('--users', action='store_true', help='Enable Users service')
|
29
|
+
parser.add_argument('--teams', action='store_true', help='Enable Teams service')
|
30
|
+
parser.add_argument('--storage', action='store_true', help='Enable Storage service')
|
31
|
+
parser.add_argument('--functions', action='store_true', help='Enable Functions service')
|
32
|
+
parser.add_argument('--messaging', action='store_true', help='Enable Messaging service')
|
33
|
+
parser.add_argument('--locale', action='store_true', help='Enable Locale service')
|
34
|
+
parser.add_argument('--avatars', action='store_true', help='Enable Avatars service')
|
35
|
+
parser.add_argument('--all', action='store_true', help='Enable all services')
|
36
|
+
return parser.parse_args()
|
37
|
+
|
22
38
|
# Load environment variables from .env file
|
23
39
|
load_dotenv()
|
24
40
|
|
@@ -36,28 +52,41 @@ client.set_endpoint(endpoint)
|
|
36
52
|
client.set_project(project_id)
|
37
53
|
client.set_key(api_key)
|
38
54
|
|
39
|
-
# Initialize tools manager
|
55
|
+
# Initialize tools manager
|
40
56
|
tools_manager = ToolManager()
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
57
|
+
|
58
|
+
def register_services(args):
|
59
|
+
# If --all is specified, enable all services
|
60
|
+
if args.all:
|
61
|
+
args.databases = args.users = args.teams = args.storage = True
|
62
|
+
args.functions = args.messaging = args.locale = args.avatars = True
|
63
|
+
|
64
|
+
# Register services based on CLI arguments
|
65
|
+
if args.databases:
|
66
|
+
tools_manager.register_service(Service(Databases(client), "databases"))
|
67
|
+
if args.users:
|
68
|
+
tools_manager.register_service(Service(Users(client), "users"))
|
69
|
+
if args.teams:
|
70
|
+
tools_manager.register_service(Service(Teams(client), "teams"))
|
71
|
+
if args.storage:
|
72
|
+
tools_manager.register_service(Service(Storage(client), "storage"))
|
73
|
+
if args.functions:
|
74
|
+
tools_manager.register_service(Service(Functions(client), "functions"))
|
75
|
+
if args.messaging:
|
76
|
+
tools_manager.register_service(Service(Messaging(client), "messaging"))
|
77
|
+
if args.locale:
|
78
|
+
tools_manager.register_service(Service(Locale(client), "locale"))
|
79
|
+
if args.avatars:
|
80
|
+
tools_manager.register_service(Service(Avatars(client), "avatars"))
|
81
|
+
|
82
|
+
# If no services were specified, enable databases by default
|
83
|
+
if not any([args.databases, args.users, args.teams, args.storage,
|
84
|
+
args.functions, args.messaging, args.locale, args.avatars]):
|
85
|
+
tools_manager.register_service(Service(Databases(client), "databases"))
|
49
86
|
|
50
87
|
async def serve() -> Server:
|
51
88
|
server = Server("Appwrite MCP Server")
|
52
89
|
|
53
|
-
# @server.list_resources()
|
54
|
-
# async def handle_list_resources() -> list[types.Resource]:
|
55
|
-
# return tools_manager.get_all_resources()
|
56
|
-
|
57
|
-
# @server.read_resource()
|
58
|
-
# async def handle_read_resource(resource_id: str) -> str:
|
59
|
-
# return tools_manager.get_resource(resource_id)
|
60
|
-
|
61
90
|
@server.list_tools()
|
62
91
|
async def handle_list_tools() -> list[types.Tool]:
|
63
92
|
return tools_manager.get_all_tools()
|
@@ -86,6 +115,9 @@ async def serve() -> Server:
|
|
86
115
|
return server
|
87
116
|
|
88
117
|
async def _run():
|
118
|
+
args = parse_args()
|
119
|
+
register_services(args)
|
120
|
+
|
89
121
|
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
|
90
122
|
server = await serve()
|
91
123
|
await server.run(
|
@@ -93,7 +125,7 @@ async def _run():
|
|
93
125
|
write_stream,
|
94
126
|
InitializationOptions(
|
95
127
|
server_name="appwrite",
|
96
|
-
server_version="0.1.
|
128
|
+
server_version="0.1.3",
|
97
129
|
capabilities=server.get_capabilities(
|
98
130
|
notification_options=NotificationOptions(),
|
99
131
|
experimental_capabilities={},
|
@@ -1,47 +1,54 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-server-appwrite
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: MCP (Model Context Protocol) server for Appwrite
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.12
|
7
|
-
Requires-Dist: appwrite>=
|
7
|
+
Requires-Dist: appwrite>=9.0.2
|
8
8
|
Requires-Dist: mcp[cli]>=1.3.0
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
|
11
11
|
# Appwrite MCP server
|
12
12
|
|
13
|
+
<!-- Cover image will go here once available -->
|
14
|
+
|
13
15
|
## Overview
|
14
16
|
|
15
17
|
A Model Context Protocol server for interacting with Appwrite's API. This server provides tools to manage databases, users, functions, teams, and more within your Appwrite project.
|
16
18
|
|
17
|
-
|
19
|
+
## Quick Links
|
20
|
+
- [Configuration](#configuration)
|
21
|
+
- [Installation](#installation)
|
22
|
+
- IDE Integration:
|
23
|
+
- [Claude Desktop](#usage-with-claude-desktop)
|
24
|
+
- [Zed](#usage-with-zed)
|
25
|
+
- [Cursor](#usage-with-cursor)
|
26
|
+
- [Local Development](#local-development)
|
27
|
+
- [Debugging](#debugging)
|
28
|
+
|
29
|
+
Currently, the server supports the following tools:
|
18
30
|
|
19
31
|
- [x] Databases
|
20
32
|
- [x] Users
|
21
|
-
- [x] Teams
|
22
|
-
- [x] Messaging
|
23
|
-
- [x] Locale
|
24
|
-
- [x] Avatars
|
25
|
-
- [x] Storage (Beta)
|
26
|
-
- [x] Functions (Beta)
|
27
33
|
|
28
|
-
> Please note that
|
34
|
+
> Please note that adding a lot of tools exceeds the context window of the LLM. As a result, we will make available a curated list of tools that are most commonly used.
|
29
35
|
|
30
36
|
## Configuration
|
31
37
|
|
32
|
-
Create a `.env` file in the directory you're
|
38
|
+
Create a `.env` file in the directory you're running the server from:
|
33
39
|
|
34
40
|
```env
|
35
41
|
APPWRITE_API_KEY=your-api-key
|
36
42
|
APPWRITE_PROJECT_ID=your-project-id
|
37
43
|
APPWRITE_ENDPOINT=your-endpoint # Optional, defaults to https://cloud.appwrite.io/v1
|
38
44
|
```
|
45
|
+
> Note: Ensure that your API Key has the necessary scopes to access the resources you want to use.
|
39
46
|
|
40
47
|
## Installation
|
41
48
|
|
42
49
|
### Using uv (recommended)
|
43
50
|
When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
|
44
|
-
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-
|
51
|
+
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-appwrite*.
|
45
52
|
|
46
53
|
```bash
|
47
54
|
uvx run mcp-server-appwrite
|
@@ -58,33 +65,6 @@ Then run the server using
|
|
58
65
|
python -m mcp_server_appwrite
|
59
66
|
```
|
60
67
|
|
61
|
-
## Local Development
|
62
|
-
|
63
|
-
Clone the repository
|
64
|
-
|
65
|
-
```bash
|
66
|
-
git clone https://github.com/appwrite/mcp.git
|
67
|
-
```
|
68
|
-
|
69
|
-
Install `uv`
|
70
|
-
|
71
|
-
```bash
|
72
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
73
|
-
```
|
74
|
-
|
75
|
-
Create virtual environment
|
76
|
-
|
77
|
-
```bash
|
78
|
-
uv venv
|
79
|
-
source .venv/bin/activate
|
80
|
-
```
|
81
|
-
|
82
|
-
Run the server
|
83
|
-
|
84
|
-
```bash
|
85
|
-
uv run -v --directory ./ mcp-server-appwrite
|
86
|
-
```
|
87
|
-
|
88
68
|
## Usage with Claude Desktop
|
89
69
|
|
90
70
|
Add this to your `claude_desktop_config.json`:
|
@@ -128,7 +108,7 @@ Add to your Zed settings.json:
|
|
128
108
|
}
|
129
109
|
```
|
130
110
|
|
131
|
-
|
111
|
+
## Usage with [Cursor](https://www.cursor.com/)
|
132
112
|
|
133
113
|
Head to Cursor `Settings > Features > MCP Servers` and click on **Add New MCP Server**. Choose the type as `Command` and add the command below to the **Command** field.
|
134
114
|
|
@@ -138,6 +118,33 @@ APPWRITE_PROJECT_ID=your-project-id APPWRITE_API_KEY=your-api-key uvx mcp-server
|
|
138
118
|
|
139
119
|

|
140
120
|
|
121
|
+
## Local Development
|
122
|
+
|
123
|
+
Clone the repository
|
124
|
+
|
125
|
+
```bash
|
126
|
+
git clone https://github.com/appwrite/mcp.git
|
127
|
+
```
|
128
|
+
|
129
|
+
Install `uv`
|
130
|
+
|
131
|
+
```bash
|
132
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
133
|
+
```
|
134
|
+
|
135
|
+
Create virtual environment
|
136
|
+
|
137
|
+
```bash
|
138
|
+
uv venv
|
139
|
+
source .venv/bin/activate
|
140
|
+
```
|
141
|
+
|
142
|
+
Run the server
|
143
|
+
|
144
|
+
```bash
|
145
|
+
uv run -v --directory ./ mcp-server-appwrite
|
146
|
+
```
|
147
|
+
|
141
148
|
## Debugging
|
142
149
|
|
143
150
|
You can use the MCP inspector to debug the server.
|
@@ -164,4 +171,3 @@ This MCP server is licensed under the MIT License. This means you are free to us
|
|
164
171
|
- https://portkey.ai/mcp-servers
|
165
172
|
- https://www.claudemcp.com/servers
|
166
173
|
- Add support for SSE server
|
167
|
-
- Add suppport for resources
|
@@ -1,10 +1,10 @@
|
|
1
1
|
mcp_server_appwrite/__init__.py,sha256=Od9oaUg_ckgJ4jIGa2HijocyauWDPjIC7cBRiV0P4s8,214
|
2
2
|
mcp_server_appwrite/__main__.py,sha256=bdaX6xMmFugzSR2QMdXJqanRx_Jh25jACJDqjE9cKEc,75
|
3
|
-
mcp_server_appwrite/server.py,sha256=
|
3
|
+
mcp_server_appwrite/server.py,sha256=J_Ze0DiYYmL1wbHi4Z4LK7UTYhVemBij6O_j6zPvMCg,5498
|
4
4
|
mcp_server_appwrite/service.py,sha256=WwKoh9o7W7ZOmhY0yg6k4R2cghQRe-yMTNbFtB6TFT8,2895
|
5
5
|
mcp_server_appwrite/tool_manager.py,sha256=AfRjLyMpplYjF2VJna7frXDiDUZKRN8WQu9R8j3dxPc,718
|
6
|
-
mcp_server_appwrite-0.1.
|
7
|
-
mcp_server_appwrite-0.1.
|
8
|
-
mcp_server_appwrite-0.1.
|
9
|
-
mcp_server_appwrite-0.1.
|
10
|
-
mcp_server_appwrite-0.1.
|
6
|
+
mcp_server_appwrite-0.1.3.dist-info/METADATA,sha256=CPQt1rKcgsA_0h-l-rUl6O34HvkU1HZuKqYGVPJfCzc,4297
|
7
|
+
mcp_server_appwrite-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
mcp_server_appwrite-0.1.3.dist-info/entry_points.txt,sha256=-FBKUOp-Qmo9FldmiT3JUyF7djSeo8lLhxljOosuHkQ,74
|
9
|
+
mcp_server_appwrite-0.1.3.dist-info/licenses/LICENSE,sha256=PXzk1HbuQMAkLdHzwnBLTBIHFmgDZM0Ez2lw2gX2UQs,1096
|
10
|
+
mcp_server_appwrite-0.1.3.dist-info/RECORD,,
|
File without changes
|
{mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/entry_points.txt
RENAMED
File without changes
|
{mcp_server_appwrite-0.1.1.dist-info → mcp_server_appwrite-0.1.3.dist-info}/licenses/LICENSE
RENAMED
File without changes
|