Labsco
suhail-ak-s logo

Typesense MCP Server

โ˜… 19

from suhail-ak-s

Provides access to Typesense search capabilities, requiring a connection to a Typesense server.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeNeeds API keys

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

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

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

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.