Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time
Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time

Model Context Protocol (MCP) adalah standar terbuka yang menghubungkan LLM dengan data dan tools eksternal — seperti USB-C untuk AI. Pelajari arsitektur, cara kerja, dan real-world setup saya: 11 MCP server dari MySQL, Firebase, Grafana LGTM, hingga Lighthouse.
"The best interface is one that disappears." — Don Norman
Model Context Protocol (MCP) adalah open protocol buatan Anthropic yang menstandardisasi cara AI terhubung ke data dan tools eksternal. Bayangkan seperti USB-C untuk AI — satu standar koneksi untuk semua.
Sebelum MCP, setiap integrasi AI dengan tools eksternal harus dibuat custom satu per satu. Mau koneksi ke MySQL? Bikin sendiri. Mau akses Firebase? Bikin lagi. Grafana? Satu lagi.
Hasilnya? M x N integration problem — di mana M adalah jumlah AI apps dan N adalah jumlah tools.
graph LR
A[Claude Code] -->|Custom API| D[MySQL]
A -->|Custom API| E[Firebase]
A -->|Custom API| F[Grafana]
B[Gemini CLI] -->|Custom API| D
B -->|Custom API| E
B -->|Custom API| F
C[Cursor] -->|Custom API| D
C -->|Custom API| E
C -->|Custom API| F
style A fill:#7c3aed,color:#fff
style B fill:#4285f4,color:#fff
style C fill:#0ea5e9,color:#fffDengan MCP, masalah M x N menjadi M + N — setiap AI app hanya perlu satu MCP client, dan setiap tool hanya perlu satu MCP server.
graph LR
A[Claude Code] -->|MCP| G[MCP Protocol]
B[Gemini CLI] -->|MCP| G
C[Cursor] -->|MCP| G
G -->|MCP| D[MySQL]
G -->|MCP| E[Firebase]
G -->|MCP| F[Grafana LGTM]
G -->|MCP| H[Lighthouse]
style A fill:#7c3aed,color:#fff
style B fill:#4285f4,color:#fff
style C fill:#0ea5e9,color:#fff
style G fill:#f59e0b,color:#000MCP mengikuti arsitektur client-server yang terinspirasi dari Language Server Protocol (LSP). Tiga komponen utamanya:
Aplikasi AI yang mengoordinasi satu atau lebih MCP client. Contoh: Claude Desktop, Cursor, Claude Code.
Komponen yang menjaga koneksi ke MCP server. Setiap client punya koneksi 1:1 dengan satu server.
Program yang menyediakan konteks dan kemampuan ke AI. Bisa jalan lokal (stdio) atau remote (HTTP/SSE).
graph TB
subgraph Host["MCP Host (Gemini CLI / Claude Code)"]
C1[MCP Client 1]
C2[MCP Client 2]
C3[MCP Client 3]
C4[MCP Client 4]
C5[MCP Client 5]
end
C1 <-->|stdio| S1[Firebase MCP]
C2 <-->|stdio| S2[MySQL dbhub]
C3 <-->|stdio| S3[LGTM Stack]
C4 <-->|SSE| S4[Context7]
C5 <-->|stdio| S5[Lighthouse]
S1 <--> FB[(Firebase)]
S2 <--> DB[(MySQL)]
S3 <--> GR[(Grafana/Loki/Tempo)]
S4 <--> DOCS[(Documentation)]
S5 <--> WEB[(Web Pages)]
style Host fill:#1e1b4b,color:#fff
style S1 fill:#059669,color:#fff
style S2 fill:#059669,color:#fff
style S3 fill:#059669,color:#fff
style S4 fill:#d97706,color:#fff
style S5 fill:#059669,color:#fffMCP server mengekspos tiga jenis kemampuan:
| Property | Type | Description |
|---|---|---|
| Tools | Function | Fungsi yang bisa dipanggil LLM untuk melakukan aksi. Contoh: query database, create issue, send message. |
| Resources | Data Source | Sumber data yang bisa diakses LLM (read-only). Mirip GET endpoint di REST API. Contoh: file content, database schema. |
| Prompts | Template | Template yang sudah dioptimasi untuk menggunakan tools dan resources secara efektif. |
| MCP Primitive | Analogi REST API | Contoh |
|---|---|---|
| Tools | POST /action |
Kirim pesan Slack, buat GitHub issue |
| Resources | GET /data |
Baca file, lihat schema database |
| Prompts | Swagger/OpenAPI docs | Template cara optimal gunakan tools |
MCP mendukung dua metode transport:
Standard I/O — untuk MCP server yang jalan di mesin yang sama.
{
"mcpServers": {
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
},
"mysql": {
"command": "npx",
"args": ["-y", "@bytebase/dbhub", "--transport", "stdio",
"--dsn", "mysql://user:[email protected]:3306/mydb"]
},
"lighthouse": {
"command": "npx",
"args": ["lighthouse-mcp"]
}
}
}HTTP + Server-Sent Events — untuk MCP server yang jalan remote.
{
"mcpServers": {
"context7": {
"serverUrl": "https://mcp.context7.com/mcp"
},
"mintlify": {
"serverUrl": "https://docs.yourdomain.com/mcp"
},
"stitch": {
"serverUrl": "https://stitch.googleapis.com/mcp",
"headers": {
"X-Goog-Api-Key": "YOUR_API_KEY"
}
}
}
}Client mengirim initialize request dengan protocol version dan capabilities.
Server merespons dengan capabilities yang didukung.
// Client -> Server
{
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": { "roots": { "listChanged": true } }
}
}Client meminta daftar tools, resources, dan prompts yang tersedia.
// Client -> Server
{ "method": "tools/list" }
// Server -> Client
{
"tools": [
{
"name": "query_database",
"description": "Execute SQL query",
"inputSchema": { "type": "object", "properties": { "sql": { "type": "string" } } }
}
]
}LLM memanggil tools berdasarkan konteks percakapan.
// Client -> Server
{
"method": "tools/call",
"params": {
"name": "query_database",
"arguments": { "sql": "SELECT COUNT(*) FROM users WHERE active = true" }
}
}Berikut contoh minimal MCP server menggunakan TypeScript dan Python:
npm init -y
npm install @modelcontextprotocol/sdk zodimport { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "weather-server",
version: "1.0.0",
});
// Definisikan tool
server.tool(
"get_weather",
"Get current weather for a city",
{ city: z.string().describe("City name") },
async ({ city }) => {
// Panggil weather API
const weather = await fetch(
`https://api.weather.example.com/${city}`
).then((r) => r.json());
return {
content: [
{
type: "text",
text: `Weather in ${city}: ${weather.temp}°C, ${weather.condition}`,
},
],
};
}
);
// Jalankan server via stdio
const transport = new StdioServerTransport();
await server.connect(transport);pip install mcp[cli] httpxfrom mcp.server.fastmcp import FastMCP
import httpx
mcp = FastMCP("weather-server")
@mcp.tool()
async def get_weather(city: str) -> str:
"""Get current weather for a city."""
async with httpx.AsyncClient() as client:
response = await client.get(
f"https://api.weather.example.com/{city}"
)
data = response.json()
return f"Weather in {city}: {data['temp']}°C, {data['condition']}"
if __name__ == "__main__":
mcp.run(transport="stdio")Untuk server berbasis stdio, jangan gunakan console.log() karena akan
menulis ke stdout dan merusak JSON-RPC messages. Gunakan console.error()
atau logging library yang menulis ke stderr.
Ini bukan teori — berikut konfigurasi MCP yang saya pakai sehari-hari di Gemini CLI dan Claude Code:
graph TB
subgraph STDIO["stdio (Local)"]
S1[Firebase]
S2[MySQL - dbhub]
S3[LGTM - Grafana Stack]
S4[Memory]
S5[Sequential Thinking]
S6[Serena - Code Understanding]
S7[Lighthouse]
S8[Word Document]
end
subgraph REMOTE["SSE / Remote"]
R1[Mintlify Docs]
R2[Context7]
R3[Google Stitch]
end
style STDIO fill:#1e3a5f,color:#fff
style REMOTE fill:#5f1e3a,color:#fffMenggunakan firebase-tools official MCP. AI bisa langsung deploy,
manage Firestore rules, inspect Auth users, dan Cloud Functions — tanpa
buka Firebase Console.
{
"firebase": {
"command": "npx",
"args": ["-y", "firebase-tools@latest", "mcp"]
}
}Pakai @bytebase/dbhub untuk akses MySQL. AI bisa inspect schema,
jalankan query, dan analisis data langsung dari percakapan.
{
"mysql": {
"command": "npx",
"args": ["-y", "@bytebase/dbhub", "--transport", "stdio",
"--dsn", "mysql://user:[email protected]:3306/mydb"]
}
}MCP server custom-built untuk observability stack. AI bisa query logs dari Loki, trace dari Tempo, metrics dari Mimir, dan visualisasi dari Grafana — semua dari satu percakapan.
{
"lgtm": {
"command": "node",
"args": ["/path/to/mcp-lgtm/dist/index.js"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"LOKI_URL": "http://localhost:3100",
"TEMPO_URL": "http://localhost:3200",
"MIMIR_URL": "http://localhost:9009"
}
}
}Persistent knowledge graph. AI menyimpan konteks penting ke file JSONL, sehingga sesi berikutnya tidak mulai dari nol.
{
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"MEMORY_FILE_PATH": "/path/to/memory.jsonl"
}
}
}Context7 menyediakan konteks dokumentasi library terbaru langsung ke AI, jadi tidak perlu khawatir knowledge cutoff. Mintlify menghubungkan dokumentasi API yang kamu host sendiri.
{
"context7": {
"serverUrl": "https://mcp.context7.com/mcp"
},
"mintlify": {
"serverUrl": "https://docs.yourdomain.com/mcp"
}
}AI bisa menjalankan Lighthouse audit dan langsung menganalisis hasilnya. Performance score, accessibility issues, SEO recommendations — semua dalam satu percakapan.
{
"lighthouse": {
"command": "npx",
"args": ["lighthouse-mcp"]
}
}Sequential Thinking memaksa AI memecah reasoning jadi langkah-langkah terstruktur. Serena memberikan deep code understanding — AI bisa navigasi codebase dengan konteks yang lebih kaya dari sekadar grep.
{
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"serena": {
"command": "uvx",
"args": ["--from", "git+https://github.com/oraios/serena",
"serena", "start-mcp-server"]
}
}Google Stitch menghubungkan ke ekosistem Google API. Word Document Server memungkinkan AI membuat dan mengedit dokumen Word — berguna untuk generate laporan otomatis.
{
"stitch": {
"serverUrl": "https://stitch.googleapis.com/mcp",
"headers": { "X-Goog-Api-Key": "YOUR_KEY" }
},
"word-document-server": {
"command": "uvx",
"args": ["--from", "office-word-mcp-server", "word_mcp_server"]
}
}Perhatikan pola-nya: ada 3 tipe transport yang saya pakai:
Ketiganya bisa jalan bersamaan di satu AI host. Itulah kekuatan standar MCP.
MCP bukan hanya standar Anthropic — ini sudah jadi industri standard:
| Company | Adopsi |
|---|---|
| Anthropic | Creator, Claude Desktop & Claude Code native support |
| OpenAI | Adopsi resmi Maret 2025, terintegrasi di ChatGPT Desktop |
| Cursor | IDE AI pertama yang full support MCP |
| Block | Goose AI agent dengan MCP apps |
| Linux Foundation | MCP didonasikan ke Agentic AI Foundation (AAIF) |
Per Desember 2025, MCP SDK sudah mencapai 97 juta monthly downloads di semua bahasa pemrograman. Ini bukan eksperimen — ini production-grade protocol.
Anda ingin AI mengakses data/tools eksternal secara standar, reusable, dan aman. Contoh: coding assistant yang bisa query MySQL, deploy Firebase, dan audit Lighthouse sekaligus.
Anda hanya butuh simple API call satu kali, atau data sudah bisa di-embed langsung ke prompt tanpa perlu real-time access.
MCP bukan berarti "buka semua akses". Beberapa prinsip keamanan penting:
MCP mengubah cara kita mengintegrasikan AI dengan dunia nyata. Dari yang sebelumnya harus membuat custom integration untuk setiap kombinasi AI app dan tool, sekarang cukup satu standar protokol.
Sebagai engineer, ini adalah momen yang mirip dengan kemunculan REST API — standar yang membuat ekosistem berkembang jauh lebih cepat karena semua berbicara dalam bahasa yang sama.
MCP bukan tentang membuat AI lebih pintar — tapi membuat AI lebih berguna.
Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time

Real-time Order Tracking Q-Commerce: Driver Bergerak di Peta Live


Promo & Voucher Engine Q-Commerce: Rule Engine Anti-Abuse
