Enterprise MCP Server
Allows generating AI responses using OpenAI as a configured provider through the AI generation tool.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Enterprise MCP Server
A modular, security-focused Model Context Protocol (MCP) server that exposes enterprise-ready tools, prompts, and resources through a unified MCP interface.
π Project Overview
The Enterprise MCP Server is a Python-based MCP server built with FastMCP.
It provides a single interface for interacting with:
π Filesystem operations
ποΈ Database operations
π REST APIs
π₯οΈ System utilities
π€ AI generation
π¬ Reusable MCP prompts
π MCP resources
The project follows a layered architecture with dedicated tools, services, validation, permission management, configuration, logging, and persistence components.
The implementation also includes database audit logging, SQL safety validation, explicit database execution permissions, authentication/authorization controls, and automated testing.
Related MCP server: AX Local Operations MCP Server
π Project Status
Status: β Implementation Complete
Area | Status |
MCP Server | β Complete |
Tool Registry | β Complete |
Filesystem Tools | β 5 tools |
Database Tools | β 3 tools |
REST API | β 1 tool |
System Utilities | β 4 tools |
AI Integration | β 1 tool |
MCP Prompts | β 3 prompts |
MCP Resources | β 3 resources |
Database Persistence | β Complete |
Audit Logging | β Complete |
SQL Safety Validation | β Complete |
Database Permission Policy | β Complete |
Authentication / Authorization | β Complete |
Automated Tests | β 101 passed |
MCP Inspector Verification | β Complete |
β¨ Key Features
MCP Capabilities
FastMCP-based server
Idempotent server initialization
Centralized tool registry
14 registered MCP tools
3 reusable MCP prompts
3 MCP resources
Security
Authentication and authorization layer
Read/write database separation
Database execute permission control
SQL query validation
Multiple-statement rejection
Destructive SQL pattern rejection
Filesystem workspace restrictions
Environment-based secret management
Audit logging
Engineering
Layered architecture
Centralized configuration
Structured application logging
Service-layer separation
Pydantic request/response models
SQLAlchemy database integration
Automated unit and persistence tests
MCP Inspector validation
ποΈ Architecture
ββββββββββββββββββββββββ
β MCP Client β
β / MCP Inspector β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β FastMCP β
β Server β
ββββββββββββ¬ββββββββββββ
β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Tools β β Prompts β β Resources β
ββββββββ¬βββββββ βββββββββββββββ βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Tool Registry / Layer β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββ
β
βββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β Filesystem β β Database β β REST API β
β Service β β Service β β Service β
ββββββββββββββ βββββββ¬βββββββ ββββββββββββββ
β
βΌ
ββββββββββββββ
β SQLAlchemy β
βββββββ¬βββββββ
β
βΌ
ββββββββββββββ
β Database β
β audit_logs β
ββββββββββββββ
βββββββββββββββββββ
β AI Service β
β Provider Layer β
βββββββββββββββββββπ§© MCP Tools
The server currently exposes 14 MCP tools.
π Filesystem Tools
Tool | Purpose |
| Read a file from the configured workspace |
| Write content to the configured workspace |
| List files/directories |
| Delete an allowed workspace file |
| Check whether a path exists |
ποΈ Database Tools
Tool | Purpose |
| Execute validated read-only SQL |
| Execute approved write/DDL SQL when permitted |
| Check database availability |
Database Query
Example:
{
"query": "SELECT id, request_id, tool_name, status FROM audit_logs WHERE request_id = 'req-sample-002'",
"parameters": {},
"timeout": 30,
"max_rows": 100
}Database Execute
Example:
{
"query": "CREATE TABLE IF NOT EXISTS mcp_test_table (id INTEGER PRIMARY KEY, message TEXT)",
"parameters": {},
"timeout": 30
}Database Execute Security
Database execution is intentionally controlled.
Default permission policy:
QUERY β ALLOWED
EXECUTE β DENIED BY DEFAULT
HEALTH β ALLOWEDExecution can be explicitly enabled through:
DATABASE_ALLOW_EXECUTEThe SQL must still pass execute-query validation.
π REST API
Tool | Purpose |
| Perform a validated HTTP request through the REST API service |
The REST API layer handles request validation, timeout behavior, and HTTP error handling.
π₯οΈ System Utilities
Tool | Purpose |
| Return current system time |
| Return system information |
| Return disk usage information |
| Generate a cryptographic hash |
Hash Example
Input:
{
"algorithm": "sha256",
"input": "abc"
}Output:
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adπ€ AI
Tool | Purpose |
| Generate an AI response through the configured provider layer |
AI provider configuration is managed through environment variables.
π¬ MCP Prompts
The server provides 3 reusable MCP prompts.
Prompt | Purpose | Input |
| Structured system/server diagnostics | None |
| Analyze a database table | Table name |
| Investigate an operational incident | Incident description |
Database Analysis Example
audit_logsIncident Investigation Example
The database_query tool rejected a SELECT request with
UNSAFE_DATABASE_QUERY. Investigate whether the issue is
caused by SQL validation, permissions, or database availability.π MCP Resources
The server provides 3 resources:
Resource | Purpose |
| Server metadata |
| Registered tool information |
| Server/database health information |
ποΈ Database Architecture
The database layer uses SQLAlchemy.
The main application table is:
audit_logsAudit Log Schema
Column | Type | Description |
| INTEGER | Primary key |
| VARCHAR(100) | MCP request identifier |
| VARCHAR(100) | Client identifier |
| VARCHAR(100) | Executed tool |
| VARCHAR(100) | Operation performed |
| VARCHAR(50) | Execution status |
| TEXT | Optional details |
| DATETIME | Audit timestamp |
Example Audit Record
request_id : req-execute-test-001
client_id : client-001
tool_name : database_execute
operation : insert
status : successπ Security Model
The project uses multiple security layers.
Client Request
β
βΌ
Authentication
β
βΌ
Authorization
β
βΌ
Input Validation
β
βΌ
Permission Policy
β
βΌ
Service Execution
β
βΌ
Audit Logging
β
βΌ
ResponseDatabase Query Security
database_query is read-only.
The validator rejects dangerous operations including:
INSERT
UPDATE
DELETE
DROP
ALTER
TRUNCATE
CREATE
GRANT
REVOKE
EXEC / EXECUTE
CALLMultiple SQL statements are also rejected.
Example rejected input:
SELECT 1; SELECT 2;The validator also protects against incorrectly interpreting SQL keywords contained inside quoted string values.
βοΈ Configuration
Application configuration is centralized in:
app/core/config.pyConfiguration is loaded from environment variables and .env.
Important settings include:
APP_NAME
APP_VERSION
APP_ENV
DEBUG
HOST
PORT
LOG_LEVEL
LOG_FILE
SECRET_KEY
DATABASE_URL
DATABASE_ALLOW_EXECUTE
AI_PROVIDER
GROQ_API_KEY
ANTHROPIC_API_KEY
GEMINI_API_KEY
OPENAI_API_KEY
HTTP_TIMEOUT
MAX_RETRIESβ οΈ Secrets
Never commit:
.env
API keys
database credentials
secret keysUse .env.example for safe configuration documentation.
π¦ Project Structure
enterprise-mcp-server/
β
βββ app/
β β
β βββ core/
β β βββ config.py
β β βββ constants.py
β β βββ logger.py
β β βββ ...
β β
β βββ database/
β β βββ models.py
β β βββ session.py
β β βββ ...
β β
β βββ server/
β β βββ mcp_server.py
β β βββ registry.py
β β βββ prompts.py
β β βββ resources.py
β β
β βββ services/
β β βββ database_service.py
β β βββ filesystem_service.py
β β βββ rest_api_service.py
β β βββ ...
β β
β βββ tools/
β βββ ai/
β βββ database/
β βββ filesystem/
β βββ rest_api/
β βββ system/
β
βββ tests/
β βββ unit/
β βββ integration/
β
βββ docs/
β βββ api.md
β βββ architecture.md
β βββ database.md
β βββ deployment.md
β βββ security.md
β βββ tool-reference.md
β
βββ data/
βββ logs/
β
βββ .env.example
βββ .gitignore
βββ pyproject.toml
βββ README.mdπ οΈ Installation
1. Clone the Repository
git clone <your-repository-url>
cd enterprise-mcp-server2. Create Virtual Environment
Windows
python -m venv .venv
.venv\Scripts\Activate.ps1Linux / macOS
python -m venv .venv
source .venv/bin/activate3. Install Dependencies
Install the dependencies defined by the project configuration.
4. Configure Environment
Copy:
.env.exampleto:
.envThen configure the required values.
βΆοΈ Running the Server
The primary server module is:
app/server/mcp_server.pyVerify Server Initialization
python -c "from app.server.mcp_server import initialize_server; initialize_server(); print('Server initialization successful')"Expected final message:
MCP server initialized successfully.
Server initialization successfulStart the Server
Run the server using the project's configured server command.
π§ͺ Testing
Run the complete test suite:
pytest -vFinal Verified Result
101 passedThe test suite covers areas including:
Safe database queries
Unsafe query rejection
Multiple SQL statement rejection
Database permission policy
Execute permission behavior
Database configuration
Query result serialization
Database persistence
Audit logging
Authentication
Authorization
Tool behavior
Service behavior
π MCP Inspector Verification
The project was tested using MCP Inspector.
Verification includes:
Tools
14 toolsPrompts
3 promptsResources
3 resourcesThe Inspector was used to verify operations including:
database_querydatabase_executedatabase_healthai_generaterest_api_requestsystem utilities
π§Ύ Example End-to-End Database Workflow
1. Create a test table
{
"query": "CREATE TABLE IF NOT EXISTS mcp_test_table (id INTEGER PRIMARY KEY, message TEXT)",
"parameters": {},
"timeout": 30
}2. Insert a record
{
"query": "INSERT INTO mcp_test_table (message) VALUES ('MCP test record')",
"parameters": {},
"timeout": 30
}3. Query the record
{
"query": "SELECT id, message FROM mcp_test_table",
"parameters": {},
"timeout": 30,
"max_rows": 100
}This demonstrates the complete:
Execute β Persist β Queryworkflow.
π Project Metrics
Metric | Result |
MCP Tools | 14 |
MCP Prompts | 3 |
MCP Resources | 3 |
Test Cases | 101 passed |
Database Tables |
|
Tool Families | 5 |
Architecture | Layered / Modular |
π Documentation
Detailed documentation is available in the docs/ directory:
π§ Future Improvements
The current implementation is complete for the project scope.
Potential future enhancements:
Production database migrations
PostgreSQL deployment
Docker / container deployment
CI/CD pipeline
Metrics and distributed tracing
More granular per-client database permissions
Parameterized MCP resource templates
Expanded integration testing
Production monitoring
Additional AI provider abstractions
These are optional extensions rather than current project requirements.
π― What This Project Demonstrates
This project demonstrates practical experience with:
Model Context Protocol
FastMCP
Python backend architecture
API/service design
Database engineering
SQL security
Permission systems
Authentication and authorization
Audit logging
REST API integration
AI integration
Environment-based configuration
Automated testing
MCP Inspector
Modular software design
π€ Author
ILA
Enterprise MCP Server β modular MCP tooling, security controls, database integration, AI integration, prompts, resources, and automated testing.
π License
Add the project's intended license here before publishing the repository publicly.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Nifty's MCP server β exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA unified MCP server with composable tools for GitHub operations, file management, shell execution, kanban boards, Discord messaging, and package management. Features role-based security, HTTP/stdio transports, and a web-based development UI.GPL 3.0
- AlicenseAqualityCmaintenanceA comprehensive MCP server that enables AI models to perform local file operations, command execution, and task management across multiple platforms. It features advanced capabilities like row-level file editing, directory searching, and system monitoring with built-in security filters.1348 npmMulan Permissive Software , Version 2
- AlicenseNot gradedqualityDmaintenanceA production-grade MCP server designed for multi-tenant, authenticated, and observable AI agent systems, enabling secure tool execution across heterogeneous data sources.68MIT
- AlicenseNot gradedqualityDmaintenanceGeneral-purpose MCP server with built-in tools for HTTP, JSON, and datetime operations, supporting pluggable modules and security defaults.MIT