Skip to content

Commit a61a31f

Browse files
committed
Refactor MCP server to modular architecture
Reorganized the MCP server into a modular structure with separate directories for core logic, services, utilities, and configuration. Introduced service classes for HR, tech support, and general tools, and implemented a factory pattern for tool registration. Added FastAPI-based HTTP API with authentication, Docker support, environment-based configuration, and comprehensive test scaffolding. Removed legacy test client and updated main server entry point for dual HTTP/MCP protocol support.
1 parent 8073f0b commit a61a31f

27 files changed

+2115
-150
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# MCP Server Configuration
2+
3+
# Server Settings
4+
MCP_HOST=0.0.0.0
5+
MCP_PORT=9000
6+
MCP_DEBUG=false
7+
MCP_SERVER_NAME=MACAE MCP Server
8+
9+
# Authentication Settings
10+
MCP_ENABLE_AUTH=true
11+
AZURE_TENANT_ID=your-tenant-id-here
12+
AZURE_CLIENT_ID=your-client-id-here
13+
AZURE_JWKS_URI=https://login.microsoftonline.com/your-tenant-id/discovery/v2.0/keys
14+
AZURE_ISSUER=https://sts.windows.net/your-tenant-id/
15+
AZURE_AUDIENCE=api://your-client-id
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM python:3.11-slim
2+
3+
# Set working directory
4+
WORKDIR /app
5+
6+
# Install system dependencies
7+
RUN apt-get update && apt-get install -y \
8+
gcc \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Copy requirements first for better caching
12+
COPY requirements.txt .
13+
14+
# Install Python dependencies
15+
RUN pip install --no-cache-dir -r requirements.txt
16+
17+
# Copy the application
18+
COPY . .
19+
20+
# Create non-root user
21+
RUN useradd --create-home --shell /bin/bash app && chown -R app:app /app
22+
USER app
23+
24+
# Expose port
25+
EXPOSE 9000
26+
27+
# Health check
28+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
29+
CMD curl -f http://localhost:9000/health || exit 1
30+
31+
# Default command
32+
CMD ["python", "mcp_server.py"]

0 commit comments

Comments
 (0)