Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ needs no credentials. The MCP dashboard lives in `appwrite-labs/monitoring` at
The server boots in a compact workflow: the client sees up to 5 tools
(`appwrite_get_context`, `appwrite_search_tools`, `appwrite_call_tool` for
reads, `appwrite_call_write_tool` for everything else, and optionally
`appwrite_search_docs`), while the full OAuth Appwrite catalog (43
`appwrite_search_docs`), while the full OAuth Appwrite catalog (44
services) stays internal and is searched at runtime. API-key stdio uses a filtered
29-service catalog. Mutating hidden tools run only through
`appwrite_call_write_tool` and require `confirm_write=true` and a one-line
Expand Down
2 changes: 1 addition & 1 deletion docs/appwrite-mcp-flow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/tool-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ flowchart LR

subgraph CAT[Internal catalog — authentication-aware]
direction LR
K[OAuth: 43 services / 1094 tools<br/>API key: 29 services / 740 tools]
K[OAuth: 44 services / 1120 tools<br/>API key: 29 services / 740 tools]
end

CT -->|large output| R[(MCP resource<br/>preview + URI)]
Expand Down Expand Up @@ -88,8 +88,8 @@ operate on it for the rest of the session.
`context=organization`, or `context=project`. Hosted calls enforce the required
top-level `organization_id` or `project_id` before making a request.
- **Access** is still gated per-route by the scopes granted to the OAuth token.
- **Hosted OAuth** registers all 43 services and 1094 methods shipped by
`appwrite-console` 0.18.0. This adds console control-plane services including
- **Hosted OAuth** registers all 44 services and 1120 methods shipped by
`appwrite-console` 0.19.0. This adds console control-plane services including
projects, organizations, domains, migrations, dedicated databases, usage, VCS,
vectors, WAF, notifications, and regions.
- **API-key stdio** deliberately registers only the 740 project-key-compatible
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"anyio>=4.0.0",
"appwrite-console>=0.18.0,<0.19",
"appwrite-console>=0.19.0,<0.20",
"docstring-parser>=0.16",
"mcp[cli]>=2.3,<3",
"python-dotenv>=1.0.1",
Expand Down
11 changes: 11 additions & 0 deletions src/mcp_server_appwrite/catalog_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@
}
),
"presences": frozenset({"get_usage"}),
"project": frozenset(
{
"create_video_profile",
"delete_video_profile",
"get_video_profile",
"list_video_profiles",
"update_video_profile",
Comment thread
appwrite[bot] marked this conversation as resolved.
Resolved
}
),
"sites": frozenset({"get_template", "list_templates"}),
"tables_db": frozenset(
{
Expand Down Expand Up @@ -156,6 +165,7 @@
"monitors",
"mysql",
"postgresql",
"project",
"sites",
"storage",
"tables_db",
Expand All @@ -164,6 +174,7 @@
"users",
"vcs",
"vectors_db",
"videos",
"waf",
}
)
Expand Down
1 change: 1 addition & 0 deletions src/mcp_server_appwrite/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def _resolve_server_version() -> str:
"organizations_update_plan",
"postgresql_create_upgrade",
"projects_create_premium_geo_db_addon",
"videos_create_rendition",
Comment thread
appwrite[bot] marked this conversation as resolved.
Resolved
}
)

Expand Down
28 changes: 28 additions & 0 deletions tests/e2e/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,34 @@ def test_deletes_wait_for_the_user_when_the_client_can_ask(self):
)
self.assertEqual(cloud.calls("POST", "/v1/monitors/http"), monitored)

