Implements all 12 MCP tools from CONCEPT document: - search_transceivers: Full-text + spec filter search with pricing - check_compatibility: Switch ↔ transceiver compatibility lookup - get_pricing: Current prices + 30-day history across all vendors - compare_prices: Multi-vendor price comparison with savings analysis - get_competitor_stock: Live competitor stock monitoring (sales opportunities) - suggest_alternatives: Similar spec alternatives optimized for price/availability - get_templates: FlexBox coding and switch config template finder - search_knowledge_base: Troubleshooting FAQ search (PostgreSQL full-text) - search_manuals: Switch manual and datasheet search - get_hype_cycle: Norton-Bass adoption forecast + Gartner phase classification - get_market_news: Aggregated news with relevance scoring - generate_blog_draft: Data-driven blog drafts saved to blog_drafts table Transport: stdio (MCP protocol 2024-11-05) Config: .mcp.json for Claude Code integration Verified: all 12 tools registered, search_transceivers returns DB results
16 lines
492 B
TypeScript
16 lines
492 B
TypeScript
import { Pool } from "pg";
|
|
import { config } from "dotenv";
|
|
import { join } from "path";
|
|
|
|
config({ path: join(__dirname, "..", "..", "..", ".env") });
|
|
|
|
export const pool = new Pool({
|
|
host: process.env.POSTGRES_HOST || "localhost",
|
|
port: parseInt(process.env.POSTGRES_PORT || "5433"),
|
|
database: process.env.POSTGRES_DB || "transceiver_db",
|
|
user: process.env.POSTGRES_USER || "tip",
|
|
password: process.env.POSTGRES_PASSWORD || "tip_dev_2026",
|
|
max: 5,
|
|
idleTimeoutMillis: 30000,
|
|
});
|