Skip to content

Commit d58dac8

Browse files
authored
Merge branch 'main' into patch-2
2 parents 3aa9d28 + 52e9746 commit d58dac8

File tree

12 files changed

+1829
-136
lines changed

12 files changed

+1829
-136
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,5 @@ cython_debug/
172172

173173
# PyPI configuration file
174174
.pypirc
175+
176+
.DS_Store

quiz/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# MCP Course quiz scripts

quiz/data/unit_1.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"question": "Which of the following best describes a Large Language Model (LLM)?",
4+
"answer_a": "A model specializing in language recognition",
5+
"answer_b": "A massive neural network that understands and generates human language",
6+
"answer_c": "A model exclusively used for language data tasks like summarization or classification",
7+
"answer_d": "A rule-based chatbot used for conversations",
8+
"correct_answer": "B"
9+
}
10+
]

quiz/push_questions.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import json
2+
from pathlib import Path
3+
from datasets import Dataset
4+
5+
ORG_NAME = "mcp-course"
6+
7+
8+
def main():
9+
"""Push quiz questions to the Hugging Face Hub"""
10+
11+
for file in Path("data").glob("*.json"):
12+
print(f"Processing {file}")
13+
14+
with open(file, "r") as f:
15+
quiz_data = json.load(f)
16+
17+
repo_id = f"{ORG_NAME}/{file.stem}_quiz"
18+
19+
dataset = Dataset.from_list(quiz_data)
20+
21+
print(f"Pushing {repo_id} to the Hugging Face Hub")
22+
23+
dataset.push_to_hub(
24+
repo_id,
25+
private=True,
26+
commit_message=f"Update quiz questions for {file.stem}",
27+
)
28+
29+
30+
if __name__ == "__main__":
31+
main()

quiz/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[project]
2+
name = "agents-course"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.11"
7+
dependencies = [
8+
"datasets>=3.2.0",
9+
"huggingface-hub>=0.27.1",
10+
"ipykernel>=6.29.5",
11+
"requests>=2.32.3",
12+
]

quiz/uv.lock

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

units/en/_toctree.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,22 @@
1111
title: Key Concepts and Terminology
1212
- local: unit1/architectural-components
1313
title: Architectural Components
14+
- local: unit1/quiz1
15+
title: Quiz 1 - MCP Fundamentals
1416
- local: unit1/communication-protocol
1517
title: The Communication Protocol
1618
- local: unit1/capabilities
1719
title: Understanding MCP Capabilities
1820
- local: unit1/sdk
1921
title: MCP SDK
22+
- local: unit1/quiz2
23+
title: Quiz 2 - MCP SDK
2024
- local: unit1/mcp-clients
2125
title: MCP Clients
2226
- local: unit1/gradio-mcp
2327
title: Gradio MCP Integration
28+
- local: unit1/certificate
29+
title: Get your certificate!
2430

2531
- title: "2. Use Case: End-to-End MCP Application"
2632
sections:

