enterprise-mcp-gateway
This server is an enterprise MCP gateway that exposes CRM capabilities to AI agents with security, redaction, and auditing.
List and filter customer accounts (
listCustomers)Retrieve full customer details including address, tax ID, and email (
getCustomerDetails)View billing history and payment methods (
getBillingHistory)Query support tickets by customer or priority (
listSupportTickets)Open new support tickets (
createSupportTicket)Enforces role-based access control (RBAC) for tool visibility and execution
Redacts PII, secrets, and sensitive keys from tool responses in real time
Emits structured JSON audit logs with hashed parameters and latency metrics
Supports both stdio and HTTP SSE transports
Dynamically registers tools from OpenAPI/Swagger specs
Allows AI agents to connect to and invoke APIs of Java/Spring Boot enterprise backends through the gateway.
Dynamically creates MCP tools from OpenAPI/Swagger specifications, enabling AI agents to call any compatible backend API.
Enterprise MCP Gateway
๐ Key Features
โก Blazing Fast & Lightweight: Single static Go binary (<25MB resident memory footprint, sub-millisecond routing overhead, zero external runtime dependencies).
๐ก๏ธ High-Performance PII & Secret Redaction: Real-time stream and JSON-key masking (Credit Cards with Luhn checksum validation, SSNs, emails, phone numbers, AWS keys, JWTs, GitHub PATs, and custom regex rules) before tool responses reach LLMs.
๐ Role-Based Tool Governance (RBAC): Token-to-role resolution that limits tool visibility in
tools/listand enforces execution permissions duringtools/call.๐ Dynamic OpenAPI / Swagger Connector: Instantly registers validated MCP tools directly from OpenAPI 3.0/Swagger YAML or JSON specs without writing backend glue code.
๐ Structured JSON Audit Logging: Emits tamper-resistant, structured JSON logs containing caller identity, tool invoked, SHA-256 hashed parameters, execution latency, and PII redaction metrics.
๐ Dual Transport Support: Fully compliant JSON-RPC 2.0 engine supporting both standard
stdio(for Claude Desktop / Cursor) and HTTP Server-Sent Events (SSE) for distributed microservices.
Related MCP server: Nervora
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Client (Claude / Cursor / Agent) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ JSON-RPC 2.0 (stdio or SSE)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Enterprise MCP Gateway (Single Go Binary) โ
โ โ
โ 1. Transport Layer (pkg/mcp/transport) โ
โ - Stdio & HTTP-SSE Transceivers โ
โ 2. Security & Auth Guard (pkg/governance/rbac) โ
โ - Token authentication & least-privilege filtering โ
โ 3. Router & Tool Registry (pkg/mcp/protocol) โ
โ - JSON-RPC 2.0 & MCP handshake engine โ
โ 4. Backend Dispatcher (pkg/connector/openapi) โ
โ - Dynamic OpenAPI 3.0 path/query/body mapper โ
โ 5. Sanitization Engine (pkg/sanitizer/pii) โ
โ - Zero-alloc PII, secret, & JSON key redactor โ
โ 6. Structured Audit Logger (pkg/audit) โ
โ - Cryptographic JSON event trail for SIEM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Authorized & Sanitized Calls
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Internal Enterprise Services (Java / Go / DBs) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ฆ Quick Start
1. Build from Source
Ensure you have Go 1.24+ installed:
# Clone the repository
git clone https://github.com/BenjaminJ/enterprise-mcp-gateway.git
cd enterprise-mcp-gateway
# Build gateway and mock backend server
go build -o bin/mcp-gateway ./cmd/gateway
go build -o bin/mockserver ./cmd/mockserver2. Run the Mock Enterprise Backend (Terminal 1)
./bin/mockserver --port 80813. Run the Gateway with Sample Config (Terminal 2)
Option A: Stdio Mode (Default)
./bin/mcp-gateway --config ./examples/config.yaml --token "agent-support-key"Option B: HTTP Server-Sent Events (SSE) Mode
./bin/mcp-gateway --config ./examples/config.yaml --transport sse --port 80804. Stream Live Audit Logs in Real-Time (Terminal 3)
Follow and format structured audit records as tools execute:
PowerShell (Windows):
Get-Content -Path .\audit.log -Wait -Tail 10 | ForEach-Object {
if ($_ -match '^\s*\{') {
$e = $_ | ConvertFrom-Json
$time = ([DateTime]$e.timestamp).ToLocalTime().ToString("HH:mm:ss")
$statusColor = if ($e.status -eq "SUCCESS") { "Green" } else { "Red" }
$redactColor = if ($e.pii_redacted_count -gt 0) { "Yellow" } else { "DarkGray" }
Write-Host "[$time] " -NoNewline -ForegroundColor DarkGray
Write-Host "[$($e.status)] " -NoNewline -ForegroundColor $statusColor
Write-Host "$($e.tool) " -NoNewline -ForegroundColor Cyan
Write-Host "(Role: $($e.role), Latency: $($e.duration_ms)ms, Redacted: $($e.pii_redacted_count))" -ForegroundColor $redactColor
}
}Bash / Linux / macOS (jq):
tail -f audit.log | jq -c '{time: .timestamp, status: .status, tool: .tool, role: .role, latency_ms: .duration_ms, redacted: .pii_redacted_count}'๐ Verification with Anthropic Official MCP Inspector
You can test and inspect the gateway using Anthropic's official @modelcontextprotocol/inspector:
Test via Stdio:
npx @modelcontextprotocol/inspector ./bin/mcp-gateway --config ./examples/config.yaml --token agent-support-keyTest via SSE:
Start the gateway in SSE mode:
./bin/mcp-gateway --config ./examples/config.yaml --transport sse --port 8080Open the inspector pointing to the SSE endpoint:
npx @modelcontextprotocol/inspector http://localhost:8080/sse
๐ป Claude Desktop Integration
To connect Claude Desktop to your enterprise systems through enterprise-mcp-gateway:
Open your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add
enterprise-mcp-gatewayto themcpServersobject:
{
"mcpServers": {
"enterprise-gateway": {
"command": "/absolute/path/to/enterprise-mcp-gateway/bin/mcp-gateway",
"args": [
"--config",
"/absolute/path/to/enterprise-mcp-gateway/examples/config.yaml",
"--token",
"agent-support-key"
]
}
}
}Restart Claude Desktop. The enterprise tools (
listCustomers,getCustomerDetails,createSupportTicket, etc.) will appear with a hammer icon in the prompt interface.
โ๏ธ Configuration Guide (config.yaml)
server:
name: "enterprise-mcp-gateway"
version: "1.0.0"
transport: "stdio" # "stdio" or "sse"
host: "0.0.0.0"
port: 8080
governance:
enabled: true
default_role: "support_agent"
tokens:
"agent-ro-secret": "readonly_agent"
"agent-support-secret": "support_agent"
"admin-master-secret": "admin"
roles:
readonly_agent:
allowed_tools:
- "list*"
- "get*"
support_agent:
allowed_tools:
- "list*"
- "get*"
- "createSupportTicket"
admin:
allowed_tools:
- "*"
sanitizer:
enabled: true
mask_card_numbers: true # Luhn-verified Credit Card masking
mask_ssn: true # US SSN masking
mask_secrets: true # Private keys, AWS keys, JWTs, PATs
sensitive_keys:
- "password"
- "secret"
- "token"
- "apiKey"
- "ssn"
- "creditCard"
custom_regex:
- name: "Internal Employee ID"
pattern: "\\bEMP-[0-9]{6}\\b"
replacement: "[REDACTED-EMP-ID]"
audit:
enabled: true
log_path: "stdout" # "stdout" or path to file e.g. "/var/log/mcp-audit.log"
hash_inputs: true # SHA-256 hashes tool arguments for compliance
connectors:
- name: "enterprise-crm"
type: "openapi"
spec_file: "./examples/crm-openapi.yaml"
base_url: "http://localhost:8081"
headers:
Authorization: "Bearer backend-secret-token"
X-Gateway-Source: "enterprise-mcp-gateway"
timeout_seconds: 15๐งช Testing
Run all unit and end-to-end integration tests:
# Run all unit and integration tests
go test -v ./...
# Run tests with the Go race detector enabled
go test -race ./...๐ณ Docker Deployment
# Build lightweight Docker image
docker build -t enterprise-mcp-gateway:latest .
# Run container in SSE mode
docker run -d -p 8080:8080 -p 8081:8081 enterprise-mcp-gateway:latest --transport sse --port 8080๐ License
MIT License.
Available Tools
5 toolscreateSupportTicketA
Open and route a new customer support incident ticket - Creates a new support incident or customer inquiry ticket in the CRM queue.
[Usage Guidelines]
When to use: Use this tool to escalate customer technical issues, report system bugs, or file service requests that require support team intervention.
When NOT to use: Do NOT use this tool before checking if a similar ticket already exists; use 'listSupportTickets' first to prevent duplicate tickets. Do NOT use to reset passwords; use 'adminResetPassword' instead.
Prerequisites: Requires a confirmed customerId obtained from 'listCustomers' or 'getCustomerDetails'.
[Behavior]
Operation: Mutating and non-idempotent. Each invocation assigns a new unique ticket ID and dispatches notifications to support engineers.
Side effects: Creates a persistent ticket record and routes to on-call queues.
Authorization: Requires 'support_agent' or 'admin' role ('readonly_agent' tokens are rejected with 403).
[Parameters & Validation]
'customerId' (string, required): Customer identifier string (e.g. 'cust-001') the ticket is filed on behalf of.
'subject' (string, required): Concise summary line of the incident (10 to 120 characters).
'description' (string, required): Detailed problem statement, reproduction steps, or error messages.
'priority' (string, optional): Urgency level: 'low', 'normal', 'high', or 'urgent'. Defaults to 'normal' if omitted.
[Returns]
Returns HTTP 201 Created with JSON object: ticketId (e.g. 'tick-902'), customerId, subject, priority, status ('open'), and createdAt timestamp.
Inputs: subject (required), customerId (required), description (required), priority.
getBillingHistoryA
Retrieve customer billing statements, balances, and payment methods - Retrieves complete billing statements, current account balance due, payment methods on file, and historical invoice IDs for a specific customer.
[Usage Guidelines]
When to use: Use this tool to answer customer inquiries regarding outstanding balances, billing disputes, invoice history, or active payment methods.
When NOT to use: Do NOT use this tool for customer account profile details; use 'getCustomerDetails' instead. Do NOT use to search for customer IDs; use 'listCustomers' first. Do NOT use to check customer support issues; use 'listSupportTickets' instead.
Prerequisites: Requires a valid customerId (e.g., 'cust-001') previously discovered using 'listCustomers'.
[Behavior]
Operation: Read-only and idempotent. No financial transactions, charges, or balance mutations are executed.
Authorization: Requires 'readonly_agent', 'support_agent', or 'admin' role.
DLP / Sanitization: All payment card numbers, bank account numbers, and CVVs in responses are automatically masked with [REDACTED] by the zero-allocation gateway sanitizer.
[Parameters]
'customerId' (path, required): Unique customer identifier string (e.g. 'cust-001'). Must correspond to an active or archived customer account.
[Returns]
Returns HTTP 200 with JSON object containing: customerId, currency, balanceDue (decimal), paymentMethods (array of masked card tokens), and invoices (array of invoice objects with id, date, amount, status). Returns HTTP 404 if customerId is not found.
Inputs: customerId (required).
getCustomerDetailsA
Retrieve full profile record for a specific customer by ID - Retrieves comprehensive account profile metadata for an individual enterprise customer.
[Usage Guidelines]
When to use: Use this tool when you have an exact customerId and need full profile information such as registered tax ID, billing address, account tier, and primary contact details.
When NOT to use: Do NOT use this tool to search or discover customers; use 'listCustomers' instead. Do NOT use to view invoices or payment methods; use 'getBillingHistory' instead.
Prerequisites: Requires a valid 'customerId' (format 'cust-XXX') previously obtained via 'listCustomers'.
[Behavior]
Operation: Read-only and idempotent. Calling this tool causes no mutations or side effects.
Authorization: Requires 'readonly_agent', 'support_agent', or 'admin' role.
DLP / Sanitization: Sensitive personal attributes (such as SSN or tax identifiers) are automatically masked by the gateway DLP engine before response delivery.
[Parameters]
'customerId' (path, required): Unique customer identifier string in 'cust-XXX' format (e.g. 'cust-001'). Must match an existing customer record.
[Returns]
Returns HTTP 200 with full customer profile: customerId, name, email, taxId (redacted), address, serviceTier, and status. Returns HTTP 404 if the customerId does not exist.
Inputs: customerId (required).
listCustomersA
List and search enterprise customer profiles - Retrieves a paginated list of enterprise customer profiles.
[Usage Guidelines]
When to use: Use this tool to discover, search, or browse customer records across the organization, or to find a customerId before calling detail tools.
When NOT to use: Do NOT use this tool if you already have a specific customerId and need full profile or contact attributes; use 'getCustomerDetails' instead. Do NOT use to inspect customer billing or invoices; use 'getBillingHistory' instead.
Alternatives: Use 'getCustomerDetails' for single-record deep inspection.
[Behavior]
Operation: Read-only and idempotent. Safe to call multiple times with identical parameters without side effects.
Authorization: Requires 'readonly_agent', 'support_agent', or 'admin' role.
DLP / Sanitization: Customer email addresses and account statuses are returned. Any internal notes are scrubbed.
[Parameters & Interactions]
'status' (query, optional): Filter by lifecycle state ('active', 'inactive', 'suspended'). If omitted, customers in all lifecycle states are returned.
'limit' (query, optional): Integer between 1 and 100 specifying maximum records to return per page. Defaults to 20 if omitted.
[Returns]
Returns a JSON array of customer summary objects, each containing: customerId (string, e.g. 'cust-001'), name (string), email (string), and status (string).
Inputs: limit, status.
listSupportTicketsA
Query and filter customer support tickets across the organization - Queries open, in-progress, and resolved support incident tickets across enterprise accounts.
[Usage Guidelines]
When to use: Use this tool to check existing service tickets, verify SLA status, review customer incident history, or ensure an issue is not already logged before filing a new ticket.
When NOT to use: Do NOT use this tool to open or submit a new ticket; use 'createSupportTicket' instead. Do NOT use to check billing issues; use 'getBillingHistory' instead.
Recommended Flow: Call 'listSupportTickets' first to inspect existing tickets for a customer before creating a duplicate with 'createSupportTicket'.
[Behavior]
Operation: Read-only and idempotent. Querying tickets produces zero side effects or ticket state modifications.
Authorization: Requires 'readonly_agent', 'support_agent', or 'admin' role.
DLP / Sanitization: Ticket descriptions containing secrets or credentials are redacted prior to LLM presentation.
[Parameters & Interactions]
'customerId' (query, optional): Restricts ticket query to a single customer ID (e.g., 'cust-001'). If omitted, tickets across all enterprise accounts are queried.
'priority' (query, optional): Filter by ticket urgency level ('low', 'normal', 'high', 'urgent').
Parameter Interaction: If both 'customerId' and 'priority' are provided, tickets matching BOTH filters are returned (AND logic).
[Returns]
Returns HTTP 200 with JSON array of ticket objects, each containing: ticketId (e.g. 'tick-101'), customerId, subject, description, priority, status ('open', 'in_progress', 'resolved'), and createdAt timestamp.
Inputs: priority, customerId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 5 tools
Each tool targets a distinct resource and action: customer search, customer detail, billing history, ticket listing, and ticket creation. The usage guidelines explicitly reinforce these boundaries, making misselection unlikely.
All tool names follow a consistent camelCase verb_noun pattern: list/get/create plus the target resource. There is no mixing of conventions or vague, ambiguous verbs.
Five tools is a well-scoped set for a focused customer and support gateway. Each tool has a clear purpose and none are redundant or extraneous.
Read coverage for customers, billing, and tickets is solid, and ticket creation exists. However, there are notable lifecycle gaps: no way to update or resolve support tickets, and no customer create/update/delete operations, which creates dead ends in common workflows.
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
Governed MCP gateway for business apps: roles, previews, approvals and one audit log.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceToolMesh is an Apache-2.0, self-hosted MCP gateway written in Go that sits between AI agents and backend systems. It enforces a fail-closed pipeline on every tool call, including per-tool and per-user authorization, server-side credential injection, structured audit logging, and output policies. APIs are declared in YAML with DADL, turning REST endpoints into MCP tools without writing a custom MCP6Apache 2.0- AlicenseNot gradedqualityCmaintenanceA secure MCP gateway for enterprise AI tool execution, enabling governed invocation of business tools with authentication, RBAC, audit logging, PII redaction, and async processing.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceMCP gateway adding per-tool RBAC, tenant isolation, audit export, and PII redaction to any server.MIT
- AlicenseNot gradedqualityDmaintenanceUniversal MCP router and gateway that bridges LLM agents to OpenAPI, GraphQL, and AWS Lambda services with ISO/IEC 42001 AI governance, RBAC, PII redaction, semantic tool routing, and a web dashboard.MIT