rfq-sales-dashboard
Provides read-only dashboards and queries for KAMs, zone managers, and VP Sales over an Azure Postgres RFQ pipeline, accessible via MCP/SSE or REST API.
README
rfq-sales-dashboard
Read-only tools over rfq_db (Azure Postgres) for the commercial
distribution agent: role-scoped dashboards for KAMs, zone managers, and VP
Sales, generated from AvoCarbon's live RFQ pipeline. Exposed to ChatGPT two
ways at once, on the same deployed URL.
queries.py- all the SQL / dashboard logic (single source of truth).db.py- read-only asyncpg connection pool.api.py- FastAPI app: REST/OpenAPI routes (for a Custom GPT Action, bearer-token protected) with the MCP-over-SSE app (mcp_sse.py) mounted alongside at/sse(for ChatGPT's native MCP connector / "Nouvelle application").mcp_sse.py- the same 9 tools spoken as MCP over SSE. Unauthenticated by design - see "Security note" below.
Setup (local dev/test)
python -m venv .venv
./.venv/Scripts/python.exe -m pip install -r requirements.txt
Credentials live in .env (git-ignored, never commit it):
DATABASE_URL=postgresql+asyncpg://administrationSTS:...@avo-adb-002.postgres.database.azure.com:5432/rfq_db?ssl=require
API_KEY=... # bearer token required by every route (REST and MCP/SSE)
PUBLIC_HOST=... # optional: hostname ChatGPT will connect to, for MCP transport security (defaults to the deployed Azure host)
The pool in db.py opens every connection with
default_transaction_read_only=on, so nothing here can write to the
database even if a tool's SQL were wrong.
Run locally:
./.venv/Scripts/python.exe -m uvicorn api:app --reload
Deploy
Push to main on GitHub (STS-Engineer/sales_mcp) - the Azure App Service
is connected via Deployment Center / GitHub Actions and redeploys
automatically. DATABASE_URL and API_KEY are set as App Service
application settings (never committed).
Current deployment: https://sales-mcp-b6dka9c3djgqabbc.francecentral-01.azurewebsites.net
Connect to ChatGPT
Option A: Custom GPT + Action (OpenAPI)
In ChatGPT: Create a GPT -> Configure -> Actions -> Create new action.
- Import from URL:
https://sales-mcp-b6dka9c3djgqabbc.francecentral-01.azurewebsites.net/openapi.json - Authentication: API Key -> Auth Type:
Bearer-> paste theAPI_KEYvalue from.env.
Option B: Native MCP connector ("Nouvelle application")
- Connexion: URL du serveur ->
https://sales-mcp-b6dka9c3djgqabbc.francecentral-01.azurewebsites.net/sse - Authentification: none - ChatGPT's connector dialog had no bearer/API-key
option, so
/sseis deliberately unauthenticated (see security note below).
Either way, give the GPT/app instructions describing the three audiences
(KAM, zone manager, VP Sales) and which tool/endpoint to call for each - e.g.
"when a KAM asks for their pipeline, call getKamDashboard/get_kam_dashboard
with their email."
Tools / endpoints
All require Authorization: Bearer <API_KEY>.
list_users/GET /users- resolve KAM/zone-manager/VP emails and names (role?,region?,search?).get_validation_matrix/GET /validation-matrix- KAM/zone/VP auto-approval limits (kEUR) per product line.search_rfqs/GET /rfqs- generic filtered search, case-insensitive (customer?,product_line_acronym?,zone_manager_email?,created_by_email?,phase?,sub_status?,min_value_keur?).get_rfq_detail/GET /rfqs/{rfq_id}- full RFQ record, audit trail, discussion thread, notification log.get_overdue_rfqs/GET /rfqs/overdue- open RFQs stalled past N days (days_threshold,zone_manager_email?,created_by_email?).get_pipeline_funnel/GET /pipeline/funnel- count/value by phase (zone_manager_email?,product_line_acronym?).get_kam_dashboard/GET /dashboards/kam- one KAM's pipeline: by phase, top customers, stale deals, recent activity (email).get_zone_dashboard/GET /dashboards/zone- zone rollup: by KAM, by product line, items nearing the zone approval limit (zone_manager_email).get_vp_sales_dashboard/GET /dashboards/vp-sales- company-wide: funnel, by zone, by product line, top deals, deals needing VP approval, recent losses.
Security note
/sse (and its /messages/ companion path) is unauthenticated -
anyone with the URL can call all 9 read-only tools and see RFQ/customer/
pipeline data. This was a deliberate tradeoff: ChatGPT's "Nouvelle
application" MCP connector dialog offered no bearer/API-key auth option at
the time this was set up. The REST/OpenAPI routes (/users, /rfqs,
/dashboards/*, etc.) still require Authorization: Bearer <API_KEY>. The
database connection itself is read-only regardless (db.py sets
default_transaction_read_only=on), so nothing here can be written to or
deleted - only read. If ChatGPT adds an auth option for custom MCP
connectors later, re-add a bearer check to mcp_sse.py (removed in this
commit - see git history).
Data notes
rfq_dbis the live RFQ/quotation pipeline (33 active RFQs as of 2026-07-17), distinct from theKPI_DB_Finaldatabase behind the existing "AVO-DB" connector (people/KPI/action-plan data) - same Azure Postgres server, different databases.- Commercial hierarchy comes from
users.role(COMMERCIAL= KAM,ZONE_MANAGER,OWNER= VP Sales tier) andvalidation_matrix(n3_kam_limit / n2_zone_limit / n1_vp_limit per product line). - Pipeline value (
pipeline_keur) is read from theto_totalfield insiderfq.rfq_data(jsonb), already expressed in kEUR. kpi_opportunity,kpi_new_business,kpi_annual_targettables exist in the schema but are currently empty (0 rows) - a future data source not yet wired into any tool here.zone_manager_emailis set per-RFQ (not a fixed attribute of a user), so "zone" dashboards are scoped by that field rather than a separate zone table.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.