Typesense MCP Server
A server that enables vector and keyword search capabilities in Typesense databases through the Model Context Protocol, providing tools for collection management, document operations, and search functionality.
Tools
check_typesense_health
Checks the health status of the configured Typesense server. Args: ctx (Context): The MCP context, providing access to application resources. Returns: dict | str: The health status dictionary from Typesense or an error message.
list_collections
Retrieves a list of all collections in the Typesense server. Args: ctx (Context): The MCP context. Returns: list | str: A list of collection schemas or an error message string.
describe_collection
Retrieves the schema and metadata for a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to describe. Returns: dict | str: The collection schema dictionary or an error message string.
export_collection
Exports all documents from a specific collection. Warning: This can be memory-intensive for very large collections. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to export. Returns: list[dict] | str: A list of document dictionaries or an error message string.
search
Performs a keyword search on a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to search within. query (str): The search query string. Use '*' for all documents. query_by (str): Comma-separated list of fields to search in. filter_by (str | None): Filter conditions (e.g., 'price:>100 && category:Electronics'). Defaults to None. sort_by (str | None): Sorting criteria (e.g., 'price:asc, rating:desc'). Defaults to None. group_by (str | None): Field to group results by. Defaults to None. facet_by (str | None): Fields to facet on. Defaults to None. per_page (int): Number of results per page. Defaults to 20. page (int): Page number to retrieve. Defaults to 1. Returns: dict | str: The search results dictionary from Typesense or an error message string.
vector_search
Performs a vector similarity search on a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to search within. vector_query (str): The vector query string, formatted as 'vector_field:([v1,v2,...], k: num_neighbors)'. query_by (str | None): Optional: Comma-separated list of text fields for hybrid search query ('q' parameter). Defaults to None. filter_by (str | None): Filter conditions to apply before vector search. Defaults to None. sort_by (str | None): Optional sorting criteria (less common for pure vector search). Defaults to None. per_page (int): Number of results per page. Defaults to 10. page (int): Page number to retrieve. Defaults to 1. Returns: dict | str: The vector search results dictionary from Typesense or an error message string.
create_collection
Creates a new collection with the provided schema. Args: ctx (Context): The MCP context. schema (dict): The collection schema dictionary (must include 'name' and 'fields'). Returns: dict | str: The created collection schema dictionary or an error message string.
delete_collection
Deletes a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to delete. Returns: dict | str: The deleted collection schema dictionary or an error message string.
truncate_collection
Truncates a collection by deleting all documents but keeping the schema. Achieved by retrieving schema, deleting collection, and recreating it. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection to truncate. Returns: str: A success or error message string.
create_document
Creates a single new document in a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection. document (dict): The document data to create (must include an 'id' field unless auto-schema). Returns: dict | str: The created document dictionary or an error message string.
upsert_document
Upserts (creates or updates) a single document in a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection. document (dict): The document data to upsert (must include an 'id' field). Returns: dict | str: The upserted document dictionary or an error message string.
index_multiple_documents
Indexes (creates, upserts, or updates) multiple documents in a batch. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection. documents (list[dict]): A list of document dictionaries to index. action (str): The import action ('create', 'upsert', 'update'). Defaults to 'upsert'. Returns: list[dict] | str: A list of result dictionaries (one per document) or an error message string. Each result dict typically looks like {'success': true/false, 'error': '...', 'document': {...}}.
delete_document
Deletes a single document by its ID from a specific collection. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection. document_id (str): The ID of the document to delete. Returns: dict | str: The deleted document dictionary or an error message string.
import_documents_from_csv
Imports documents from CSV data (as a string) or a file path into a collection. Assumes CSV header row maps directly to Typesense field names. Does basic type inference for int/float, otherwise treats as string. Args: ctx (Context): The MCP context. collection_name (str): The name of the collection. csv_data_or_path (str): Either the raw CSV data as a string or the path to a CSV file. batch_size (int): Number of documents to import per batch. Defaults to 100. action (str): Import action ('create', 'upsert', 'update'). Defaults to 'upsert'. Returns: dict: A summary of the import process including total processed, successful, failed count, and any errors.
README
Typesense MCP Server
A Model Context Protocol (MCP) Server that interfaces with Typesense
Installation
Install uv
On Mac you can install it using homebrew
brew install uv
Clone the package
git clone git@github.com:avarant/typesense-mcp-server.git ~/typesense-mcp-server
Update your .cursor/mcp.json to use in Cursor
{
"mcpServers": {
"server-name": {
"command": "uv",
"args": ["--directory", "~/typesense-mcp-server", "run", "mcp", "run", "main.py"],
"env": {
"TYPESENSE_HOST": "",
"TYPESENSE_PORT": "",
"TYPESENSE_PROTOCOL": "",
"TYPESENSE_API_KEY": ""
}
}
}
}
Available Tools
The Typesense MCP Server provides the following tools:
Server Management
check_typesense_health- Checks the health status of the configured Typesense serverlist_collections- Retrieves a list of all collections in the Typesense server
Collection Management
describe_collection- Retrieves the schema and metadata for a specific collectionexport_collection- Exports all documents from a specific collectioncreate_collection- Creates a new collection with the provided schemadelete_collection- Deletes a specific collectiontruncate_collection- Truncates a collection by deleting all documents but keeping the schema
Document Operations
create_document- Creates a single new document in a specific collectionupsert_document- Upserts (creates or updates) a single document in a specific collectionindex_multiple_documents- Indexes (creates, upserts, or updates) multiple documents in a batchdelete_document- Deletes a single document by its ID from a specific collectionimport_documents_from_csv- Imports documents from CSV data into a collection
Search Capabilities
search- Performs a keyword search on a specific collectionvector_search- Performs a vector similarity search on a specific collection
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。