Skip to main content
Glama

Bar Assistant MCP Server

by zhdenny
MIT License

Bar Assistant MCP Server# Bar Assistant MCP Server# Bar Assistant MCP Server

A high-performance Model Context Protocol (MCP) server that provides intelligent cocktail search and recipe retrieval from Bar Assistant instances.

FeaturesA high-performance Model Context Protocol (MCP) server that provides intelligent cocktail search and recipe retrieval with advanced batch processing capabilities.A Model Context Protocol (MCP) server that integrates with Bar Assistant, enabling natural language interactions with your cocktail database through AI assistants like GitHub Copilot.

  • ๐Ÿ” Smart Cocktail Search - Natural language queries with similarity matching

  • ๐Ÿ“– Complete Recipes - Detailed ingredients, instructions, and specifications

  • ๐ŸŽฏ Similarity Engine - Discover cocktails similar to your favorites## ๐Ÿš€ Features## Features

  • ๐Ÿงช Ingredient Analysis - Find cocktails by ingredients, flavors, and characteristics

  • โšก Batch Processing - Retrieve multiple recipes simultaneously (5-10x faster)

  • ๐Ÿ’พ Smart Caching - Intelligent caching with 70%+ hit rate

  • ๐Ÿ”ง Advanced Filtering - ABV ranges, glassware, preparation methods, and more### Intelligent Cocktail Discovery- ๐Ÿ” Search Cocktails - Find drinks by name, ingredient, base spirit, or ABV

Prerequisites- ๐Ÿ” Smart Search: Natural language cocktail discovery with similarity matching- ๐Ÿ“– Recipe Details - Get complete recipes with ingredients and instructions

  • Node.js 18 or higher- ๐Ÿงช Ingredient Analysis: Find cocktails by ingredients, flavors, and characteristics - ๐ŸŽฏ Smart Recommendations - Find similar cocktails based on flavor profiles

  • Access to a Bar Assistant instance

  • Bar Assistant API token- ๐ŸŽฏ Advanced Filtering: ABV ranges, glassware, preparation methods, and more- ๐Ÿ“ฆ Inventory Management - Check what you can make with available ingredients

Installation- ๐Ÿ”„ Similarity Engine: Discover cocktails similar to favorites- ๐Ÿ›’ Shopping Lists - Generate ingredient lists for multiple cocktails

  1. Clone the repository:

git clone <your-repository-url> cd bar-assistant-mcp-server- ๐Ÿ“– **Complete Recipes**: Detailed ingredients, instructions, and specifications
  • ๐Ÿธ Batch Processing: Retrieve multiple recipes simultaneously (5-10x faster)### Prerequisites

  1. Install dependencies:

  • โšก Smart Caching: Intelligent caching system with 70%+ hit rate

npm install- ๐Ÿ”— **Direct Links**: Database links for complete cocktail information- Node.js 18+
  • Access to a Bar Assistant instance

  1. Build the server:

Advanced Performance Features- Bar Assistant API token

npm run build- ๐Ÿš€ **Parallel Processing**: Simultaneous API calls with error isolation
  • ๐Ÿ’พ Intelligent Caching: 5-minute TTL with smart eviction policies### Installation

Configuration

  • ๐Ÿ›ก๏ธ Error Resilience: Individual failures don't break batch operations

Environment Variables

  • ๐Ÿ“Š Performance Metrics: Built-in timing and optimization analytics1. Clone and install dependencies:

Set the following environment variables or configure them in your MCP client:

```bash export BAR_ASSISTANT_URL="https://your-bar-assistant-instance.com"## ๐Ÿ› ๏ธ Installationnpm install export BAR_ASSISTANT_TOKEN="your-api-token-here" export BAR_ASSISTANT_BAR_ID="1" # Optional, defaults to "1"```

Prerequisites

VS Code Configuration

  • Node.js 18+2. Configure your Bar Assistant connection:

If using with VS Code, create or update .vscode/mcp.json:

  • TypeScript 4.5+Edit .vscode/mcp.json or set environment variables:

{- Access to Bar Assistant API instance```bash "servers": { "bar-assistant": {export BAR_ASSISTANT_URL="https://your-bar-assistant-url" "command": "node", "args": ["dist/src/bar-assistant-mcp-server.js"],### Setupexport BAR_ASSISTANT_TOKEN="your-api-token" "env": { "BAR_ASSISTANT_URL": "https://your-bar-assistant-instance.com",``` "BAR_ASSISTANT_TOKEN": "your-api-token-here", "BAR_ASSISTANT_BAR_ID": "1"1. **Clone and Install** } }```bash3. **Build the server:** } }git clone <repository-url>```bash

