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)
- Clone the repository
- Install dependencies
- Configure environment variables
- Build the project
- Start the server
Option 2: Local Installation (npm)
- Clone the repository
- Install dependencies
- Configure environment variables
- Build the project
- Start the server
Option 3: Docker Installation
- Clone the repository
- Configure environment variables
- Run with Docker Compose
- Or run with Docker directly
⚙️ Configuration
Environment Variables
Variable | Description | Default | Required |
---|---|---|---|
ANYTYPE_API_KEY | Your Anytype API key | - | ✅ |
ANYTYPE_BASE_URL | Anytype API base URL | http://localhost:31009 | ❌ |
MCP_PORT | Port for MCP server | 3000 | ❌ |
LOG_LEVEL | Logging level | info | ❌ |
REQUEST_TIMEOUT | API request timeout (ms) | 30000 | ❌ |
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 |
---|---|
anytype_list_spaces | List all available spaces |
anytype_get_space | Get specific space details |
anytype_create_space | Create a new space |
anytype_update_space | Update existing space |
anytype_list_members | List space members |
anytype_get_member | Get specific member details |
Object Operations
Tool | Description |
---|---|
anytype_search_objects | Search objects with advanced filters |
anytype_list_objects | List objects in a space |
anytype_get_object | Get specific object details |
anytype_create_object | Create new object |
anytype_update_object | Update existing object |
anytype_delete_object | Delete (archive) object |
Property Management
Tool | Description |
---|---|
anytype_list_properties | List all properties in a space |
anytype_get_property | Get specific property details |
anytype_create_property | Create new property |
anytype_update_property | Update existing property |
anytype_delete_property | Delete property |
Type Management
Tool | Description |
---|---|
anytype_list_types | List all object types |
anytype_get_type | Get specific type details |
anytype_create_type | Create new object type |
anytype_update_type | Update existing type |
anytype_delete_type | Delete object type |
Tag Management
Tool | Description |
---|---|
anytype_list_tags | List tags for a property |
anytype_get_tag | Get specific tag details |
anytype_create_tag | Create new tag |
anytype_update_tag | Update existing tag |
anytype_delete_tag | Delete tag |
Template Operations
Tool | Description |
---|---|
anytype_list_templates | List templates for a type |
anytype_get_template | Get specific template details |
Collection & List Operations
Tool | Description |
---|---|
anytype_add_to_collection | Add object to collection |
anytype_remove_from_collection | Remove object from collection |
anytype_get_list_views | Get available views for a list |
anytype_get_list_objects | 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 context- Health 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
file - Implement handler in the corresponding
handlers/*.ts
file - Register 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 -111MIT 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 -203MIT 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 -97150MIT License