Skip to main content
Glama
maybeswapnil

Enterprise MCP Server

by maybeswapnil
README.md
# Enterprise MCP Server

Enterprise-grade Model Context Protocol (MCP) server with ServiceNow integration and health monitoring capabilities.

## Features

- **Health Monitoring**: Built-in health checks and monitoring with system metrics
- **ServiceNow Integration**: Full ServiceNow MCP service integration for enterprise workflows
- **Production Ready**: Designed for enterprise environments with proper logging and error handling
- **FastAPI Backend**: High-performance REST API with Starlette and FastMCP
- **Async Support**: Full asynchronous operation support
- **Modular Architecture**: Service-based architecture with base service class

## Quick Start

### Prerequisites

- Python 3.11+
- uv package manager

### Installation

1. Clone the repository:
```bash
git clone <repository-url>
cd enterprise-mcp
```

2. Install dependencies using uv:
```bash
uv sync
```

3. Activate the virtual environment:
```bash
source .venv/bin/activate
```

### Running the Server

```bash
uv run enterprise-mcp
```

The server will start on `http://localhost:3001` by default.

### Health Endpoints

- `GET /health` - Basic health check
- `GET /health/ready` - Readiness probe
- `GET /health/live` - Liveness probe

## Development

### Setup Development Environment

1. Install development dependencies:
```bash
uv sync --extra dev
```

2. Install pre-commit hooks:
```bash
make dev
```

### Running Tests

```bash
make test
# or
uv run pytest
```

### Code Formatting

```bash
make format
# or 
uv run ruff format .
uv run ruff check --fix .
```

### Available Make Commands

```bash
make help           # Show available commands
make install        # Install dependencies
make install-dev    # Install dev dependencies  
make test           # Run tests
make test-cov       # Run tests with coverage
make lint           # Run linting
make format         # Format code
make run            # Run the server
make run-dev        # Run server in development mode
make clean          # Clean up build artifacts
make dev            # Set up development environment
```

## Configuration

The server uses environment variables for configuration. Copy `.env.example` to `.env` and customize:

```bash
cp .env.example .env
```

Available settings:
- `HOST` - Server host (default: 0.0.0.0)
- `PORT` - Server port (default: 3001)
- `DEBUG` - Debug mode (default: false)
- `MCP_BASE` - MCP base URL (default: http://localhost:3001)
- `SERVICENOW_INSTANCE` - ServiceNow instance URL
- `SERVICENOW_USERNAME` - ServiceNow username  
- `SERVICENOW_PASSWORD` - ServiceNow password
- `HEALTH_CHECK_INTERVAL` - Health check interval in seconds (default: 30)

## Services

### Health Service
Provides comprehensive health monitoring including:
- System health status
- Uptime information  
- Memory usage statistics
- CPU usage statistics
- Platform information

### ServiceNow Service  
Integrates with ServiceNow instances for enterprise workflow management:
- Get incidents
- Create incidents
- Update incidents
- Get change requests

## Architecture

```
src/enterprise_mcp/
├── main.py                    # Main entry point
├── server/                    # Core server implementation
│   ├── __init__.py
│   ├── base.py               # Base server class
│   └── mcp_server.py         # MCP server implementation
├── services/                  # MCP services
│   ├── __init__.py
│   ├── base_service.py       # Base service class
│   ├── health/               # Health monitoring service
│   │   ├── __init__.py
│   │   ├── service.py
│   │   └── settings.py
│   └── servicenow/           # ServiceNow integration service
│       ├── __init__.py
│       ├── service.py
│       └── settings.py
└── settings/                  # Configuration settings
    └── __init__.py
```

## VS Code Integration

The project includes VS Code configuration for MCP debugging:
- `.vscode/mcp.json` - MCP server configuration
- `.vscode/tasks.json` - Build and run tasks
- `.devcontainer/` - Development container setup

## Docker Support

Build and run with Docker:
```bash
docker build -t enterprise-mcp .
docker run -p 3001:3001 enterprise-mcp
```

## License

Enterprise License - See LICENSE file for details.