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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vendor-search-mcp-server

v1.0.8

Published

MCP Vendor Search Server - Node.js TypeScript Implementation

Readme

Vendor Search MCP Server (Node.js TypeScript)

A Model Context Protocol (MCP) server for vendor search functionality, converted from Python to Node.js TypeScript. This server provides advanced vendor search capabilities with AI-powered features including synonym expansion, relevance ranking, and document parsing.

Features

  • Vendor Search: Advanced search with synonym expansion and relevance-based ranking
  • Contact Information: Retrieve vendor contact details including address, email, and phone
  • Document Parsing: Parse documents using LlamaParse integration
  • Google Search: Perform web searches for additional information
  • Database Integration: MongoDB and Typesense support
  • AI-Powered: Cohere reranking, OpenAI, and Perplexity integrations

Tools Available

Core Search Tools

  • find_relevant_vendors: Search for vendors by service, location, and/or name
  • get_vendor_contact_details: Get contact information for specific vendors
  • typesense_query: Direct Typesense collection queries
  • get_table_schema: Retrieve Typesense schema information

Additional Tools

  • google_search: Perform Google searches
  • parse_document_link: Parse documents using LlamaParse

Installation

  1. Install dependencies:

    npm install
  2. Set up environment variables: Create a .env file with the following variables:

    # Typesense Configuration
    TYPESENSE_HOST=localhost
    TYPESENSE_PORT=8108
    TYPESENSE_PROTOCOL=http
    TYPESENSE_API_KEY=your_typesense_api_key_here
    
    # MongoDB Configuration
    MONGODB_URI=mongodb://localhost:27017
    MONGODB_DB_NAME=vendor_search
    
    # Cohere Configuration
    COHERE_API_KEY=your_cohere_api_key_here
    
    # LlamaParse Configuration
    LLAMA_API_KEY=your_llama_api_key_here
    VENDOR_MODEL=your_vendor_model_here
    
    # OpenAI Configuration
    OPENAI_API_KEY=your_openai_api_key_here
    
    # Perplexity Configuration
    PERPLEXITY_API_KEY=your_perplexity_api_key_here

Usage

Development Mode

npm run dev

Production Mode

npm start

Using npx

npx vendor-search-mcp-server [options]

Command Line Options

  • --typesense-host: Typesense server host (default: localhost)
  • --typesense-port: Typesense server port (default: 8108)
  • --typesense-protocol: Typesense protocol (http/https)
  • --mongodb-uri: MongoDB connection URI
  • --mongodb-db-name: MongoDB database name
  • --debug: Enable debug output
  • --non-interactive, -n: Run in non-interactive mode
  • --help, -h: Show help message

As an MCP Server

Configure your MCP client to use this server:

{
  "mcpServers": {
    "vendor-search": {
      "command": "npx",
      "args": ["vendor-search-mcp-server"]
    }
  }
}

Database Setup

MongoDB Collections

  • typesense_schema: Schema information for Typesense collections
  • vendor_services_synonyms_updated: Service synonyms for enhanced search
  • users: User information (for resources)

Typesense Collections

  • vendor4: Main vendor data collection with fields:
    • vendorName: Vendor name
    • servicesOffered: Services provided
    • locationRegion: Vendor location
    • address: Physical address
    • contactEmail: Email contact
    • contactNumber: Phone contact
    • embedding: Vector embeddings for search
    • gpt_chunked_services: AI-processed service descriptions

AI Features

Synonym Expansion

The server uses MongoDB-stored synonym mappings to expand search queries, improving match accuracy for vendor services.

Relevance Ranking

Cohere's reranking API is used to improve search result relevance based on semantic similarity.

Document Processing

LlamaParse integration allows parsing of various document formats for vendor information extraction.

Project Structure

src/
├── config/
│   └── constants.ts          # Configuration management
├── database/
│   └── clients.ts            # Database client wrappers
├── server/
│   ├── index.ts             # Main server implementation
│   ├── resources.ts         # MCP resources handler
│   └── prompts.ts           # MCP prompts handler
├── tools/
│   ├── schemas.ts           # Tool schema definitions
│   └── handlers.ts          # Tool implementation handlers
├── utils/
│   └── logger.ts            # Logging utilities
└── index.ts                 # Entry point

Error Handling

The server includes comprehensive error handling with:

  • Graceful degradation when services are unavailable
  • Detailed logging for debugging
  • Client-friendly error messages
  • Fallback mechanisms for AI services

Dependencies

Core Dependencies

  • @modelcontextprotocol/sdk: MCP SDK for server implementation
  • mongodb: MongoDB client
  • typesense: Typesense search client
  • cohere-ai: Cohere API client for reranking
  • openai: OpenAI API client
  • winston: Logging framework

Development Dependencies

  • typescript: TypeScript compiler
  • tsx: TypeScript execution environment
  • @types/node: Node.js type definitions

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

  1. Check the debug logs (enable with --debug flag)
  2. Verify all required environment variables are set
  3. Ensure database connections are working
  4. Check API key validity for external services