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
| Property | Value |
|---|---|
| Protocol | MCP Streamable HTTP |
| Transport | HTTP POST with SSE responses |
| Authentication | X-API-Key header |
| Content-Type | application/json |
| Accept | application/json, text/event-stream |
Server URL
https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-mcpConnecting from Claude Desktop
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query (natural language) |
category | string | No | Category name or slug to filter |
region | string | No | Region name or slug to filter |
limit | integer | No | Max results (default: 10) |
get_business_detail
Get comprehensive details about a specific business including contact info, certifications, and performance metrics.
| Parameter | Type | Required | Description |
|---|---|---|---|
business_id | string | Yes* | Business UUID (*one of id or slug required) |
slug | string | Yes* | Business URL slug |
get_product_catalog
Retrieve the product catalog for a specific supplier.
| Parameter | Type | Required | Description |
|---|---|---|---|
business_id | string | Yes | Business UUID |
limit | integer | No | Max products (default: 20) |
submit_rfq
Submit a Request for Quote to the directory. Creates an RFQ with line items for supplier matching.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | RFQ title |
buyer_name | string | Yes | Buyer contact name |
buyer_email | string | Yes | Buyer email |
items | array | Yes | Array of {name, quantity, unit, description, target_price} |
delivery_location | string | No | Delivery destination |
delivery_date | string | No | Required delivery date (ISO format) |
priority | string | No | low, normal, high, or urgent |
get_rfq_status
Check the status of a previously submitted RFQ including any quotes received.
| Parameter | Type | Required | Description |
|---|---|---|---|
rfq_id | string | Yes | RFQ UUID |
find_suppliers_for_items
Given a list of items, find the best matching suppliers for each item using semantic search.
| Parameter | Type | Required | Description |
|---|---|---|---|
items | string[] | Yes | Array of item descriptions (e.g. ["mahogany desk", "ergonomic chair"]) |
region | string | No | Preferred region |
get_category_tree
Get the full category hierarchy to understand available business categories.
| Parameter | Type | Required | Description |
|---|---|---|---|
parent_id | string | No | Filter 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
business_ids | string[] | Yes | Array of 2-5 business UUIDs to compare |
Programmatic MCP Client
You can also connect to the MCP server programmatically from your own backend:
// 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.