enterprise-core
README.md
๏ปฟ# Enterprise MCP Suite
[](https://modelcontextprotocol.io)
[](https://github.com/langchain-ai/langgraph)
[]()
[]()
[]()
> **Enterprise-Grade AI Agent Security & Integration Infrastructure**
> Connecting LLMs to PostgreSQL, GitHub, Mock ERP, and Slack via Anthropic's Model Context Protocol (MCP) standard with zero-trust AST SQL inspection and Human-in-the-Loop safeguards.
---
## ๐ Commercial & Client Demonstration Assets
Everything you need to pitch, demonstrate, and deploy this platform for enterprise clients:
- ๐ฎ **Live Interactive Showcase:** `python demo_showcase.py` (Single-command menu covering all live client scenarios)
- ๐ **[Executive Briefing & Pitch Deck](COMMERCIAL_DECK.md):** ROI models, architecture comparison, enterprise pricing tiers
- ๐ข **[Sales & Marketing Outreach Kit](SALES_PITCH_KIT.md):** LinkedIn copy, CTO cold emails, discovery scripts, objection handling
- ๐งช **[End-to-End QA Test Guide](TEST_GUIDE.md):** Complete step-by-step verification manual (12/12 automated tests)
---
## Real-World Scenario: What This Platform Solves
Imagine an alert fires at 02:45 AM:
**"Payment gateway intermittent failure โ checkout transactions stalling!"**
### Traditional Manual SRE Workflow (45โ60 Minutes):
1. An on-call engineer wakes up and connects via VPN.
2. Manually parses noisy PostgreSQL logs across shards (20 mins).
3. Queries the ERP database to identify impacted high-value customers (15 mins).
4. Correlates GitHub commits or issue trackers for recent deployments (10 mins).
5. Drafts and broadcasts a high-priority incident debrief on Slack (10 mins).
### Autonomous Enterprise MCP Workflow (10โ12 Seconds):
You supply a natural language goal:
```bash
python run_investigation.py "Investigate incident INC-902 and quantify revenue exposure."
```
**The Agent Autonomously:**
1. Formulates an execution plan via OpenAI GPT-4o.
2. Executes safe, read-only SQL via AST-validated `db_query_tool`.
3. Identifies the root cause: HTTP 502 Bad Gateway in `payment-gateway`.
4. Discovers the affected VIP customer (`Priya Nair / InfraStack Solutions Pvt.`).
5. Pinpoints the exact failed order (`$62,400 USD`).
6. Generates a structured executive debrief with source citations and an audit trail.
---
## System Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Enterprise MCP Suite โ
โ โ
โ โโโโโโโโโโโโโโโ stdio / SSE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Claude โโโโโโโโโโโโโโโโโโโโโโ โ FastMCP Server โโ
โ โ Desktop โ โ (server/mcp_server.py) โโ
โ โ / Cursor โ โ โโ
โ โโโโโโโโโโโโโโโ โ โโโโโโโโ โโโโโโโโโโโโโโ โโ
โ โ โTools โ โ Resources โ โโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโ โโโโโโโโโโโโโโ โโ
โ โ LangGraph Agent (OpenAI GPT-4o)โ โ โโโโโโโโโโโโโโโโโโโโโโโ โโ
โ โ โ โ โ Prompts โ โโ
โ โ Planner โ MCPExecutor โ HITL โ โ โโโโโโโโโโโโโโโโโโโโโโโ โโ
โ โ โ Synthesizer โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โผ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โPostgreSQLโ โ GitHub โ โ Mock ERP โ โ Slack โ โ
โ โ (Docker) โ โ API โ โ REST API โ โ Webhooks โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### Security Pipeline
```
Agent Tool Request โโโบ SafeQueryInspector (sqlglot AST) โโโบ Blocked if DROP/DELETE
โ (0 ms, pre-connection)
โผ
Connection Pool โโโบ Read-Only PostgreSQL
โ
[Mutating Tools] โโโบ HITL Guard โโโบ Awaits approval_token='APPROVED'
```
---
## Project Structure
```
enterprise-mcp-suite/
โโโ docker-compose.yml # PostgreSQL 16 Alpine container with healthcheck
โโโ init-db/
โ โโโ 01_seed_enterprise.sql # 4 schemas + 30+ enterprise seed rows (INC-902 scenario)
โโโ requirements.txt # Pinned production dependencies
โโโ .env.example # Comprehensive environment template
โโโ config.py # Pydantic v2 typed settings with SecretStr protection
โโโ demo_showcase.py # Interactive CLI client presentation panel
โโโ run_investigation.py # Turnkey CLI autonomous investigation runner
โโโ COMMERCIAL_DECK.md # Executive briefing, ROI calculations, commercial tiers
โโโ SALES_PITCH_KIT.md # Marketing kit, LinkedIn posts, CTO cold email templates
โโโ TEST_GUIDE.md # 7-group QA and testing manual
โโโ server/
โ โโโ security.py # AST SQL validator + HITL decorator + sanitizers
โ โโโ tools/
โ โ โโโ db_tools.py # PostgreSQL tools (psycopg connection pool)
โ โ โโโ github_tools.py # GitHub REST API tools
โ โ โโโ erp_tools.py # ERP tools (with in-memory mock fallback)
โ โ โโโ notification_tools.py # Slack Block Kit notification tools
โ โโโ resources/
โ โ โโโ schema_resources.py # Dynamic postgres://schema/* and system://health
โ โโโ prompts/
โ โ โโโ enterprise_prompts.py # System incident, customer 360, security audit prompts
โ โโโ mcp_server.py # FastMCP 2.x server application entry point
โโโ client/
โ โโโ mcp_client.py # Async stdio/SSE MCP client wrapper
โ โโโ agent_workflow.py # LangGraph 4-node autonomous state machine
โโโ test_end_to_end.py # 12-test automated verification suite
โโโ claude_desktop_config.json # Native Claude Desktop configuration
โโโ README.md # Master platform documentation
```
---
## Quick Start
### 1. Prerequisites
- Python 3.11+
- Docker & Docker Compose running locally
- OpenAI API Key (`sk-proj-...` from platform.openai.com)
### 2. Environment Setup
```powershell
# Navigate to workspace
cd C:\Users\HP\.gemini\antigravity\scratch\enterprise-mcp-suite
# Activate virtual environment
.venv\Scripts\activate
# Install production dependencies
pip install -r requirements.txt
# Create your .env file
copy .env.example .env
```
Open `.env` and configure your `OPENAI_API_KEY`:
```env
OPENAI_API_KEY=sk-proj-your-actual-key-here
```
### 3. Start Database Infrastructure
```powershell
docker-compose up -d
# Verify healthy status (wait ~20 seconds)
docker-compose ps
```
### 4. Run the Automated Verification Suite
```powershell
python test_end_to_end.py
```
*Expected result:* **`Total: 12 | 12 passed | 0 failed`**
### 5. Run an Autonomous Investigation
```powershell
# Single-command default investigation (INC-902):
python run_investigation.py
# Or provide a custom investigation prompt:
python run_investigation.py "Find all enterprise customers with failed transactions."
```
The report is displayed on the console and automatically saved to `latest_investigation_report.md`.
### 6. Launch the Interactive Client Showcase
```powershell
python demo_showcase.py
```
Access all 5 demonstration scenarios live through an interactive terminal interface.
---
## MCP Tools Reference
| Tool Name | Description | Requires HITL |
|---|---|:---:|
| `db_query_tool` | Execute safe SQL query (read-only by default) | No |
| `db_list_tables_tool` | List all user tables in enterprise catalogue | No |
| `github_triage_issue_tool` | Triage and annotate GitHub issues | Comment only |
| `github_list_open_issues_tool` | List open repository issues | No |
| `github_get_commit_status_tool` | Fetch CI/CD pipeline commit status | No |
| `erp_get_order_tool` | Retrieve ERP order details and fulfillment history | No |
| `erp_list_customer_orders_tool` | List customer order portfolio | No |
| `erp_dispatch_order_tool` | Trigger warehouse order dispatch | **Yes** |
| `slack_send_alert_tool` | Send Slack notification (Block Kit formatted) | Error/Critical |
## MCP Resources Reference
| URI Pattern | Description |
|---|---|
| `postgres://schema/{table_name}` | Real-time DDL table schema from PostgreSQL catalogue |
| `system://health` | Live connection pool telemetry, service latency, server status |
## MCP Prompts Reference
| Prompt Name | Description |
|---|---|
| `triage_system_incident` | End-to-end SRE incident triage workflow |
| `customer_360` | 360-degree account and revenue intelligence dossier |
| `security_audit` | Security and vulnerability audit workflow |
---
## Claude Desktop Integration
To register this server natively with Claude Desktop:
1. Copy the contents of [`claude_desktop_config.json`](claude_desktop_config.json).
2. Paste into your Claude Desktop config file:
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
3. Update `OPENAI_API_KEY` and working directory paths.
4. Restart Claude Desktop. The server will appear under the **enterprise-core** hammer icon.
---
## Security Architecture
### Pre-Connection AST Inspection
Traditional regex validation is fragile and vulnerable to dialect obfuscation. The `SafeQueryInspector` parses incoming queries into an Abstract Syntax Tree (AST) using `sqlglot`. Statements containing `Drop`, `Delete`, `TruncateTable`, `Update`, `Insert`, `Create`, or `Alter` are intercepted and rejected **prior to opening any database socket**.
### Human-in-the-Loop (HITL) Enforcement
Mutating operations utilize the `@requires_hitl_approval()` decorator. Any invocation lacking `approval_token='APPROVED'` raises a structured `HITLRequiredError`. In the LangGraph agent workflow, execution pauses at the `hitl_guard` node, prompting a human supervisor before re-routing.
---
## License
Enterprise Proprietary / Apache 2.0 Dual License.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues