This guide explains how to configure and customize Model Context Protocol (MCP) servers for the Container Migration Solution Accelerator. The solution uses MCP to extend AI agent capabilities with external tools, services, and data sources through a standardized protocol.
The Container Migration Solution Accelerator implements a sophisticated MCP architecture that separates client plugins from server implementations, enabling secure, scalable, and maintainable tool integration for AI agents.
- Process Isolation: Each MCP server runs in its own process for security and stability
- Language Flexibility: Servers can be implemented in different languages while maintaining compatibility
- Scalability: Independent server processes can be scaled based on demand
- Maintainability: Clear separation between client interface and server implementation
- Security: Isolated execution prevents tool interference and provides better error containment
The solution integrates MCP through multiple patterns:
- Stdio Plugins: Local MCP servers spawned as subprocesses (blob, file, datetime operations)
- HTTP Plugins: Remote MCP servers accessed via HTTP (Microsoft documentation)
- Context Management: Unified context sharing across all expert agents
- Tool Discovery: Dynamic tool registration and capability discovery
- Error Handling: Robust error handling with fallback mechanisms
src/plugins/mcp_server/
├── __init__.py
├── MCPBlobIOPlugin.py # Azure Blob Storage operations - MCP Server Client
├── MCPDatetimePlugin.py # Date/time utilities - MCP Server Client
├── MCPMicrosoftDocs.py # Microsoft documentation API - MCP Server Client
├── mcp_blob_io_operation/ # Blob storage MCP Server Implementation (FastMCP)
│ ├── credential_util.py
│ └── mcp_blob_io_operation.py
└── mcp_datetime/ # Datetime utilities MCP Server Implementation (FastMCP)
└── mcp_datetime.py
Architecture Notes:
- Client Plugin Files: Main MCP client plugins that connect to MCP servers via Semantic Kernel
- Server Implementation Folders: Contains the actual FastMCP server implementations that provide the tools
- Credential Utilities: Shared authentication and credential management for Azure services
- Process Architecture: Client plugins spawn server processes using
uv runfor isolated execution
Service Name: azure_blob_io_service
Provides integration with Azure Blob Storage using FastMCP framework:
Capabilities:
- Blob upload and download operations
- Container management and listing
- File metadata operations
- Storage account integration
- Folder structure creation and management
- Blob existence verification
- Storage account information retrieval
Environment Configuration:
The server supports multiple authentication methods through environment variables:
# Option 1: Azure Storage Account with DefaultAzureCredential (Recommended)
STORAGE_ACCOUNT_NAME=your_storage_account_name
# Option 2: Connection String (Alternative)
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
# Option 3: Storage Account with Access Key (Not recommended for production)
STORAGE_ACCOUNT_NAME=your_storage_account_name
STORAGE_ACCOUNT_KEY=your_storage_account_keyAuthentication Methods:
-
DefaultAzureCredential (Recommended for production):
- Uses managed identity in Azure environments
- Uses Azure CLI credentials for local development
- Requires
STORAGE_ACCOUNT_NAMEenvironment variable
-
Connection String:
- Requires
AZURE_STORAGE_CONNECTION_STRINGenvironment variable - Contains embedded authentication information
- Requires
-
Account Key:
- Requires both
STORAGE_ACCOUNT_NAMEandSTORAGE_ACCOUNT_KEY - Not recommended for production environments
- Requires both
Available Tools:
save_content_to_blob(): Save content to Azure Blob Storageread_blob_content(): Read blob content as textcheck_blob_exists(): Verify blob existence with metadatadelete_blob(): Delete individual blobslist_blobs_in_container(): List blobs with filtering optionscreate_container(): Create new storage containersdelete_container(): Delete entire containersmove_blob(): Move/rename blobs between containerscopy_blob(): Copy blobs within or across containersfind_blobs(): Search blobs using wildcard patterns
Service Name: microsoft_docs_service
Provides Microsoft documentation integration through HTTP-based MCP connection:
GitHub Microsoft Docs MCP Server - MicrosoftDocs/mcp
Capabilities:
- Microsoft Learn documentation access
- Azure service documentation retrieval
- Semantic search across Microsoft documentation
- Complete documentation page fetching
- Best practices and examples lookup
- API reference integration
Environment Configuration:
No environment variables required. Uses HTTP connection to Microsoft's public MCP server.
Connection Details:
- Protocol: HTTP-based MCP connection
- URL:
https://learn.microsoft.com/api/mcp - Type: MCPStreamableHttpPlugin
- Requirements: semantic-kernel with MCP support
Available Tools:
microsoft_docs_search(): Semantic search against Microsoft documentationmicrosoft_docs_fetch(): Fetch complete documentation pages in markdown format
Service Name: datetime_service
Provides date and time operations using FastMCP framework:
Capabilities:
- Current timestamp generation in multiple formats
- Date and time parsing and formatting
- Time zone conversions and handling
- Duration calculations and comparisons
- Migration timeline tracking
- Report timestamp management
- Relative time calculations
Environment Configuration:
No environment variables required. Uses system time and optional timezone libraries.
Optional Dependencies:
- pytz: Enhanced timezone support (recommended)
- zoneinfo: Python 3.9+ timezone support (fallback)
Timezone Support:
- Default timezone: UTC
- Supported aliases: PT, ET, MT, CT, PST, PDT, EST, EDT, MST, MDT, CST, CDT
- Full timezone names supported when pytz or zoneinfo available
Available Tools:
get_current_timestamp(): Get current timestamp in various formatsformat_datetime(): Format datetime stringsconvert_timezone(): Convert between timezonescalculate_duration(): Calculate time differencesparse_datetime(): Parse datetime stringsget_relative_time(): Calculate relative time descriptions
Here's a complete example of setting up all MCP servers for the migration solution:
# Azure Blob Storage Configuration (Required)
export STORAGE_ACCOUNT_NAME="migrationstorageacct"
# Alternative: Use connection string for development
# export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=..."
# No additional environment variables needed for:
# - DateTime Server (system time)
# - Microsoft Docs Server (HTTP connection)The MCP servers integrate into the migration workflow as follows:
-
Analysis Phase:
azure_blob_io_service: Read source Kubernetes configurationsmicrosoft_docs_service: Research Azure best practicesdatetime_service: Timestamp analysis reports
-
Design Phase:
azure_blob_io_service: Save architecture designsmicrosoft_docs_service: Validate Azure service capabilitiesdatetime_service: Track design timestamps
-
Conversion Phase:
azure_blob_io_service: Save converted YAML configurationsazure_blob_io_service: Generate configuration comparisonsdatetime_service: Track conversion timestamps
-
Documentation Phase:
azure_blob_io_service: Save migration reportsazure_blob_io_service: Generate migration documentationdatetime_service: Create migration timeline
Each expert agent uses specific MCP servers:
| Agent | Primary MCP Servers | Use Cases |
|---|---|---|
| Technical Architect | blob, docs, datetime | Architecture analysis, best practices research |
| Azure Expert | blob, docs, datetime | Azure-specific optimizations, service documentation |
| EKS/GKE Expert | blob, docs, datetime | Source platform analysis, migration patterns |
| YAML Expert | blob, docs, datetime | Configuration conversion, YAML validation |
| QA Engineer | blob, docs, datetime | Quality assurance, testing validation |
| Technical Writer | blob, docs, datetime | Documentation generation, report creation |
The solution uses Semantic Kernel's MCP connectors to integrate with MCP servers. There are two main patterns for adding custom MCP servers:
This pattern is used for local MCP servers that run as separate processes (like the blob and datetime servers).
Create a FastMCP server implementation:
# src/plugins/mcp_server/mcp_custom_service/mcp_custom_service.py
from fastmcp import FastMCP
mcp = FastMCP(
name="custom_service",
instructions="Custom service operations for specialized tasks."
)
@mcp.tool()
def custom_operation(
parameter1: str,
parameter2: str | None = None,
) -> str:
"""Perform custom operation.
Args:
parameter1: Primary parameter for the operation
parameter2: Optional secondary parameter
Returns:
Success message with operation results
"""
try:
# Implement your custom logic here
result = f"Custom operation completed with {parameter1}"
if parameter2:
result += f" and {parameter2}"
return f"[SUCCESS] {result}"
except Exception as e:
return f"[FAILED] Custom operation failed: {str(e)}"
if __name__ == "__main__":
mcp.run()Create a client plugin that connects to your MCP server:
# src/plugins/mcp_server/MCPCustomServicePlugin.py
import os
from pathlib import Path
def get_custom_service_plugin():
"""
Create an MCP plugin for Custom Service Operations.
Cross-platform compatible for Windows, Linux, and macOS.
Returns:
MCPStdioPlugin: Configured Custom Service MCP plugin
Raises:
RuntimeError: If MCP setup validation fails
"""
try:
# Lazy import to avoid hanging during module import
from semantic_kernel.connectors.mcp import MCPStdioPlugin
return MCPStdioPlugin(
name="custom_service",
description="MCP plugin for Custom Service Operations",
command="uv",
args=[
f"--directory={str(Path(os.path.dirname(__file__)).joinpath('mcp_custom_service'))}",
"run",
"mcp_custom_service.py",
],
env=dict(os.environ), # Pass environment variables if needed
)
except ImportError as e:
print(f"MCP support not available: {e}")
return NoneThis pattern is used for remote MCP servers accessible via HTTP (like the Microsoft Docs server).
# src/plugins/mcp_server/MCPRemoteServicePlugin.py
try:
from semantic_kernel.connectors.mcp import MCPStreamableHttpPlugin
MCP_AVAILABLE = True
except ImportError:
MCP_AVAILABLE = False
MCPStreamableHttpPlugin = None
def get_remote_service_plugin():
"""
Create an MCP Streamable HTTP Plugin for remote service access.
Available tools:
- remote_search: Search remote service
- remote_fetch: Fetch data from remote service
Returns:
MCPStreamableHttpPlugin: Configured plugin for remote MCP Server, or None if MCP not available
"""
if not MCP_AVAILABLE or MCPStreamableHttpPlugin is None:
return None
return MCPStreamableHttpPlugin(
name="remote_service",
description="Access Remote Service",
url="https://your-remote-service.com/api/mcp",
)Symptoms:
[FAILED] AZURE STORAGE AUTHENTICATION FAILEDmessages- Agents unable to save or read blob content
Solutions:
# Check environment variables
echo $STORAGE_ACCOUNT_NAME
echo $AZURE_STORAGE_CONNECTION_STRING
# Verify Azure CLI authentication
az account show
az storage account list
# Test blob access directly
az storage blob list --account-name $STORAGE_ACCOUNT_NAME --container-name defaultAuthentication Checklist:
- ✅
STORAGE_ACCOUNT_NAMEenvironment variable set - ✅ Azure CLI authenticated (
az login) - ✅ Storage account exists and accessible
- ✅ Proper RBAC permissions (Storage Blob Data Contributor)
Symptoms:
- Timeout errors when calling MCP tools
- Server not responding to tool calls
Solutions:
# Check if UV is available
uv --version
# Test MCP server directly
cd src/plugins/mcp_server/mcp_blob_io_operation
uv run mcp_blob_io_operation.py
# Check Python environment
python --version
which pythonProcess Checklist:
- ✅ UV package manager installed
- ✅ Python 3.12+ available
- ✅ Virtual environment activated
- ✅ Required dependencies installed
Symptoms:
- Documentation search returns no results
- HTTP connection timeouts
Solutions:
# Test HTTP connectivity
curl -I https://learn.microsoft.com/api/mcp
# Check semantic-kernel MCP support
python -c "from semantic_kernel.connectors.mcp import MCPStreamableHttpPlugin; print('MCP support available')"Connection Checklist:
- ✅ Internet connectivity available
- ✅ No firewall blocking HTTP requests
- ✅ Semantic Kernel with MCP support installed
For additional information, refer to: