Back

    Buyamia Directory API

    v1.0

    MCP Server

    The Buyamia Directory MCP (Model Context Protocol) server allows AI assistants like Claude, ChatGPT, and custom agents to interact with the directory using a standardized tool-calling interface. This is the recommended integration method for AI-native procurement systems.

    Protocol & Connection

    PropertyValue
    ProtocolMCP Streamable HTTP
    TransportHTTP POST with SSE responses
    AuthenticationX-API-Key header
    Content-Typeapplication/json
    Acceptapplication/json, text/event-stream

    Server URL

    https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-mcp

    Connecting from Claude Desktop

    claude_desktop_config.jsonjson
    {
      "mcpServers": {
        "buyamia-directory": {
          "url": "https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-mcp",
          "headers": {
            "X-API-Key": "your-api-key-here"
          }
        }
      }
    }

    For Claude Desktop, add the config above to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows).

    Available Tools

    The MCP server exposes 8 tools that AI agents can call:

    search_suppliers

    Search for suppliers using natural language. Uses semantic (AI) search for best results.

    ParameterTypeRequiredDescription
    querystringYesSearch query (natural language)
    categorystringNoCategory name or slug to filter
    regionstringNoRegion name or slug to filter
    limitintegerNoMax results (default: 10)

    get_business_detail

    Get comprehensive details about a specific business including contact info, certifications, and performance metrics.

    ParameterTypeRequiredDescription
    business_idstringYes*Business UUID (*one of id or slug required)
    slugstringYes*Business URL slug

    get_product_catalog

    Retrieve the product catalog for a specific supplier.

    ParameterTypeRequiredDescription
    business_idstringYesBusiness UUID
    limitintegerNoMax products (default: 20)

    submit_rfq

    Submit a Request for Quote to the directory. Creates an RFQ with line items for supplier matching.

    ParameterTypeRequiredDescription
    titlestringYesRFQ title
    buyer_namestringYesBuyer contact name
    buyer_emailstringYesBuyer email
    itemsarrayYesArray of {name, quantity, unit, description, target_price}
    delivery_locationstringNoDelivery destination
    delivery_datestringNoRequired delivery date (ISO format)
    prioritystringNolow, normal, high, or urgent

    get_rfq_status

    Check the status of a previously submitted RFQ including any quotes received.

    ParameterTypeRequiredDescription
    rfq_idstringYesRFQ UUID

    find_suppliers_for_items

    Given a list of items, find the best matching suppliers for each item using semantic search.

    ParameterTypeRequiredDescription
    itemsstring[]YesArray of item descriptions (e.g. ["mahogany desk", "ergonomic chair"])
    regionstringNoPreferred region

    get_category_tree

    Get the full category hierarchy to understand available business categories.

    ParameterTypeRequiredDescription
    parent_idstringNoFilter to children of a specific category

    compare_suppliers

    Compare multiple suppliers side-by-side on key metrics including quality scores, delivery reliability, certifications, and pricing.

    ParameterTypeRequiredDescription
    business_idsstring[]YesArray of 2-5 business UUIDs to compare

    Programmatic MCP Client

    You can also connect to the MCP server programmatically from your own backend:

    Node.js MCP Clienttypescript
    // Initialize MCP session
    const initResponse = await fetch(MCP_URL, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json, text/event-stream',
        'X-API-Key': API_KEY,
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'initialize',
        params: {
          protocolVersion: '2025-03-26',
          capabilities: {},
          clientInfo: { name: 'my-procurement-app', version: '1.0.0' },
        },
      }),
    });
    
    // Call a tool
    const toolResponse = await fetch(MCP_URL, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json, text/event-stream',
        'X-API-Key': API_KEY,
        'Mcp-Session-Id': sessionId,
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 2,
        method: 'tools/call',
        params: {
          name: 'search_suppliers',
          arguments: { query: 'organic food supplier', region: 'bali', limit: 5 },
        },
      }),
    });

    The Accept: application/json, text/event-stream header is required by the MCP spec. Without it, the server returns a 406 Not Acceptable error.

    Last updated on March 15, 2026