Content
# AppFlowy MCP Server
This is an MCP server implementation for AppFlowy API integration. It provides tools to interact with AppFlowy's REST API through MCP.
## Setup
1. Install dependencies:
```bash
pip install -r requirements.txt
```
2. Configure environment variables (optional):
```bash
# 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"
```
3. Run the server:
```bash
python appflowy_mcp.py
```
## Authentication
There are two ways to provide authentication credentials:
1. **Environment Variables** (recommended):
- Set `APPFLOWY_BASE_URL` for the API base URL
- Set `APPFLOWY_ACCESS_TOKEN` for authentication
2. **Direct Parameter Passing**:
```python
await client.invoke(
"Get workspace list",
base_url="https://your-appflowy-instance.com",
access_token="your-token-here"
)
```
## Available Tools
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
## Required Parameters
Most tools require the following base parameters:
- `base_url`: The base URL of your AppFlowy instance
- `access_token`: Your authentication token
- `workspace_id`: The ID of the workspace you're operating in
## Example Usage
Here's an example of how to use the tools in Python:
```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())
```
## Error Handling
All API calls include proper error handling and will return an error object if something goes wrong:
```json
{
"error": "Error message details"
}
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.