MCP ExplorerExplorer

Anytype Mcp

@wethegreenpeopleon 9 months ago
10 MIT
FreeCommunity
AI Systems
Anytype MCP Server enables semantic search and RAG for Anytype documents.

Overview

What is Anytype Mcp

Anytype MCP is a Model Context Protocol server designed for Anytype, enabling semantic search and Retrieval-Augmented Generation (RAG) capabilities over Anytype documents.

Use cases

Use cases for Anytype MCP include improving search functionality in personal knowledge management systems, enhancing document retrieval in research applications, and facilitating semantic search in collaborative environments.

How to use

To use Anytype MCP, clone the repository, install the necessary dependencies, and optionally run initial document ingestion. You can also configure it manually for use with the Claude Desktop application.

Key features

Key features include semantic search across Anytype documents, automatic chunking for improved search accuracy, and full metadata support including tags, dates, and custom properties.

Where to use

Anytype MCP can be used in various fields such as document management, knowledge bases, and any application requiring enhanced search capabilities over structured data.

Content

Anytype MCP Server

A Model Context Protocol (MCP) server for Anytype that enables semantic search and RAG (Retrieval-Augmented Generation) capabilities over your Anytype documents.

Features

  • Semantic search across your Anytype documents
  • Automatic chunking of documents for improved search accuracy
  • Full metadata support including tags, dates, and custom properties

Prerequisites

  • Python 3.13 or higher
  • uv - Modern Python package installer
  • Ollama - For running the embedding model locally
  • Anytype desktop application

Installation

  1. Clone the repository:
git clone https://github.com/wethegreenpeople/anytype-mcp.git
cd anytype-mcp
  1. Install dependencies:
uv sync
  1. Install the mxbai-embed-large model with Ollama:
ollama pull mxbai-embed-large
  1. Optional: Run initial document ingestion (this can be done later from the client, but depending on your machine and how many notes you have, this might take a few minutes):
python scripts/ingest_only.py
  1. Optional: Install the server in Claude:
fastmcp install server.py

Manual Configuration for Claude Desktop

If you want to manually add the Anytype MCP server to your Claude Desktop application, you’ll need to modify the claude_desktop_config.json file. This file is typically located at:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Add the following configuration to the mcpServers section of your claude_desktop_config.json:

Replace [PATH_TO_ANYTYPE_MCP] with the absolute path to your anytype-mcp directory. For example:

  • Windows: C:\\Users\\username\\Documents\\anytype-mcp\\server.py
  • macOS/Linux: /home/username/anytype-mcp/server.py

Make sure to use double backslashes (\\) for Windows paths in the JSON file.

Authentication

The server handles authentication with Anytype via a challenge-based flow:

  1. First run requires obtaining a challenge ID
  2. You’ll need to provide a secret code from Anytype
  3. The server stores the authentication token for future sessions

Usage

The server provides several tools that can be used within Claude:

  • ingest_documents: Ingest or update Anytype documents into the vector store
  • query_anytype_documents: Perform semantic search across your documents
  • get_anytype_object: Retrieve a specific Anytype object by ID
  • get_ingestion_stats: View statistics about ingested documents
  • clear_ingestion: Clear the vector store and start fresh

Technical Details

Embedding Model

The mxbai-embed-large model is used for generating embeddings in this project. It’s fetched from Ollama and configured in the EmbeddingUtils class. If you prefer to use a different embedding model, you can modify the OLLAMA_MODEL variable in utils/embedding_utils.py.

Data Storage

The application uses platformdirs for cross-platform data storage:

  • ChromaDB data: Stored in a platform-specific user data directory
  • NLTK data: Downloaded and stored locally
  • Authentication tokens: Securely stored in a configuration file

NLTK and Tokenization

This project uses the NLTK library for sentence tokenization, specifically the punkt_tab tokenizer. The tokenizer is automatically downloaded to the application’s data directory during initialization.

License

Contributing

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers