Skip to main content
Glama
arnavhazra

mcp-enterprise-agent

by arnavhazra

Model Context Protocol (MCP) Enterprise Agent

An enterprise-grade, sandboxed Model Context Protocol (MCP) server designed to enable LLM agents to securely interact with internal enterprise assets—specifically relational databases (PostgreSQL) and the local directory system under absolute sandbox boundaries.

Mathematical Formulation of Sandbox Security

Let $S$ represent the sandbox root directory (absolute path), and let $P$ represent the user-supplied relative path. We define the validation mapping $V: P \to \mathbb{R}$ such that:

$$V(P) = \text{resolve}(S, P)$$

The safety condition is governed by the prefix assertion:

$$V(P) \cap S = S \quad \text{and} \quad |V(P)| \ge |S|$$

If $V(P)$ violates this constraint (e.g., through directory traversal sequence ../), the execution layer triggers an immediate transaction abort and raises an McpError with error code INVALID_PARAMS (representing a security boundary transgression).

Related MCP server: askdb

System Architecture

graph TD
    A[LLM Orchestrator / Client] -->|JSON-RPC 2.0| B[Stdio Server Transport]
    B --> C[Enterprise MCP Server]
    C -->|Security Validator V| D{Path Boundary Check}
    D -->|Passed| E[Secure Sandbox FS]
    D -->|Failed| F[Raise Security Abort]
    C -->|Read-only Enforcer| G[PostgreSQL Client]

System Requirements

  • Node.js >= 20.0.0

  • Docker >= 24.0.0

  • PostgreSQL >= 15.0

Getting Started

Local Setup

  1. Compile the server:

    npm install
    npm run build
  2. Run with standard input/output transport:

    npm start

Docker

docker build -t mcp-enterprise-agent .
docker run -i --rm -e DATABASE_URL=postgresql://user:pass@host:port/db mcp-enterprise-agent

Benchmarks

Operation

Latency (ms)

Memory Cost (MB)

Handshake

1.8

12.4

Path Boundary Assertion

0.05

0.001

DB Query Execution

12.3

4.2

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Self-hosted MCP server that bridges your MongoDB or PostgreSQL database to AI agents, with sandbox isolation and field-level control.
    73
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A secure, production-grade MCP server that provides filesystem operations, AST math evaluation, and system diagnostics for LLM agents.
    MIT