# Each rendition is an encode the project pays compute for.
path = "/v1/videos/e2e-video/renditions"
rendered = cloud.calls("POST", path)
status, response = client.call(
"tools/call",
{
"name": "appwrite_call_write_tool",
"arguments": {
"tool_name": "videos_create_rendition",
"project_id": PROJECT,
"confirm_write": True,
"reason": "Encode the launch video for HLS",
"arguments": {
"video_id": "e2e-video",
"profile_id": "e2e-720p",
"output": "hls",
},
},
},
)
self.assertEqual(response["result"]["resultType"], "input_required")
self.assertTrue(
response["result"]["inputRequests"]["confirm"]["params"][
"message"
].startswith("Allow videos_create_rendition?")
)
self.assertEqual(cloud.calls("POST", path), rendered)

# A client that cannot show a form keeps the confirm_write flow alone.
result = self.call("appwrite_call_write_tool", delete["arguments"])
self.assertFalse(result.get("isError"), result)
Expand Down
42 changes: 39 additions & 3 deletions tests/unit/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,37 @@ def wrapped(address, *args, **kwargs):
"organizations_list_monitors",
)

# Videos is a new service and video profiles are new project methods. Neither has
# been reviewed for project API keys yet, so both stay out of the API-key catalog.
CONSOLE_SDK_0_19_TOOLS = (
"project_create_video_profile",
"project_delete_video_profile",
"project_get_video_profile",
"project_list_video_profiles",
"project_update_video_profile",
"videos_create",
"videos_create_caption",
"videos_create_rendition",
"videos_delete",
"videos_delete_caption",
"videos_delete_rendition",
"videos_get",
"videos_get_caption_manifest",
"videos_get_cmaf_dash_manifest",
"videos_get_cmaf_hls_manifest",
"videos_get_dash_manifest",
"videos_get_hls_manifest",
"videos_get_rendition",
"videos_get_thumbnail",
"videos_get_timeline",
"videos_list",
"videos_list_captions",
"videos_list_codecs",
"videos_list_renditions",
"videos_update",
"videos_update_caption",
)


class ServerHelperTests(unittest.TestCase):
def test_parse_args_defaults_to_stdio(self):
Expand Down Expand Up @@ -1131,8 +1162,8 @@ def test_register_services_returns_fresh_manager(self):
{service.service_name for service in manager_a.services},
set(SERVICE_CLASSES),
)
self.assertEqual(len(manager_a.services), 43)
self.assertEqual(len(manager_a.get_all_tools()), 1094)
self.assertEqual(len(manager_a.services), 44)
self.assertEqual(len(manager_a.get_all_tools()), 1120)

def test_console_sdk_0_7_surface(self):
manager = register_services(object(), profile=OAUTH_PROFILE)
Expand All @@ -1149,8 +1180,13 @@ def test_console_sdk_0_7_surface(self):
*CONSOLE_SDK_0_17_TOOLS,
*CONSOLE_SDK_0_18_PROJECT_TOOLS,
*CONSOLE_SDK_0_18_CONSOLE_TOOLS,
*CONSOLE_SDK_0_19_TOOLS,
):
self.assertIn(tool_name, tools)
# Every project_* method calls /project/*, which acts on the client's
# project, so hosted calls must name the target project.
for tool_name in CONSOLE_SDK_0_19_TOOLS:
self.assertEqual(tools[tool_name]["context_scope"], "project")
for removed_tool in (
"project_get_usage",
"projects_list_dev_keys",
Expand Down Expand Up @@ -1263,7 +1299,7 @@ def test_api_key_profile_only_advertises_server_capabilities(self):
self.assertEqual(len(tool_names), 740)
for tool_name in (*CONSOLE_SDK_0_17_TOOLS, *CONSOLE_SDK_0_18_PROJECT_TOOLS):
self.assertIn(tool_name, tool_names)
for tool_name in CONSOLE_SDK_0_18_CONSOLE_TOOLS:
for tool_name in (*CONSOLE_SDK_0_18_CONSOLE_TOOLS, *CONSOLE_SDK_0_19_TOOLS):
self.assertNotIn(tool_name, tool_names)
self.assertIn("waf_list_rules", tool_names)
self.assertIn("waf_create_deny_rule", tool_names)
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading