A FastAPI-based backend service for interacting with Anytype. This is a Python port of the Raycast Anytype Extension, providing RESTful API access to Anytype functionality.
- Python 3.8+
- Anytype installed and running locally
- Clone the repository:
git clone <repository-url>
cd anytype-api
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
uv pip install -e .[dev]
Development mode:
uvicorn app.main:app --reload
Production mode:
uvicorn app.main:app --host 0.0.0.0 --port 8000
Once the application is running, you can access the interactive API documentation at:
# Run all tests
pytest
# Run tests with coverage report
pytest --cov=app
This project includes an MCP (Model Context Protocol) server implementation that exposes Anytype API operations as MCP tools, enabling integration with MCP-compatible clients.
The MCP server uses the following environment variables (can be set in .env
file):
ANYTYPE_API_URL
— Base URL of the Anytype API (e.g.,http://localhost:31009
)ANYTYPE_SESSION_TOKEN
— Session token for API accessANYTYPE_APP_KEY
— Application key for authentication
Choose SSE type and http://localhost:8000/sse for endpoint
You can run the MCP server directly:
python app/anytype_mcp_server.py
or inside Docker (see below).
You can build and run the application using Docker:
docker build -t anytype-api .
docker run --rm --env-file .env --network host anytype-api
This will start the API server with environment variables loaded from .env
and network mode set to host.
MIT License
Based on the Raycast Anytype Extension.