Skip to content

Commit 1f07cd3

Browse files
author
Chris
committed
splitting up into dedicated chapters
1 parent 3b26755 commit 1f07cd3

File tree

11 files changed

+632
-91
lines changed

11 files changed

+632
-91
lines changed

05-AdvancedTopics/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Advanced Topics in MCP
22

3+
This chapter is meant to cover a series of advanced topics in Model Context Protocol (MCP) implementation, including multi-modal integration, scalability, security best practices, and enterprise integration. These topics are crucial for building robust and production-ready MCP applications that can meet the demands of modern AI systems.
4+
35
## Overview
46

57
This lesson explores advanced concepts in Model Context Protocol implementation, focusing on multi-modal integration, scalability, security best practices, and enterprise integration. These topics are essential for building production-grade MCP applications that can handle complex requirements in enterprise environments.
68

79
## Learning Objectives
810

911
By the end of this lesson, you will be able to:
12+
1013
- Implement multi-modal capabilities within MCP frameworks
1114
- Design scalable MCP architectures for high-demand scenarios
1215
- Apply security best practices aligned with MCP's security principles
@@ -17,15 +20,15 @@ By the end of this lesson, you will be able to:
1720

1821
| Link | Title | Description |
1922
|------|-------|-------------|
20-
| [MCP OAuth2 sample](./mcp-oauth2-demo/) | MCP OAuth2 Demo | Minimal Spring Boot app showing OAuth2 with MCP, both as Authorization and Resource Server. Demonstrates secure token issuance, protected endpoints, Azure Container Apps deployment, and API Management integration. |
21-
| [Web Search sample](./web-search-mcp/) | Web Search MCP | Python MCP server and client integrating with SerpAPI for real-time web, news, product search, and Q&A. Demonstrates multi-tool orchestration, external API integration, and robust error handling. |
22-
| [Multi modal sample](./mcp-multi-modality/README.md) | MCP Multi modal samples | Samples for audio, image and multi modal response |
23-
| [Integration with Azure](./mcp-integration/README.md) | Integrate with Azure | Learn how to integrate your MCP Server on Azure |
24-
| [Root Contexts](./mcp-root-contexts/README.md) | Root contexts | Learn more about root context and how to implement them |
25-
| [Routing](./mcp-routing/README.md) | Routing | Learn different types of routing |
26-
| [Sampling](./mcp-sampling/README.md) | Sampling | Learn how to work with sampling |
27-
| [Scaling](./mcp-scaling/README.md) | Scaling | Learn about scaling |
28-
| [Security](./mcp-security/README.md) | Security | Secure your MCP Server |
23+
| [5.1 Integration with Azure](./mcp-integration/README.md) | Integrate with Azure | Learn how to integrate your MCP Server on Azure |
24+
| [5.2 Multi modal sample](./mcp-multi-modality/README.md) | MCP Multi modal samples | Samples for audio, image and multi modal response |
25+
| [5.3 MCP OAuth2 sample](./mcp-oauth2-demo/) | MCP OAuth2 Demo | Minimal Spring Boot app showing OAuth2 with MCP, both as Authorization and Resource Server. Demonstrates secure token issuance, protected endpoints, Azure Container Apps deployment, and API Management integration. |
26+
| [5.4 Root Contexts](./mcp-root-contexts/README.md) | Root contexts | Learn more about root context and how to implement them |
27+
| [5.5 Routing](./mcp-routing/README.md) | Routing | Learn different types of routing |
28+
| [5.6 Sampling](./mcp-sampling/README.md) | Sampling | Learn how to work with sampling |
29+
| [5.7 Scaling](./mcp-scaling/README.md) | Scaling | Learn about scaling |
30+
| [5.8 Security](./mcp-security/README.md) | Security | Secure your MCP Server |
31+
| [5.9 Web Search sample](./web-search-mcp/README.md) | Web Search MCP | Python MCP server and client integrating with SerpAPI for real-time web, news, product search, and Q&A. Demonstrates multi-tool orchestration, external API integration, and robust error handling. |
2932

3033
## Additional References
3134

@@ -61,4 +64,4 @@ Design an enterprise-grade MCP implementation for a specific use case:
6164

6265
## What's next
6366

