Typesense MCP Server
The Typesense MCP Server is a tool for managing and interacting with a Typesense search engine server through a Model Context Protocol (MCP) interface. It provides:
Server Management: Check health status of the Typesense server and list all available collections.
Collection Management: Describe, export, create, delete, or truncate collections.
Document Operations: Create, upsert, index multiple, or delete individual documents, as well as import documents from CSV data.
Search Capabilities: Perform keyword searches with filtering, sorting, and pagination, and execute vector similarity searches for advanced querying.
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., "@Typesense MCP Server search for customer support articles about billing issues"
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.
Typesense MCP Server
A Model Context Protocol (MCP) Server that interfaces with Typesense
Installation
Install uv
Requires Python 3.11 or higher.
On Mac you can install it using homebrew
brew install uvClone the package
git clone git@github.com:avarant/typesense-mcp-server.git ~/typesense-mcp-serverAdd the server to your MCP client config. Most clients (Cursor at ~/.cursor/mcp.json, Claude Desktop at ~/Library/Application Support/Claude/claude_desktop_config.json, Windsurf, Zed, VS Code, etc.) accept the same mcpServers shape:
{
"mcpServers": {
"typesense": {
"command": "uv",
"args": ["--directory", "~/typesense-mcp-server", "run", "mcp", "run", "main.py"],
"env": {
"TYPESENSE_HOST": "",
"TYPESENSE_PORT": "",
"TYPESENSE_PROTOCOL": "",
"TYPESENSE_API_KEY": ""
}
}
}
}Refer to your client's MCP documentation for the exact config file location.
Related MCP server: Better Qdrant MCP Server
Transports
The server supports three MCP transports. STDIO is the default and is what most desktop clients (Claude Desktop, Cursor, etc.) use. For remote clients or web UIs, you can run it as an HTTP server using either the legacy SSE transport or the newer Streamable HTTP transport.
STDIO (default)
TYPESENSE_API_KEY=xyz uv run python main.pyStreamable HTTP (recommended for web clients)
Single endpoint at /mcp. Works with browser-based clients like the llama.cpp web chat. Set MCP_TRANSPORT=streamable-http (or pass --http):
TYPESENSE_API_KEY=xyz \
MCP_TRANSPORT=streamable-http \
MCP_STATELESS_HTTP=true \
MCP_CORS_ORIGINS='*' \
uv run python main.pyStateless mode (
MCP_STATELESS_HTTP=true) is required for clients that don't keep an MCP session across requests.CORS must be enabled (
MCP_CORS_ORIGINS) for browser clients. Use a specific origin likehttp://localhost:8080in production rather than*.
SSE (legacy)
Two endpoints, GET /sse for the event stream and POST /messages/ for JSON-RPC. Set MCP_TRANSPORT=sse (or pass --sse):
TYPESENSE_API_KEY=xyz MCP_TRANSPORT=sse uv run python main.pyConfiguration
Env var | Default | Description |
|
|
|
|
| Bind address for HTTP transports |
|
| Bind port for HTTP transports |
|
| Stateless mode for HTTP transports (required for some web clients) |
| (empty) | Comma-separated allowed origins. Empty disables CORS. |
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
Available Tools
14 toolscheck_typesense_healthB
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.
Inputs: no named parameters.
create_collectionC
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.
Inputs: schema (required).
create_documentC
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.
Inputs: collection_name (required), document (required).
delete_collectionC
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.
Inputs: collection_name (required).
delete_documentA
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.
Inputs: collection_name (required), document_id (required).
describe_collectionC
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.
Inputs: collection_name (required).
export_collectionB
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.
Inputs: collection_name (required).
import_documents_from_csvA
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.
Inputs: collection_name (required), csv_data_or_path (required), action, batch_size.
index_multiple_documentsA
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': {...}}.
Inputs: collection_name (required), documents (required), action.
list_collectionsC
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.
Inputs: no named parameters.
searchB
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.
Inputs: collection_name (required), query (required), query_by (required), facet_by, +5 more.
truncate_collectionA
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.
Inputs: collection_name (required).
upsert_documentA
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.
Inputs: collection_name (required), document (required).
vector_searchB
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.
Inputs: collection_name (required), vector_query (required), filter_by, page, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a distinct purpose with clear boundaries. For example, create_document vs. upsert_document vs. index_multiple_documents cover different single/batch operations, while search vs. vector_search target different search methods. No tools appear to duplicate functionality.
All tools follow a consistent verb_noun pattern with snake_case throughout (e.g., create_collection, delete_document, list_collections). The naming convention is predictable and matches the action-resource structure of the Typesense API domain.
With 14 tools, this server provides comprehensive coverage for a search engine/database server. The count is well-scoped for the domain, offering health checks, collection management, document CRUD operations, search capabilities, and data import/export without being overwhelming.
The tool set provides complete coverage for Typesense operations, including health monitoring, full collection lifecycle (create/describe/list/delete/truncate), document operations (create/upsert/delete/batch import/indexing), and both keyword and vector search capabilities. No obvious gaps exist for core search engine functionality.
Maintenance
Related MCP Connectors
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
An MCP server for search and retrieval over a local LanceDB database
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server providing vector database capabilities through Chroma, enabling semantic document search, metadata filtering, and document management with persistent storage.641MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables semantic search capabilities by providing tools to manage Qdrant vector database collections, process and embed documents using various embedding services, and perform semantic searches across vector embeddings.462 npm4MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants with direct access to local document collections through full-text search, supporting multiple formats and hierarchical collections.MIT
- AlicenseNot gradedqualityBmaintenanceA local-first semantic search server for documents, supporting PDFs, Office files, and text/markdown, enabling natural language search via the Model Context Protocol (MCP).1MIT