units/en/unit1/certificate.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Get your certificate!
2+
3+
Well done! You've completed the first unit of the MCP course. Now it's time to take the exam to get your certificate.
4+
5+
Below is a quiz to check your understanding of the unit.
6+
7+
<iframe
8+
src="https://mcp-course-unit-1-quiz.hf.space"
9+
frameborder="0"
10+
width="850"
11+
height="450"
12+
></iframe>
13+
14+
<Tip>
15+
16+
If you're struggling to use the quiz above, go to the space directly [on the Hugging Face Hub](https://huggingface.co/spaces/mcp-course/unit_1_quiz). If you find errors, you can report them in the space's [Community tab](https://huggingface.co/spaces/mcp-course/unit_1_quiz/discussions).
17+
18+
</Tip>
19+

units/en/unit1/mcp-clients.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ You can also use the MCP Client in within code so that the tools are available t
224224
First, let's explore our weather server from the previous page. In `smolagents`, we can use the `ToolCollection` class to automatically discover and register tools from an MCP server. This is done by passing the `StdioServerParameters` or `SSEServerParameters` to the `ToolCollection.from_mcp` method. We can then print the tools to the console.
225225

226226
```python
227-
from smolagents import ToolCollection, CodeAgent
227+
from smolagents import ToolCollection
228228
from mcp.client.stdio import StdioServerParameters
229229

230230
server_parameters = StdioServerParameters(command="uv", args=["run", "server.py"])
@@ -242,7 +242,7 @@ Output
242242
</summary>
243243

244244
```sh
245-
Weather API: Get the weather in a specific location
245+
get_weather: Get the current weather for a specified location.
246246

247247
```
248248

@@ -306,6 +306,7 @@ The weather in Tokyo is sunny with a temperature of 20 degrees Celsius.
306306
We can also connect to an MCP package. Here's an example of connecting to the `pubmedmcp` package.
307307

308308
```python
309+
import os
309310
from smolagents import ToolCollection, CodeAgent
310311
from mcp import StdioServerParameters
311312

units/en/unit1/quiz1.mdx

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Quiz 1 - MCP Fundamentals
3+
---
4+
5+
# Quiz 1: MCP Fundamentals
6+
7+
Test your knowledge of the core concepts of Model Context Protocol.
8+
9+
### Q1: What is the primary purpose of Model Context Protocol (MCP)?
10+
11+
<Question
12+
choices={[
13+
{
14+
text: "To limit the training data of AI models",
15+
explain: "MCP aims to expand, not limit, the contexts AI models can access."
16+
},
17+
{
18+
text: "To enable AI models to connect with external data sources, tools, and environments",
19+
explain: "Correct! MCP's main goal is to facilitate interoperability.",
20+
correct: true
21+
},
22+
{
23+
text: "To replace prompting when using Large Language Models",
24+
explain: "MCP is a protocol that enhances prompting, not a replacement for it."
25+
},
26+
{
27+
text: "To create a new programming language for AI",
28+
explain: "MCP is a protocol, not a programming language."
29+
}
30+
]}
31+
/>
32+
33+
### Q2: What problem does MCP primarily aim to solve?
34+
35+
<Question
36+
choices={[
37+
{
38+
text: "The lack of AI models",
39+
explain: "MCP addresses integration challenges, not the availability of AI models themselves."
40+
},
41+
{
42+
text: "The high cost of training LLMs",
43+
explain: "While MCP can improve efficiency, its primary focus is not on reducing training costs directly."
44+
},
45+
{
46+
text: "The M×N Integration Problem",
47+
explain: "Correct! MCP standardizes connections to avoid M×N custom integrations.",
48+
correct: true
49+
},
50+
{
51+
text: "The difficulty in creating new AI algorithms",
52+
explain: "MCP facilitates using existing algorithms and tools, not creating new ones from scratch."
53+
}
54+
]}
55+
/>
56+
57+
### Q3: Which of the following is a key benefit of MCP?
58+
59+
<Question
60+
choices={[
61+
{
62+
text: "Reduced AI model accuracy",
63+
explain: "MCP aims to enhance AI capabilities, which should ideally lead to improved or maintained accuracy, not reduced."
64+
},
65+
{
66+
text: "Increased complexity in AI development",
67+
explain: "MCP aims to simplify integration, thereby reducing complexity."
68+
},
69+
{
70+
text: "Standardization and interoperability in the AI ecosystem",
71+
explain: "Correct! This is a primary goal and benefit of MCP.",
72+
correct: true
73+
},
74+
{
75+
text: "Isolation of AI models from external systems",
76+
explain: "MCP promotes connection and interaction, not isolation."
77+
}
78+
]}
79+
/>
80+
81+
### Q4: In MCP terminology, what is a "Host"?
82+
83+
<Question
84+
choices={[
85+
{
86+
text: "The external program exposing capabilities",
87+
explain: "This describes an MCP Server."
88+
},
89+
{
90+
text: "The user-facing AI application",
91+
explain: "Correct! The Host is the application users interact with.",
92+
correct: true
93+
},
94+
{
95+
text: "A read-only data source",
96+
explain: "This describes a type of MCP Capability (Resource)."
97+
},
98+
{
99+
text: "A pre-defined template for interactions",
100+
explain: "This describes a type of MCP Capability (Prompt)."
101+
}
102+
]}
103+
/>
104+
105+
### Q5: What does "M×N Integration Problem" refer to in the context of AI applications?
106+
107+
<Question
108+
choices={[
109+
{
110+
text: "The difficulty of training M models with N datasets",
111+
explain: "This relates to model training, not the integration problem MCP addresses."
112+
},
113+
{
114+
text: "The challenge of connecting M AI applications to N external tools without a standard",
115+
explain: "Correct! MCP provides the standard to solve this M*N complexity.",
116+
correct: true
117+
},
118+
{
119+
text: "The problem of managing M users across N applications",
120+
explain: "This is a user management or identity problem, not the focus of MCP."
121+
},
122+
{
123+
text: "The complexity of developing M features for N different user segments",
124+
explain: "This relates to product development strategy, not system integration in the way MCP defines."
125+
}
126+
]}
127+
/>
128+
129+
Congrats on finishing this Quiz 🥳! If you need to review any elements, take the time to revisit the chapter to reinforce your knowledge.

0 commit comments

Comments
 (0)