64-
- [5.1 MCP OAuth2 Demo](./mcp-oauth2-demo/README.md)
67+
- [5.1 MCP Integration](./mcp-integration/README.md)

05-AdvancedTopics/mcp-integration/README.md

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1-
## Enterprise Integration
1+
# Enterprise Integration
22

3-
Integrating MCP with enterprise systems like Azure OpenAI and Microsoft AI Foundry.
3+
When building MCP Servers in an enterprise context, you often need to integrate with existing AI platforms and services. This section covers how to integrate MCP with enterprise systems like Azure OpenAI and Microsoft AI Foundry, enabling advanced AI capabilities and tool orchestration.
44

5-
### Azure OpenAI Integration
5+
## Introduction
6+
7+
In this lesson, you'll learn how to integrate Model Context Protocol (MCP) with enterprise AI systems, focusing on Azure OpenAI and Microsoft AI Foundry. These integrations allow you to leverage powerful AI models and tools while maintaining the flexibility and extensibility of MCP.
8+
9+
## Learning Objectives
10+
11+
By the end of this lesson, you will be able to:
12+
13+
- Integrate MCP with Azure OpenAI to utilize its AI capabilities.
14+
- Implement MCP tool orchestration with Azure OpenAI.
15+
- Combine MCP with Microsoft AI Foundry for advanced AI agent capabilities.
16+
- Leverage Azure Machine Learning (ML) for executing ML pipelines and registering models as MCP tools.
17+
18+
## Azure OpenAI Integration
19+
20+
Azure OpenAI provides access to powerful AI models like GPT-4 and others. Integrating MCP with Azure OpenAI allows you to utilize these models while maintaining the flexibility of MCP's tool orchestration.
21+
22+
<details>
23+
<summary>csharp</summary>
24+
25+
In this code snippet, we demonstrate how to integrate MCP with Azure OpenAI using the Azure OpenAI SDK.
626

727
```csharp
828
// .NET Azure OpenAI Integration
@@ -66,7 +86,24 @@ namespace EnterpriseIntegration
6686
}
6787
```
6888

69-
### Microsoft AI Foundry Integration
89+
In the preceding code we've:
90+
91+
- Configured the Azure OpenAI client with the endpoint, deployment name and API key.
92+
- Created a method `GetCompletionWithToolsAsync` to get completions with tool support.
93+
- Handled tool calls in the response.
94+
95+
You're encouraged to implement the actual tool handling logic based on your specific MCP server setup.
96+
97+
</details>
98+
99+
## Microsoft AI Foundry Integration
100+
101+
Azure AI Foundry provides a platform for building and deploying AI agents. Integrating MCP with AI Foundry allows you to leverage its capabilities while maintaining the flexibility of MCP.
102+
103+
In the below code, we develop an Agent integration that processes requests and handles tool calls using MCP.
104+
105+
<details>
106+
<summary>Java</summary>
70107

71108
```java
72109
// Java AI Foundry Agent Integration
@@ -124,7 +161,20 @@ public class AIFoundryMcpBridge {
124161
}
125162
```
126163

127-
### Python Enterprise Integration Example
164+
In the preceding code, we've:
165+
166+
- Created an `AIFoundryMcpBridge` class that integrates with both AI Foundry and MCP.
167+
- Implemented a method `processAgentRequest` that processes an AI Foundry agent request.
168+
- Handled tool calls by executing them through the MCP client and submitting the results back to the AI Foundry agent.
169+
170+
</details>
171+
172+
## Integrating MCP with Azure ML
173+
174+
Integrating MCP with Azure Machine Learning (ML) allows you to leverage Azure's powerful ML capabilities while maintaining the flexibility of MCP. This integration can be used to execute ML pipelines, register models as tools, and manage compute resources.
175+
176+
<details>
177+
<summary>Python</summary>
128178

129179
```python
130180
# Python Azure AI Integration
@@ -247,3 +297,17 @@ class EnterpriseAiIntegration:
247297
}
248298
return mapping.get(ml_type, "string")
249299
```
300+
301+
In the preceding code, we've:
302+
303+
- Created an `EnterpriseAiIntegration` class that integrates MCP with Azure ML.
304+
- Implemented an `execute_ml_pipeline` method that processes input data using MCP tools and submits an ML pipeline to Azure ML.
305+
- Implemented a `register_ml_model_as_tool` method that registers an Azure ML model as an MCP tool, including creating the necessary deployment environment and compute resources.
306+
- Mapped Azure ML data types to JSON schema types for tool registration.
307+
- Used asynchronous programming to handle potentially long-running operations like ML pipeline execution and model registration.
308+
309+
</details>
310+
311+
## What's next
312+
313+
- [Multi modality](../mcp-multi-modality/README.md)

