This is an MCP server implementation for AppFlowy API integration. It provides tools to interact with AppFlowy's REST API through MCP.
- Install dependencies:
pip install -r requirements.txt- Configure environment variables (optional):
# Base URL of your AppFlowy instance
export APPFLOWY_BASE_URL="https://your-appflowy-instance.com"
# Your authentication token
export APPFLOWY_ACCESS_TOKEN="your-token-here"- Run the server:
python appflowy_mcp.pyThere are two ways to provide authentication credentials:
-
Environment Variables (recommended):
- Set
APPFLOWY_BASE_URLfor the API base URL - Set
APPFLOWY_ACCESS_TOKENfor authentication
- Set
-
Direct Parameter Passing:
await client.invoke( "Get workspace list", base_url="https://your-appflowy-instance.com", access_token="your-token-here" )
The server provides the following tools for interacting with AppFlowy:
- Get workspace list: List all workspaces for the authenticated user
- Get workspace folder: Get the folder structure of a workspace
- Create new page: Create a new page in the workspace
- Update page: Update a page's properties
- Get page details: Get details of a specific page
- Move page to trash: Move a page to trash
- Get trash: Get all items in trash
- Restore from trash: Restore a page from trash
- Delete from trash: Permanently delete a page from trash
- Get favorites: Get favorite pages
- Toggle favorite: Add or remove a page from favorites
Most tools require the following base parameters:
base_url: The base URL of your AppFlowy instanceaccess_token: Your authentication tokenworkspace_id: The ID of the workspace you're operating in
Here's an example of how to use the tools in Python:
from mcp.clients import LocalClient
async def main():
client = LocalClient()
# List workspaces
workspaces = await client.invoke(
"Get workspace list",
base_url="https://your-appflowy-instance.com",
access_token="your-token"
)
# Create a new page
new_page = await client.invoke(
"Create new page",
base_url="https://your-appflowy-instance.com",
access_token="your-token",
workspace_id="your-workspace-id",
parent_view_id="parent-view-id",
name="My New Page"
)
if __name__ == "__main__":
import asyncio
asyncio.run(main())All API calls include proper error handling and will return an error object if something goes wrong:
{
"error": "Error message details"
}