The Anytype MCP Server provides a comprehensive and modular interface for interacting with the Anytype API, enabling full management of spaces, objects, and collections.
Core Capabilities:
Space Management: List all available spaces
Object Operations: Create, read, update, delete, and list objects with support for Markdown content, custom icons, properties, and template-based creation
Advanced Search: Search objects across all spaces or within specific spaces using filters for type, content, and query text with pagination
Collection Management: Add and remove objects from collections using official API endpoints
Type Management: List all available object types in a space
Key Features:
Addresses missing functionality from the official MCP, particularly object updating capabilities
Modular architecture separating API communication, MCP logic, and type definitions for better maintainability and testing
Enhanced search with advanced filtering and result limits
Provides comprehensive tools for managing Anytype objects including creating, updating, searching, and deleting objects across spaces, with full Markdown support and custom property handling. Features object update functionality not available in the official Anytype MCP server.
Anytype MCP Server
A comprehensive Model Context Protocol (MCP) server for seamless integration with the Anytype knowledge management platform. This server provides a complete set of tools for managing spaces, objects, properties, types, tags, and templates through the Anytype API.
π Features
Complete API Coverage: Full support for all Anytype API endpoints
Space Management: Create, update, and manage Anytype spaces
Object Operations: CRUD operations for objects with advanced search capabilities
Property Management: Dynamic property creation and management
Type System: Custom object types with full lifecycle management
Tag Management: Organize content with tags and multi-select properties
Template Support: Access and utilize Anytype templates
Collection & List Operations: Manage collections and lists with proper view handling
Modern Development: Built with Vite for fast development and optimized builds
Package Management: Uses pnpm for efficient dependency management
TypeScript Support: Fully typed for enhanced developer experience
Modular Architecture: Clean, maintainable code structure
π Prerequisites
Node.js 18.0.0 or higher
pnpm 8.0.0 or higher (recommended) or npm
Anytype application running locally
Valid Anytype API key
π οΈ Installation
Option 1: Local Installation (Recommended - pnpm)
Install pnpm globally (if not already installed)
npm install -g pnpmClone the repository
git clone <repository-url> cd my-mcp-anytypeInstall dependencies
pnpm installConfigure environment variables
# Copy the example file cp .env.example .env # Edit .env with your actual values # ANYTYPE_API_KEY=your-actual-api-key # ANYTYPE_BASE_URL=http://localhost:31009Build the project
pnpm buildStart the server
pnpm start
Option 2: Local Installation (npm)
Clone the repository
git clone <repository-url> cd my-mcp-anytypeInstall dependencies
npm installConfigure environment variables
# Copy the example file cp .env.example .env # Edit .env with your actual values # ANYTYPE_API_KEY=your-actual-api-key # ANYTYPE_BASE_URL=http://localhost:31009Build the project
npm run buildStart the server
npm start
Option 3: Docker Installation
Clone the repository
git clone <repository-url> cd my-mcp-anytypeConfigure environment variables
# Copy and edit the environment file cp .env.example .env # Edit .env with your actual Anytype API keyRun with Docker Compose
# Build and start the container docker-compose up -d # View logs docker-compose logs -f # Stop the container docker-compose downOr run with Docker directly
# Build the image docker build -t anytype-mcp . # Run the container docker run -d \ --name anytype-mcp-server \ --network host \ --env-file .env \ anytype-mcp
βοΈ Configuration
Environment Variables
Variable | Description | Default | Required |
| Your Anytype API key | - | β |
| Anytype API base URL |
| β |
| Port for MCP server |
| β |
| Logging level |
| β |
| API request timeout (ms) |
| β |
Getting Your API Key
Open Anytype application
Navigate to Settings β Developer
Generate or copy your API key
Add it to your
.env
file
π§ Vite & Modern Development Tools
This project uses modern development tools for optimal developer experience:
Vite Benefits
β‘ Lightning Fast: Instant server start and HMR
π¦ Optimized Builds: Efficient bundling with Rollup
π§ Zero Config: Works out of the box with sensible defaults
π― TypeScript Native: First-class TypeScript support
Available Scripts
pnpm Advantages
πΎ Disk Efficient: Saves up to 50% disk space
β‘ Faster Installs: Up to 2x faster than npm
π Strict: Better dependency resolution
π Monorepo Ready: Built-in workspace support
π Special Object Update Method
Important: Object Recreation Pattern
Due to Anytype API behavior, updating object content requires a special approach:
The Challenge
When updating objects in Anytype, simply patching properties may not reflect changes immediately in the UI due to caching and synchronization mechanisms.
The Solution: Recreation Pattern
Implementation Example
When to Use This Pattern
β Content Updates: When changing object text, descriptions, or main content
β Property Changes: When modifying custom properties
β Type Changes: When changing object type
β Simple Metadata: For basic metadata updates, regular PATCH may suffice
Important Considerations
ID Changes: The object will get a new ID after recreation
References: Update any references to the old object ID
Permissions: Ensure proper permissions for delete/create operations
Backup: Consider backing up important objects before updates
Space Management
Tool | Description |
| List all available spaces |
| Get specific space details |
| Create a new space |
| Update existing space |
| List space members |
| Get specific member details |
Object Operations
Tool | Description |
| Search objects with advanced filters |
| List objects in a space |
| Get specific object details |
| Create new object |
| Update existing object |
| Delete (archive) object |
Property Management
Tool | Description |
| List all properties in a space |
| Get specific property details |
| Create new property |
| Update existing property |
| Delete property |
Type Management
Tool | Description |
| List all object types |
| Get specific type details |
| Create new object type |
| Update existing type |
| Delete object type |
Tag Management
Tool | Description |
| List tags for a property |
| Get specific tag details |
| Create new tag |
| Update existing tag |
| Delete tag |
Template Operations
Tool | Description |
| List templates for a type |
| Get specific template details |
Collection & List Operations
Tool | Description |
| Add object to collection |
| Remove object from collection |
| Get available views for a list |
| Get objects from a list view |
ποΈ Project Structure
π API Endpoints
This MCP server interfaces with the following Anytype API endpoints:
Spaces
GET /v1/spaces
- List spacesGET /v1/spaces/{id}
- Get spacePOST /v1/spaces
- Create spacePATCH /v1/spaces/{id}
- Update spaceGET /v1/spaces/{id}/members
- List members
Objects
POST /v1/search
- Global searchPOST /v1/spaces/{id}/search
- Space searchGET /v1/spaces/{id}/objects
- List objectsGET /v1/spaces/{id}/objects/{objectId}
- Get objectPOST /v1/spaces/{id}/objects
- Create objectPATCH /v1/spaces/{id}/objects/{objectId}
- Update objectDELETE /v1/spaces/{id}/objects/{objectId}
- Delete object
Properties
GET /v1/spaces/{id}/properties
- List propertiesPOST /v1/spaces/{id}/properties
- Create propertyPATCH /v1/spaces/{id}/properties/{propertyId}
- Update propertyDELETE /v1/spaces/{id}/properties/{propertyId}
- Delete property
Types
GET /v1/spaces/{id}/types
- List typesPOST /v1/spaces/{id}/types
- Create typePATCH /v1/spaces/{id}/types/{typeId}
- Update typeDELETE /v1/spaces/{id}/types/{typeId}
- Delete type
Templates
GET /v1/spaces/{id}/types/{typeId}/templates
- List templatesGET /v1/spaces/{id}/types/{typeId}/templates/{templateId}
- Get template
π³ Docker Support
Why Docker?
Consistent Environment: Ensures the same runtime across different systems
Easy Deployment: Simple containerized deployment
Isolation: Runs in an isolated environment
Scalability: Easy to scale and manage
Docker Configuration
The project includes:
Dockerfile
: Multi-stage build with security best practicesdocker-compose.yml
: Complete orchestration setup.dockerignore
: Optimized build contextHealth checks and resource limits
Network Considerations
Host Network Mode (Recommended):
This allows the container to access Anytype running on the host machine.
Bridge Network Mode (Alternative): If Anytype is also containerized, use a custom network:
Environment Variables in Docker
The container uses the same environment variables as the local installation:
ANYTYPE_API_KEY
: Your API keyANYTYPE_BASE_URL
: Defaults tohttp://host.docker.internal:31009
in Docker
π Development
Available Scripts
Docker Development
Adding New Features
Define tool schema in the appropriate
tools/*.ts
fileImplement handler in the corresponding
handlers/*.ts
fileRegister tool in
src/index.ts
Update documentation as needed
Code Style
TypeScript with strict type checking
Modular architecture with separation of concerns
Consistent error handling with MCP error types
Comprehensive input validation
π€ Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature
)Commit your changes (
git commit -m 'Add amazing feature'
)Push to the branch (
git push origin feature/amazing-feature
)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
If you encounter any issues or have questions:
Check the Issues page for existing solutions
Create a new issue with detailed information
Include your environment details and error messages
π Acknowledgments
Anytype for the amazing knowledge management platform
Model Context Protocol for the integration framework
The open-source community for continuous inspiration
Made with β€οΈ for the Anytype community
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables interaction with Anytype objects through the Anytype API, including creating, reading, updating, and deleting objects with full Markdown support. Features complete object update functionality that is not available in the official Anytype MCP server.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.Last updated -8MIT License
- AsecurityAlicenseAqualityA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated -101MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with all MonkeyType API endpoints, providing access to typing test data, user profiles, leaderboards, and statistics through natural language.Last updated -2011MIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server implementation that enables AI assistants to interact with Anytype's API through natural language, allowing users to manage their knowledge base through conversation.Last updated -157175MIT License