vendor-search-mcp-server
v1.0.8
Published
MCP Vendor Search Server - Node.js TypeScript Implementation
Maintainers
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 nameget_vendor_contact_details: Get contact information for specific vendorstypesense_query: Direct Typesense collection queriesget_table_schema: Retrieve Typesense schema information
Additional Tools
google_search: Perform Google searchesparse_document_link: Parse documents using LlamaParse
Installation
Install dependencies:
npm installSet up environment variables: Create a
.envfile 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 devProduction Mode
npm startUsing 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 collectionsvendor_services_synonyms_updated: Service synonyms for enhanced searchusers: User information (for resources)
Typesense Collections
vendor4: Main vendor data collection with fields:vendorName: Vendor nameservicesOffered: Services providedlocationRegion: Vendor locationaddress: Physical addresscontactEmail: Email contactcontactNumber: Phone contactembedding: Vector embeddings for searchgpt_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 pointError 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 implementationmongodb: MongoDB clienttypesense: Typesense search clientcohere-ai: Cohere API client for rerankingopenai: OpenAI API clientwinston: Logging framework
Development Dependencies
typescript: TypeScript compilertsx: TypeScript execution environment@types/node: Node.js type definitions
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the debug logs (enable with --debug flag)
- Verify all required environment variables are set
- Ensure database connections are working
- Check API key validity for external services
