Skip to content

Commit 0c10816

Browse files
committed
Update MCP server dependencies and refactor imports
Upgraded Python requirement to 3.10 and updated several dependencies in pyproject.toml. Refactored authentication to use JWTVerifier and adjusted related imports. Removed unused __init__.py files from multiple modules to clean up the package structure.
1 parent fb8bf34 commit 0c10816

File tree

10 files changed

+1636
-191
lines changed

10 files changed

+1636
-191
lines changed

src/backend/v3/mcp_server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY requirements.txt .
1313

1414
# Install Python dependencies
1515
RUN pip install --no-cache-dir -r requirements.txt
16-
16+
####
1717
# Copy the application
1818
COPY . .
1919

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
"""
2-
MCP Server package for MACAE.
3-
"""
4-
5-
__version__ = "1.0.0"
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
"""
2-
Configuration module for MCP server.
3-
"""
4-
5-
from .settings import config, get_auth_config, get_server_config
6-
7-
__all__ = ["config", "get_auth_config", "get_server_config"]
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
"""
2-
Core MCP server components.
3-
"""
4-
5-
from .factory import MCPToolFactory, MCPToolBase, Domain
6-
7-
__all__ = ["MCPToolFactory", "MCPToolBase", "Domain"]

src/backend/v3/mcp_server/mcp_server.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
MACAE MCP Server - FastMCP server with organized tools and services.
33
"""
44

5+
###
56
import sys
67
import argparse
78
from pathlib import Path
89
from fastmcp import FastMCP
9-
from fastmcp.server.auth import BearerAuthProvider
10+
from fastmcp.server.auth.providers.jwt import JWTVerifier
1011
import logging
1112
from typing import Optional
1213

1314
from core.factory import MCPToolFactory
14-
from services import HRService, TechSupportService, GeneralService, DataToolService
15+
from services import (
16+
HRService,
17+
TechSupportService,
18+
GeneralService,
19+
DataToolService,
20+
)
1521
from config.settings import config
1622

1723
# Setup logging
@@ -42,7 +48,7 @@ def create_fastmcp_server():
4248
"audience": config.audience,
4349
}
4450
if all(auth_config.values()):
45-
auth = BearerAuthProvider(
51+
auth = JWTVerifier(
4652
jwks_uri=auth_config["jwks_uri"],
4753
issuer=auth_config["issuer"],
4854
algorithm="RS256",

src/backend/v3/mcp_server/pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "macae-mcp-server"
77
description = "FastMCP-based Model Context Protocol (MCP) server for the MACAE solution accelerator"
88
readme = "README.md"
9-
requires-python = ">=3.9"
9+
requires-python = ">=3.10"
1010
license = { text = "MIT" }
1111
authors = [
1212
{ name = "Microsoft MACAE Team" }
@@ -15,11 +15,11 @@ dynamic = ["version"]
1515

1616
# Core runtime dependencies (kept in sync with requirements.txt)
1717
dependencies = [
18-
"fastmcp==2.2.4",
18+
"fastmcp==2.11.3",
1919
"uvicorn[standard]==0.32.1",
20-
"python-dotenv==1.0.1",
20+
"python-dotenv>=1.1.0",
2121
"azure-identity==1.19.0",
22-
"pydantic==2.10.4",
22+
"pydantic==2.11.7",
2323
"pydantic-settings==2.6.1",
2424
"python-multipart==0.0.17",
2525
"httpx==0.28.1",
@@ -42,8 +42,8 @@ path = "__init__.py"
4242
# Hatch build configuration. Since this folder is itself the package root,
4343
# include everything under it (no src/ layout).
4444
[tool.hatch.build.targets.wheel]
45-
include = [
46-
"**/*.py",
47-
"README.md",
48-
"*.env*",
49-
]
45+
packages = ["."]
46+
include = ["**/*", "README.md"]
47+
48+
[project.scripts]
49+
mcp-server = "mcp_server.app:main"

src/backend/v3/mcp_server/requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
"""
2-
Services module for MCP server.
3-
"""
4-
5-
from .hr_service import HRService
6-
from .tech_support_service import TechSupportService
7-
from .general_service import GeneralService
8-
from .data_tool_service import DataToolService
9-
10-
__all__ = ["HRService", "TechSupportService", "GeneralService", "DataToolService"]
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
"""
2-
Utilities for MCP server.
3-
"""
4-
5-
from .date_utils import (
6-
format_date_for_user,
7-
get_current_timestamp,
8-
format_timestamp_for_display,
9-
)
10-
from .formatters import (
11-
format_mcp_response,
12-
format_error_response,
13-
format_success_response,
14-
)
15-
16-
__all__ = [
17-
"format_date_for_user",
18-
"get_current_timestamp",
19-
"format_timestamp_for_display",
20-
"format_mcp_response",
21-
"format_error_response",
22-
"format_success_response",
23-
]

src/backend/v3/mcp_server/uv.lock

Lines changed: 1617 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)