05-AdvancedTopics/mcp-multi-modality/README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Multi-Modal Integration
22

3-
MCP supports not just text-based interactions but also multi-modal capabilities, allowing models to work with images, audio, and other data types.
3+
Multi-modal applications are becoming increasingly important in AI, enabling richer interactions and more complex tasks. The Model Context Protocol (MCP) provides a framework for building multi-modal applications that can handle various types of data, such as text, images, and audio.
44

5-
This chapter demonstrates how to build a real-world multi modal application.
5+
MCP supports not just text-based interactions but also multi-modal capabilities, allowing models to work with images, audio, and other data types.
66

77
## Introduction
88

@@ -19,12 +19,12 @@ By the end of this lesson, you will be able to:
1919

2020
Multi-modal MCP implementations typically involve:
2121

22-
- **Modal-Specific Parsers**: Components that convert different media types into formats the model can process
22+
- **Modal-Specific Parsers**: Components that convert different media types into formats the model can process.
2323
- **Modal-Specific Tools**: Special tools designed to handle specific modalities (image analysis, audio processing)
2424
- **Unified Context Management**: System to maintain context across different modalities
25-
- **Response Generation**: Capability to generate responses that may include multiple modalities
25+
- **Response Generation**: Capability to generate responses that may include multiple modalities.
2626

27-
### Multi-Modal Example: Image Analysis
27+
## Multi-Modal Example: Image Analysis
2828

2929
In the below example, we will analyze an image and extract information.
3030

@@ -161,13 +161,25 @@ namespace MultiModalMcpExample
161161
}
162162
```
163163

164+
In the preceding example, we've:
165+
166+
- Created an `ImageAnalysisTool` that can analyze images using a hypothetical `IImageAnalysisService`.
167+
- Configured the MCP server to handle larger requests and support image content types.
168+
- Registered the image analysis tool with the server.
169+
- Implemented a method to download images from a URL and analyze them based on the requested type (objects, text, faces, etc.).
170+
- Returned structured results in a format compliant with the MCP specification.
171+
164172
</details>
165173

166-
### Multi-Modal Example: Audio Processing
174+
## Multi-Modal Example: Audio Processing
175+
176+
Audio processing is another common modality in multi-modal applications. Below is an example of how to implement an audio transcription tool that can handle audio files and return transcriptions.
167177

168178
<details>
169179
<summary>Java</summary>
170180

181+
Let's implement an audio transcription tool:
182+
171183
```java
172184
package com.example.mcp.multimodal;
173185

@@ -294,6 +306,17 @@ public class MultiModalApplication {
294306
}
295307
```
296308

309+
In the preceding example, we've:
310+
311+
- Created an `AudioTranscriptionTool` that can transcribe audio files.
312+
- Defined the tool's schema to accept either a URL or base64-encoded audio data.
313+
- Implemented the `execute` method to handle audio processing and transcription.
314+
- Configured the MCP server to handle multi-modal requests, including audio and image processing.
315+
- Registered the audio transcription tool with the server.
316+
- Implemented a method to download audio files from a URL or decode base64 audio data.
317+
- Used an `AudioProcessor` service to handle the actual transcription logic.
318+
- Started the MCP server to listen for requests.
319+
297320
</details>
298321

299322
### Multi-Modal Example: Multi-Modal Response Generation
@@ -449,3 +472,7 @@ if __name__ == "__main__":
449472
```
450473

451474
</details>
475+
476+
## What's next
477+
478+
- [Oauth 2](../mcp-oauth2-demo/README.md)

05-AdvancedTopics/mcp-oauth2-demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ APIM will fetch the JWKS and validate every request.
113113

114114
## What's next
115115

116-
- [5.2 Web Search MCP Sample](../web-search-mcp/README.md)
116+
- [Root contexts](../mcp-root-contexts/README.md)

0 commit comments

Comments
 (0)