cd BarAssistant/Round2npm run build

Claude Desktop Configuration

npm install```

Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

```jsonc {4. **Test the connection:** "mcpServers": { "bar-assistant": {2. **Configure Environment**```bash "command": "node", "args": ["/absolute/path/to/dist/src/bar-assistant-mcp-server.js"],```bashnpm test "env": { "BAR_ASSISTANT_URL": "https://your-bar-assistant-instance.com",# Create .env file``` "BAR_ASSISTANT_TOKEN": "your-api-token-here", "BAR_ASSISTANT_BAR_ID": "1"echo "BAR_ASSISTANT_URL=http://your-bar-assistant-instance" > .env } }echo "BAR_ASSISTANT_API_KEY=your-api-key" >> .env## Usage } }```

With GitHub Copilot

Getting Your Bar Assistant API Token

  1. Build and Start

  2. Log into your Bar Assistant instance

  3. Navigate to Settings โ†’ API```bashOnce configured in VS Code, you can ask natural language questions like:

  4. Generate a new API token

  5. Copy the token and use it in your configurationnpm run build

Usagenpm start- "Give me recommendations on cocktails like a Negroni"

Once configured, you can interact with the server through your MCP client. Here are some example queries:```- "What cocktails can I make with gin and vermouth?"

Finding Similar Cocktails- "Show me the recipe for a Manhattan"

"Give me recommendations on cocktails like a Negroni"## ๐ŸŽฏ MCP Tools- "What ingredients do I need to buy to make these 5 cocktails?"

Recipe Lookup

"Show me how to make a Manhattan"### 1. smart_search_cocktails - Intelligent Discovery Engine### Available MCP Tools

Ingredient-Based Search

*"What cocktails can I make with gin and vermouth?"*Primary Use Cases:#### search_cocktails

Shopping Lists- Cocktail discovery and explorationSearch for cocktails with various filters:

"What ingredients do I need to buy to make these 5 cocktails?"- Similarity-based recommendations ```typescript

Available Tools- Ingredient-based searches{

smart_search_cocktails- Complex filtering and analysis query?: string, // Name search

Intelligent cocktail discovery with similarity matching and advanced filtering. ingredient?: string, // Ingredient filter

**Parameters:**Key Features: base_spirit?: string, // Spirit type

  • query (string): Natural language search query

  • similar_to (string): Find cocktails similar to this name- ๐Ÿ”„ Batch Processing: Parallel search with intelligent caching abv_min?: number, // Minimum ABV

  • similar_to_id (number): Find cocktails similar to this ID

  • ingredient (string): Filter by primary ingredient- ๐ŸŽฏ Multi-Filter Support: Combine ingredients, ABV, flavors, methods abv_max?: number, // Maximum ABV

  • must_include (string[]): Required ingredients

  • must_exclude (string[]): Excluded ingredients- ๐Ÿ“Š Complete Results: Full recipes with all details included can_make?: boolean, // Only makeable cocktails

  • preferred_flavors (string[]): Flavor profiles (bitter, sweet, sour, spicy, herbal)

  • preferred_strength (string): Alcohol strength (light, medium, strong)- โšก High Performance: Optimized for complex queries limit?: number // Max results

  • abv_min (number): Minimum ABV percentage

  • abv_max (number): Maximum ABV percentage}

  • glass_type (string): Required glassware

  • preparation_method (string): Required method (shake, stir, build)Example Usage:```

  • limit (number): Maximum results (default: 20)

### `get_recipe` {#### `get_cocktail_recipe` Retrieve detailed recipes with batch processing support. "similar_to": "Negroni",Get detailed recipe by cocktail ID: **Parameters:** - `cocktail_id` (number): Single cocktail ID "preferred_flavors": ["bitter"],```typescript - `cocktail_name` (string): Single cocktail name - `cocktail_ids` (number[]): Multiple cocktail IDs (batch) "abv_min": 20,{ cocktail_id: number } - `cocktail_names` (string[]): Multiple cocktail names (batch) - `include_variations` (boolean): Include similar recipes "limit": 15``` - `limit` (number): Maximum results for batch (default: 10, max: 20) } ### `get_ingredient_info` ```#### `find_similar_cocktails` Get comprehensive ingredient information and usage across cocktails. Find cocktails similar to a given drink: **Parameters:** - `ingredient_name` (string): Name of the ingredient to research### 2. `get_recipe` - Advanced Recipe Retrieval```typescript ## Testing{ Run the test suite to verify your configuration:**Primary Use Cases:** cocktail_id: number, ```bash- Specific recipe lookups limit?: number npm test ```- Batch recipe collection} This will test:- Recipe comparisons``` - API connectivity and authentication - Cocktail search functionality- Menu planning - Recipe retrieval - Similarity search#### `check_inventory` - Inventory management **Key Features:**Check bar inventory status: ## Development - ๐Ÿš€ **Batch Processing**: Multiple recipes in single request```typescript ### Watch Mode - ๐Ÿ”„ **Mixed Input Types**: Names, IDs, or combinations{ ingredient_names?: string[] } ```bash npm run dev- ๐Ÿ“– **Complete Details**: Ingredients, instructions, specifications```
  • ๐ŸŽฏ Variation Support: Include similar recipes

Build Only

generate_shopping_list

npm run build**Example Usage:**Create shopping list for cocktails:

jsontypescript

Clean Build

{{ cocktail_ids: number[] }

rm -rf dist && npm run build "cocktail_names": ["Manhattan", "Negroni", "Martini"],```

"include_variations": true,

Performance

"limit": 5## Testing

The server includes several performance optimizations:

}

  • Batch Processing: 5-10x faster than sequential requests

  • Smart Caching: 70%+ cache hit rate with 5-minute TTL```### Run All Tests

  • Parallel API Calls: Simultaneous requests with error isolation

  • Intelligent Retries: Automatic retry with exponential backoff```bash

Typical performance:### 3. get_ingredient_info - Ingredient Intelligencenpm test

  • Single recipe: 150-300ms (cached: <50ms)

  • Batch (3 cocktails): 250-400ms vs 1500ms+ sequential```

  • Batch (5 cocktails): 300-500ms vs 2500ms+ sequential

Features:

Project Structure

  • Detailed ingredient information and characteristics### Test Specific Scenario

โ”œโ”€โ”€ src/- Usage examples across cocktail database```bash โ”‚ โ”œโ”€โ”€ bar-assistant-mcp-server.ts # Main MCP server โ”‚ โ”œโ”€โ”€ bar-assistant-client.ts # Bar Assistant API client- Substitution recommendations# Test the main Negroni recommendation scenario โ”‚ โ”œโ”€โ”€ cache-manager.ts # Caching system โ”‚ โ”œโ”€โ”€ query-parser.ts # Natural language processing- Flavor profile analysisnpm run test -- negroni โ”‚ โ”œโ”€โ”€ types.ts # TypeScript interfaces โ”‚ โ”œโ”€โ”€ response-schemas.ts # Response type definitions``` โ”‚ โ””โ”€โ”€ output-schemas.ts # Output format schemas โ”œโ”€โ”€ test/## โšก Performance Optimizations โ”‚ โ””โ”€โ”€ run-tests.ts # Test suite โ”œโ”€โ”€ package.json # Dependencies & scripts### Manual Testing โ””โ”€โ”€ tsconfig.json # TypeScript configuration ```### **Batch Processing System**```bash ## Error Handling- **Single Recipe**: ~150-300ms (cached responses <50ms)# Start the MCP server directly The server implements comprehensive error handling:- **Batch (3 cocktails)**: ~250-400ms vs 1500ms+ sequentialnpm start - **API Failures**: Automatic retry with exponential backoff- **Batch (5 cocktails)**: ~300-500ms vs 2500ms+ sequential - **Invalid Requests**: Clear error messages with suggestions - **Batch Failures**: Individual error isolation with partial results- **Cache Hit Rate**: 70%+ for popular cocktails# Or run in development mode - **Cache Issues**: Graceful fallback to API calls - **Network Problems**: Timeout handling with informative responsesnpm run dev ## Troubleshooting### **Smart Caching**``` ### Server Won't Start- 5-minute TTL for recipe data - Check Node.js version: `node --version` (requires 18+)- Intelligent eviction based on access patterns## Example Interactions - Verify environment variables are set - Ensure Bar Assistant instance is accessible- Automatic cache warming for popular cocktails ### Authentication Errors- Performance metrics included in all responses### Finding Negroni Alternatives - Verify your API token is correct - Check token hasn't expired - Ensure user has proper permissions in Bar Assistant### **Error Handling****Query:** *"Give me recommendations on cocktails like a Negroni"* ### Empty Results- Individual request isolation in batches - Check cocktail name spelling- Graceful fallback for API failures**Response:** - Verify Bar Assistant database has cocktails - Try broader search terms- Partial results when some requests fail``` - Use `smart_search_cocktails` to discover available cocktails - Comprehensive error reportingBased on your Bar Assistant database, here are cocktails similar to a Negroni: ### Performance Issues - Use batch processing for multiple requests - Check cache is working (look for "(cached)" in responses)## ๐Ÿ”ง Architecture1. **Boulevardier** - 28.5% ABV - Verify network connectivity to Bar Assistant instance Ingredients: Bourbon, Campari, Sweet Vermouth ## Contributing ### **Core Components** Why similar: Same base bitters, similar preparation method 1. Fork the repository 2. Create a feature branch- **BarAssistantClient**: API interface with retry logic 3. Make your changes with tests 4. Ensure TypeScript compilation passes: `npm run build`- **CacheManager**: Intelligent caching with TTL management2. **Americano** - 8.2% ABV 5. Run tests: `npm test` 6. Submit a pull request- **QueryParser**: Natural language query enhancement Ingredients: Campari, Sweet Vermouth, Soda Water ## License- **ResponseFormatter**: Rich text formatting with structured data Why similar: Shared ingredients: Campari, Sweet Vermouth MIT License - See LICENSE file for details``` ## About Bar Assistant### **Batch Processing Engine** This server integrates with [Bar Assistant](https://github.com/karlomikus/bar-assistant), a self-hosted cocktail recipe management application. Bar Assistant provides:- Parallel API calls using Promise.allSettled### Recipe Lookup - Comprehensive cocktail database- Batch optimization in groups of 5 requests - Recipe management with ingredients - Bar inventory tracking- Smart name resolution with caching**Query:** *"Show me how to make a Manhattan"* - Shopping list generation - REST API with authentication- Error isolation preventing cascade failures ## Support**Response:** For issues, questions, or feature requests:### **Performance Monitoring**``` - Check existing documentation - Review test suite for examples- Built-in timing for all operations# Manhattan - Create GitHub issues for bugs and features - Cache hit/miss statistics --- - API call optimization metrics**Description:** A classic whiskey cocktail with sweet vermouth **Built for the cocktail community** ๐Ÿธ - Response time tracking**ABV:** 29.5% *Enabling natural language interactions with your cocktail database through AI assistants.* **Glass:** Coupe ## ๐Ÿ“Š API Response Format**Method:** Stirred All tools return structured responses with:## Ingredients โ€ข 60ml Rye Whiskey ```typescriptโ€ข 30ml Sweet Vermouth {โ€ข 2 dashes Angostura Bitters content: [{ type: 'text',## Instructions text: string // Rich formatted content with emojis and structure1. Add all ingredients to mixing glass with ice }],2. Stir until well chilled 3. Strain into chilled coupe glass // Embedded structured data includes:4. Garnish with maraschino cherry recipes: Recipe[], // Complete cocktail data``` performance: { // Performance metrics processing_time_ms: number,## Project Structure cache_hits: number, batch_processing_used: boolean``` },โ”œโ”€โ”€ src/ search_metadata: { // Search contextโ”‚ โ”œโ”€โ”€ bar-assistant-mcp-server.ts # Main MCP server strategy_used: string,โ”‚ โ”œโ”€โ”€ bar-assistant-client.ts # API client filters_applied: string[]โ”‚ โ””โ”€โ”€ types.ts # TypeScript interfaces }โ”œโ”€โ”€ test/ }โ”‚ โ””โ”€โ”€ run-tests.ts # Test suite ```โ”œโ”€โ”€ .vscode/ โ”‚ โ””โ”€โ”€ mcp.json # MCP configuration ## ๐ŸŽฏ Integration Examplesโ”œโ”€โ”€ package.json # Dependencies & scripts โ””โ”€โ”€ tsconfig.json # TypeScript config ### **Single Recipe Lookup**``` ```json {## Configuration "name": "get_recipe", "arguments": {The server can be configured via environment variables or the MCP configuration file: "cocktail_name": "Manhattan" }| Variable | Description | Default | }|----------|-------------|---------| ```| `BAR_ASSISTANT_URL` | Base URL of your Bar Assistant instance | - | | `BAR_ASSISTANT_TOKEN` | API authentication token | - | ### **High-Performance Batch Retrieval** ```json## Error Handling { "name": "get_recipe", The server includes comprehensive error handling for: "arguments": { "cocktail_names": ["Manhattan", "Negroni", "Martini", "Old Fashioned"],- โœ… API authentication failures "limit": 4- โœ… Network connectivity issues }- โœ… Invalid queries and parameters }- โœ… Empty search results ```- โœ… Missing recipe data - โœ… Rate limiting ### **Intelligent Discovery** ```json## Development { "name": "smart_search_cocktails",### Watch Mode "arguments": {```bash "ingredient": "gin",npm run dev "must_include": ["vermouth"],``` "preferred_strength": "strong", "limit": 20### Build Only }```bash }npm run build

Similarity-Based Recommendations### Clean Build

jsonbash

{npm run clean && npm run build

"name": "smart_search_cocktails",```

"arguments": {

"similar_to": "Aviation",## Contributing "must_exclude": ["egg white"], "limit": 101. Ensure all tests pass: `npm test`

}2. Add tests for new functionality

}3. Follow the existing code style

## ๐Ÿ”„ Migration from v1## Bar Assistant API The enhanced v2 system maintains full backwards compatibility while adding powerful new features:This server integrates with [Bar Assistant](https://github.com/karlomikus/bar-assistant), a self-hosted cocktail recipe management application. - โœ… **All existing requests work unchanged**### Required Bar Assistant Features: - ๐Ÿš€ **New batch processing capabilities** - Cocktail search and filtering - โšก **Automatic performance improvements**- Recipe management with ingredients - ๐Ÿ“Š **Enhanced response formatting**- API access with authentication tokens - ๐Ÿ’พ **Smart caching benefits** ## License ## ๐Ÿ›ก๏ธ Error Handling MIT License - see LICENSE file for details. The server implements comprehensive error handling: - **API Failures**: Automatic retry with exponential backoff - **Invalid Requests**: Clear error messages with suggestions - **Batch Failures**: Individual error isolation with partial results - **Cache Issues**: Graceful fallback to API calls - **Network Problems**: Timeout handling with informative responses ## ๐Ÿ“ˆ Monitoring and Analytics Built-in performance monitoring provides: - **Response Times**: All operations timed automatically - **Cache Performance**: Hit/miss ratios and optimization insights - **Batch Efficiency**: Parallel processing metrics - **Error Rates**: Failure analysis and recovery statistics - **API Usage**: Call frequency and optimization opportunities ## ๐Ÿค Contributing 1. Fork the repository 2. Create a feature branch 3. Make your changes with tests 4. Ensure TypeScript compilation passes 5. Submit a pull request ## ๐Ÿ“„ License MIT License - see LICENSE file for details ## ๐ŸŽฏ Support For issues, feature requests, or questions: - Create GitHub issues for bugs and features - Check existing documentation for common questions - Review the QUICKSTART.md for implementation guidance --- **Built with โค๏ธ for the cocktail community** *Transforming cocktail discovery through intelligent search and high-performance batch processing.*
Deploy Server
A
security โ€“ no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables intelligent cocktail discovery and recipe retrieval from Bar Assistant instances with natural language search, similarity matching, batch processing, and ingredient analysis capabilities.

  1. FeaturesA high-performance Model Context Protocol (MCP) server that provides intelligent cocktail search and recipe retrieval with advanced batch processing capabilities.A Model Context Protocol (MCP) server that integrates with Bar Assistant, enabling natural language interactions with your cocktail database through AI assistants like GitHub Copilot.
    1. Prerequisites- ๐Ÿ” Smart Search: Natural language cocktail discovery with similarity matching- ๐Ÿ“– Recipe Details - Get complete recipes with ingredients and instructions
      1. Installation- ๐Ÿ”„ Similarity Engine: Discover cocktails similar to favorites- ๐Ÿ›’ Shopping Lists - Generate ingredient lists for multiple cocktails
        1. Advanced Performance Features- Bar Assistant API token
      2. Configuration
        1. Environment Variables
        2. Prerequisites
        3. VS Code Configuration
        4. Claude Desktop Configuration
        5. With GitHub Copilot
      3. Getting Your Bar Assistant API Token
        1. Usagenpm start- "Give me recommendations on cocktails like a Negroni"
          1. Finding Similar Cocktails- "Show me the recipe for a Manhattan"
          2. Recipe Lookup
          3. Ingredient-Based Search
          4. Shopping Lists- Cocktail discovery and explorationSearch for cocktails with various filters:
        2. Available Tools- Ingredient-based searches{
          1. smart_search_cocktails- Complex filtering and analysis query?: string, // Name search
          2. Build Only
          3. Clean Build
        3. Performance
          1. Project Structure
            1. Similarity-Based Recommendations### Clean Build

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhdenny/bar-assistant-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server