Anytype MCP Server
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Anytype MCP Server create a new note about meeting notes with markdown formatting"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Anytype MCP Server
š 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
.envfile
š§ 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
# Development
pnpm dev # Start development server with hot reload
pnpm build # Build for production using Vite
pnpm preview # Preview production build locally
pnpm start # Start the built MCP server
# Utilities
pnpm clean # Clean build artifacts
pnpm type-check # Run TypeScript type checking
pnpm prepare # Pre-publish preparation
# Docker
docker-compose up --build # Build and run with Dockerpnpm 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
š·ļø Tags Management
Enhanced Tag Support
The MCP now includes enhanced tag management with automatic validation and processing:
ā Automatic Tag Validation: Tags are validated when creating/updating objects
ā Improved Error Handling: Clear error messages for invalid tag assignments
ā Better Documentation: Comprehensive examples and usage patterns
ā Consistent API: Standardized property_id usage across all tag operations
Quick Tag Workflow
Create tags for a multi_select property:
anytype_create_tag --space_id="space123" --name="Urgent" --color="red" --property_id="prop456"Create object with tags:
anytype_create_object \ --space_id="space123" \ --name="My Task" \ --properties='[{"key":"labels","multi_select":["tag_id_1","tag_id_2"]}]'Update object with new tags:
anytype_update_object \ --space_id="space123" \ --object_id="obj789" \ --properties='[{"key":"status","select":"completed_tag_id"}]'
For complete tag usage examples, see TAGS_USAGE.md.
š 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
// Instead of simple update:
// PATCH /v1/spaces/{spaceId}/objects/{objectId}
// Use this pattern:
1. Get current object data
2. Delete the existing object
3. Create new object with updated content
4. Return new object IDImplementation Example
async function updateObjectContent(spaceId: string, objectId: string, updates: any) {
// 1. Get current object
const currentObject = await getObject(spaceId, objectId);
// 2. Merge updates with current data
const updatedData = {
...currentObject,
...updates,
// Preserve important metadata
type: currentObject.type,
createdDate: currentObject.createdDate
};
// 3. Delete current object
await deleteObject(spaceId, objectId);
// 4. Create new object with updated content
const newObject = await createObject(spaceId, updatedData);
return newObject;
}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
src/
āāā index.ts # Main server entry point
āāā startup-info.ts # Server startup information
āāā utils.ts # Utility functions and API helpers
āāā handlers/ # Request handlers
ā āāā spaces.ts # Space and member operations
ā āāā objects.ts # Object CRUD operations
ā āāā properties.ts # Property management
ā āāā types-tags.ts # Types, tags, and templates
āāā tools/ # MCP tool definitions
āāā spaces.ts # Space tool schemas
āāā objects.ts # Object tool schemas
āāā properties.ts # Property tool schemas
āāā types.ts # Type tool schemas
āāā tags.ts # Tag tool schemas
āāā templates.ts # Template tool schemas
āāā lists.ts # List tool schemas
āāā schemas.ts # Common schemasš 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):
network_mode: hostThis allows the container to access Anytype running on the host machine.
Bridge Network Mode (Alternative): If Anytype is also containerized, use a custom network:
networks:
- anytype-networkEnvironment 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:31009in Docker
š Development
Available Scripts
npm run build # Compile TypeScript to JavaScript
npm start # Start the MCP server
npm run dev # Development mode with tsx
npm run prepare # Pre-publish build stepDocker Development
# Development with Docker
docker-compose -f docker-compose.yml up --build
# View logs in real-time
docker-compose logs -f anytype-mcp
# Execute commands in container
docker-compose exec anytype-mcp shAdding New Features
Define tool schema in the appropriate
tools/*.tsfileImplement handler in the corresponding
handlers/*.tsfileRegister tool in
src/index.tsUpdate 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
Available Tools
33 toolsanytype_add_to_collectionC
Adds an object to a collection
Inputs: space_id (required), collection_id (required), object_id (required).
anytype_create_objectC
Crea un nuevo objeto en un espacio
Inputs: space_id (required), name (required), type_key, body, +4 more.
anytype_create_propertyC
Crea una nueva propiedad
Inputs: space_id (required), name (required), type (required), key, +4 more.
anytype_create_spaceC
Crea un nuevo espacio
Inputs: name (required), description, icon.
anytype_create_tagC
Creates a new tag
Inputs: space_id (required), name (required), property_id (required), color.
anytype_create_typeC
Crea un nuevo tipo de objeto
Inputs: space_id (required), name (required), key, plural_name, +4 more.
anytype_delete_objectC
Elimina (archiva) un objeto
Inputs: space_id (required), object_id (required).
anytype_delete_propertyC
Elimina una propiedad
Inputs: space_id (required), property_id (required).
anytype_delete_tagC
Deletes a tag
Inputs: space_id (required), tag_id (required).
anytype_delete_typeC
Elimina un tipo de objeto
Inputs: space_id (required), type_id (required).
anytype_get_list_objectsC
Obtiene objetos de una lista usando una vista especĆfica
Inputs: space_id (required), list_id (required), view_id (required), limit, +1 more.
anytype_get_list_viewsB
Obtiene las vistas disponibles para una lista
Inputs: space_id (required), list_id (required).
anytype_get_memberC
Obtiene un miembro especĆfico
Inputs: space_id (required), member_id (required).
anytype_get_objectC
Obtiene un objeto especĆfico por su ID
Inputs: space_id (required), object_id (required).
anytype_get_propertyC
Obtiene una propiedad especĆfica
Inputs: space_id (required), property_id (required).
anytype_get_spaceB
Obtiene un espacio especĆfico por su ID
Inputs: space_id (required).
anytype_get_tagC
Gets a specific tag
Inputs: space_id (required), tag_id (required).
anytype_get_templateC
Gets a specific template
Inputs: space_id (required), type_id (required), template_id (required).
anytype_get_typeC
Obtiene un tipo especĆfico
Inputs: space_id (required), type_id (required).
anytype_list_membersC
Lista todos los miembros de un espacio
Inputs: space_id (required), limit, offset.
anytype_list_objectsC
Lista objetos en un espacio especĆfico
Inputs: space_id (required), limit, offset.
anytype_list_propertiesC
Lista todas las propiedades de un espacio
Inputs: space_id (required), limit, offset.
anytype_list_spacesB
Lista todos los espacios disponibles
Inputs: no named parameters.
anytype_list_tagsB
Lists all tags for a property
Inputs: space_id (required), property_key (required), limit, offset.
anytype_list_templatesC
Lists all available templates for a specific type
Inputs: space_id (required), type_id (required), limit, offset.
anytype_list_typesC
Lista todos los tipos de objetos
Inputs: space_id (required).
anytype_remove_from_collectionC
Removes an object from a collection
Inputs: space_id (required), collection_id (required), object_id (required).
anytype_search_objectsB
Busca objetos en todos los espacios o en un espacio especĆfico
Inputs: query, space_id, types, limit.
anytype_update_objectA
Actualiza un objeto existente. IMPORTANTE: Para actualizaciones de contenido (body/markdown), utiliza una estrategia de reemplazo que crea un nuevo objeto con el contenido actualizado y elimina el original, ya que la API de Anytype no actualiza correctamente el contenido markdown con el mƩtodo tradicional.
Inputs: space_id (required), object_id (required), name, body, +3 more.
anytype_update_propertyD
Actualiza una propiedad existente
Inputs: space_id (required), property_id (required), name, description, +3 more.
anytype_update_spaceC
Actualiza un espacio existente
Inputs: space_id (required), name, description, icon.
anytype_update_tagC
Updates an existing tag
Inputs: space_id (required), tag_id (required), name, color.
anytype_update_typeC
Actualiza un tipo existente
Inputs: space_id (required), type_id (required), name, description, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 33 tools
Every tool has a clearly distinct purpose targeting specific resources (objects, spaces, properties, tags, types, collections, members, templates) and actions (create, get, list, update, delete, add/remove, search). No ambiguity exists between tools like anytype_get_object vs anytype_list_objects or anytype_create_property vs anytype_update_property. The descriptions reinforce distinct operations.
All 33 tools follow a perfect verb_noun pattern with the prefix 'anytype_' and snake_case throughout. The pattern is consistent: anytype_[action]_[resource] (e.g., anytype_create_object, anytype_get_space, anytype_list_tags). No deviations in style or convention exist across the toolset.
With 33 tools, the count is slightly high but reasonable for a comprehensive content management system covering spaces, objects, properties, types, tags, templates, members, and collections. Each tool appears to serve a specific purpose in the domain, though some consolidation might be possible (e.g., add/remove from collection could be one tool).
The toolset provides complete CRUD/lifecycle coverage for all core domain entities: spaces, objects, properties, types, tags, templates, and members. It includes create, get, list, update, and delete operations for each, plus search, collection management, and view handling. No obvious gaps exist; agents can perform full workflows without dead ends.
Maintenance
Related MCP Connectors
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
MCP-native collaborative markdown editor with real-time AI document editing
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA 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.2,277 npm538MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Anytype data through the local API, allowing search, creation, modification, and export of objects, spaces, and lists.1824MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control Anytype objects, blocks, and views via its internal gRPC API.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients that support remote servers, such as ChatGPT, to securely search, fetch, list, and optionally create or update objects in a self-hosted Anytype space over HTTPS.MIT