MCP Connector

Connect LLMs to Typesense Data

Typesense MCP Server gives AI assistants search access to Typesense collections - querying, fetching documents, and stats.

Works with typesense

91
Spark score
out of 100
Updated 9 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Empower AI models with Typesense search capabilities. Enable LLMs to seamlessly find, search, and analyze data stored within your Typesense collections.

Outcomes

What it gets done

01

Integrate LLMs with Typesense for data retrieval and analysis.

02

Enable full-text search, filtering, and sorting of Typesense collections.

03

Provide access to collection statistics, metadata, and schemas.

04

Facilitate document retrieval by ID.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-typesense | bash

Capabilities

Tools your agent gets

typesense_query

Search documents in Typesense collections with filtering, query text, and customizable parameters

typesense_get_document

Retrieve specific documents by ID from collections, returning complete document data

typesense_collection_stats

Retrieve statistics about a Typesense collection including metadata, document count, and schema

typesense_list_collections

List all available collections with their schemas for discovery and routing

Overview

Typesense MCP Server

An MCP server giving an AI assistant direct access to Typesense: discover collections, run full-text search with filters and sorting, fetch documents by ID, and pull collection stats. Use it when an assistant needs to search or analyze data already indexed in Typesense - it's a read/query layer, not an admin tool.

What it does

Typesense MCP Server is a Model Context Protocol implementation that gives an AI assistant direct access to Typesense search capabilities. It lets an LLM discover what collections exist, run full-text searches with filtering, sorting, and pagination, retrieve a specific document by ID, and pull statistics and schema information about a collection - all without leaving the chat interface. Collections are also exposed as first-class MCP resources at typesense://collections/<collection> URIs, returning JSON schema information (field names and data types) plus sample documents so an assistant can inspect a collection's shape before querying it, and the server ships resource templates for constructing search queries and viewing collection details.

When to use - and when NOT to

Use this connector when an assistant needs to search or analyze data already indexed in Typesense: answering questions grounded in a product catalog, document store, or any searchable dataset, or helping a user construct effective search queries against a collection whose schema they don't know by heart. It is not useful without an existing Typesense deployment to connect to, and it does not create or index collections - it is a read/query layer, not a Typesense admin tool.

Capabilities

  • typesense_list_collections: lists all available collections with schema and field definitions (searchable, facetable, numeric fields), supporting an include_fields parameter. It enables zero-config discovery - the LLM can enumerate collections at runtime and pick the right one(s) before searching, which matters when collections vary by environment, tenant, or version.
  • typesense_query: full-text searches a collection with query text, search fields, filters, sort options, and limit, returning matches with relevance scores.
  • typesense_get_document: retrieves a specific document by collection name and document ID.
  • typesense_collection_stats: returns collection metadata, document count, and schema information.
  • Collections are also exposed as MCP resources via typesense:// URIs, and prompts analyze_collection and search_suggestions help interpret schema and suggest search strategies.

How to install

Install via npm (globally, or locally within a project):

npm install -g typesense-mcp-server

Or install via mcp-get:

npx @michaellatman/mcp-get@latest install typesense-mcp-server

For Claude Desktop, add an mcpServers entry in claude_desktop_config.json with command: npx, args ["-y", "typesense-mcp-server", "--host", "your-typesense-host", "--port", "8108", "--protocol", "http", "--api-key", "your-api-key"]. For debugging, use the MCP Inspector via npm run inspector; server logs are written to /tmp/typesense-mcp.log.

Who it's for

Teams running Typesense who want their AI assistant to search, retrieve, and reason over indexed data directly, or to help users build better search queries against collections whose structure varies by environment or tenant. The server is licensed under the MIT License.

Source README

MseeP.ai Security Assessment Badge

Typesense MCP Server


npm version
License: MIT
Node.js Version

A Model Context Protocol (MCP) server implementation that provides AI models with access to Typesense search capabilities. This server enables LLMs to discover, search, and analyze data stored in Typesense collections.

Demo

Typesense MCP Server Demo | Claude Desktop

Features

Resources

  • List and access collections via typesense:// URIs
  • Each collection has a name, description, and document count
  • JSON mime type for schema access

Tools

  • typesense_query

    • Search for documents in Typesense collections with powerful filtering
    • Input: Query text, collection name, search fields, filters, sort options, limit
    • Returns matching documents with relevance scores
  • typesense_get_document

    • Retrieve specific documents by ID from collections
    • Input: Collection name, document ID
    • Returns complete document data
  • typesense_collection_stats

    • Get statistics about a Typesense collection
    • Input: Collection name
    • Returns collection metadata, document count, and schema information

Prompts

  • analyze_collection

    • Analyze collection structure and contents
    • Input: Collection name
    • Output: Insights about schema, data types, and statistics
  • search_suggestions

    • Get suggestions for effective search queries for a collection
    • Input: Collection name
    • Output: Recommended search strategies based on collection schema

Installation

Via npm

# Global installation
npm install -g typesense-mcp-server

# Local installation
npm install typesense-mcp-server

Via mcp-get

npx @michaellatman/mcp-get@latest install typesense-mcp-server

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation for Development

Using Claude Desktop

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "typesense": {
      "command": "node",
      "args": [
        "~/typesense-mcp-server/dist/index.js",
        "--host", "your-typesense-host",
        "--port", "8108",
        "--protocol", "http",
        "--api-key", "your-api-key"
      ]
    },
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Components

Resources

The server provides information about Typesense collections:

  • Collection Schemas (typesense://collections/<collection>)
    • JSON schema information for each collection
    • Includes field names and data types
    • Sample documents for understanding data structure

Tools

The server provides the following tools for interacting with Typesense:

  • typesense_list_collections - List all available collections with their schemas

    • Enables zero-conf discovery and routing
    • LLM can enumerate collections at runtime and pick the right one(s) before searching
    • Useful when collections vary by environment, tenant, or version
    • Returns field definitions for schema inference (searchable, facetable, numeric fields)
    • Supports include_fields parameter to control detail level
  • typesense_query - Search for documents in a collection

    • Full-text search with customizable parameters
    • Supports filtering, sorting, and pagination
  • typesense_get_document - Retrieve a specific document by ID

  • typesense_collection_stats - Get detailed statistics about a specific collection

Resource Templates

The server provides templates for:

  • typesense_search - Template for constructing Typesense search queries
  • typesense_collection - Template for viewing Typesense collection details

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

{
  "mcpServers": {
    "typesense": {
      "command": "npx",
      "args": [
        "-y",
        "typesense-mcp-server",
        "--host", "your-typesense-host",
        "--port", "8108",
        "--protocol", "http",
        "--api-key", "your-api-key"
      ]
    }
  }
}

Logging

The server logs information to a file located at:

/tmp/typesense-mcp.log

This log contains detailed information about server operations, requests, and any errors that occur.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.