npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lexmcp

v1.0.0

Published

Model Context Protocol (MCP) Server for LexMCP with Typesense integration

Readme

LexMCP - Model Context Protocol Server

A Model Context Protocol (MCP) server for LexMCP that interfaces with Typesense to provide legal resources.

Features

  • MCP server that provides legal resources through the Model Context Protocol
  • REST API for directly accessing Typesense data
  • Support for searching legal opinions and court information
  • Easily deployable via NPX

Installation

npm install -g lexmcp-mcp-server

Or run directly with npx:

npx lexmcp-mcp-server

Configuration

The server can be configured using environment variables:

  • PORT: The port for the REST API server (default: 8001)
  • TYPESENSE_HOST: Typesense server host (default: localhost)
  • TYPESENSE_PORT: Typesense server port (default: 8108)
  • TYPESENSE_PROTOCOL: Typesense server protocol (default: http)
  • TYPESENSE_API_KEY: Typesense API key (default: xyz)

MCP Tools

The server provides the following MCP tools:

  1. search - Search for documents

    • Parameters:
      • query: The search query
      • collection (optional): The collection to search (default: "opinions")
      • fields (optional): The fields to search (default: ["text_chunks"])
      • per_page (optional): The number of results per page (default: 10)
      • page (optional): The page number (default: 1)
  2. get_document - Retrieve document by ID

    • Parameters:
      • document_id: The document ID
      • collection (optional): The collection to search (default: "opinions")
  3. list_courts - List available courts

    • Parameters:
      • per_page (optional): The number of results per page (default: 100)
      • page (optional): The page number (default: 1)
  4. health_check - Check Typesense server health

REST API Endpoints

  • POST /search: Search for documents
  • GET /collections/:collection/documents/:id: Retrieve document by ID
  • GET /courts: List available courts
  • GET /health: Check Typesense server health

Adding to Claude Config

Add LexMCP to your Claude configuration file:

{
  "mcpServers": {
    "lexmcp": {
      "command": "npx",
      "args": ["-y", "lexmcp-mcp-server"]
    }
  }
}

Examples

Search for legal opinions

{
  "type": "function_call",
  "name": "search",
  "id": "1",
  "arguments": {
    "query": "first amendment",
    "collection": "opinions",
    "fields": ["text_chunks"]
  }
}

Get a specific document

{
  "type": "function_call",
  "name": "get_document",
  "id": "2",
  "arguments": {
    "document_id": "10224550",
    "collection": "opinions"
  }
}

List courts

{
  "type": "function_call",
  "name": "list_courts",
  "id": "3",
  "arguments": {
    "per_page": 20,
    "page": 1
  }
}

Search API Features

The MCP server now supports three types of search:

1. Vector Search (Default)

Vector search uses embedding vectors to find semantically similar documents, regardless of exact keyword matches. This is useful for finding conceptually related documents even when they don't contain the exact search terms.

POST /search
{
  "searchType": "vector",  
  "vector": [0.1, -0.2, 0.3, ...],  // 384-dimension embedding vector
  "collection": "documents",
  "per_page": 10,
  "page": 1
}

2. Keyword Search

Traditional text-based search using keywords.

POST /search
{
  "searchType": "keyword",
  "query": "first amendment freedom of speech",
  "collection": "documents",
  "fields": ["title", "text_chunks"],
  "per_page": 10,
  "page": 1
}

3. Hybrid Search

Combines both vector similarity and keyword matching for more robust results.

POST /search
{
  "searchType": "hybrid",
  "query": "first amendment freedom of speech",
  "vector": [0.1, -0.2, 0.3, ...],  // 384-dimension embedding vector
  "vectorWeight": 0.3,              // Weight given to vector similarity (0-1)
  "collection": "documents",
  "fields": ["title", "text_chunks"],
  "per_page": 10,
  "page": 1
}

MCP Function Calls

The same search types are available through MCP function calls:

{
  "name": "search",
  "arguments": {
    "searchType": "vector",         // "vector", "keyword", or "hybrid"
    "query": "search query",        // Required for keyword and hybrid search
    "vector": [0.1, 0.2, ...],      // Required for vector and hybrid search
    "vectorWeight": 0.3,            // Optional, for hybrid search (0-1)
    "collection": "documents",
    "fields": ["title", "text_chunks"],
    "per_page": 10,
    "page": 1
  }
}

License

MIT