You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to your first steps with the Model Context Protocol (MCP)! Whether you're new to MCP or looking to deepen your understanding, this guide will walk you through the essential setup and development process. You'll discover how MCP enables seamless integration between AI models and applications, and learn how to quickly get your environment ready for building and testing MCP-powered solutions.
13
13
14
-
> TLDR; If you build AI apps, you know that you can add tools and other resources to your LLM (large language model) to make the LLM more knowledgeable. However, if you place those tools and resources on a server, the app and the server capabilities can be used by any client with or without an LLM.
14
+
> TLDR; If you build AI apps, you know that you can add tools and other resources to your LLM (large language model), to make the LLM more knowledgeable. However, if you place those tools and resources on a server, the app and the server capabilities can be used by any client with/without an LLM.
15
15
16
16
## Overview
17
17
18
18
This lesson provides practical guidance on setting up MCP environments and building your first MCP applications. You'll learn how to set up the necessary tools and frameworks, build basic MCP servers, create host applications, and test your implementations.
19
19
20
-
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications—it provides a standardized way to connect AI models to different data sources and tools.
20
+
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools.
21
21
22
22
## Learning Objectives
23
23
@@ -136,8 +136,8 @@ Before you begin testing your MCP server, it's important to understand the avail
136
136
137
137
MCP provides tools to help you test and debug your servers:
138
138
139
-
-**Inspector tool**: This graphical interface allows you to connect to your server and test your tools, prompts, and resources.
140
-
-**curl**: You can also connect to your server using a command-line tool like curl or other clients that can create and run HTTP commands.
139
+
-**Inspector tool**, this graphical interface allows you to connect to your server and test your tools, prompts, and resources.
140
+
-**curl**, you can also connect to your server using a commandline tool like curl or other clients that can create and run HTTP commands.
141
141
142
142
### Using MCP Inspector
143
143
@@ -184,25 +184,25 @@ npm run start
184
184
# Server running at http://localhost:3000
185
185
```
186
186
187
-
## Building Your First MCP Server
187
+
## Building your first MCP Server
188
188
189
-
We've covered [Core concepts](/01-CoreConcepts/README.md) in a previous lesson; now it's time to put that knowledge to work.
189
+
We've covered [Core concepts](/01-CoreConcepts/README.md) in a previous lesson, now it's time to put that knowledge to work.
190
190
191
-
### What a Server Can Do
191
+
### What a server can do
192
192
193
193
Before we start writing code, let's just remind ourselves what a server can do:
194
194
195
-
An MCP server can, for example:
195
+
An MCP server can for example:
196
196
197
197
- Access local files and databases
198
198
- Connect to remote APIs
199
199
- Perform computations
200
200
- Integrate with other tools and services
201
201
- Provide a user interface for interaction
202
202
203
-
Great, now that we know what we can do with it, let's start coding.
203
+
Great, now that we know what we can do for it, let's start coding.
204
204
205
-
## Exercise: Creating a Server
205
+
## Exercise: Creating a server
206
206
207
207
To create a server, you need to follow these steps:
208
208
@@ -211,7 +211,7 @@ To create a server, you need to follow these steps:
211
211
- Write the server code.
212
212
- Test the server.
213
213
214
-
### -1- Create Project
214
+
### -1- Create project
215
215
216
216
#### TypeScript
217
217
@@ -372,7 +372,7 @@ cd calculator-server
372
372
cargo init
373
373
```
374
374
375
-
### -2- Add Dependencies
375
+
### -2- Add dependencies
376
376
377
377
Now that you have your project created, let's add dependencies next:
378
378
@@ -411,7 +411,7 @@ cargo add serde
411
411
cargo add tokio --features rt-multi-thread
412
412
```
413
413
414
-
### -3- Create Project Files
414
+
### -3- Create project files
415
415
416
416
#### TypeScript
417
417
@@ -424,8 +424,8 @@ Open the *package.json* file and replace the content with the following to ensur
424
424
"main": "index.js",
425
425
"type": "module",
426
426
"scripts": {
427
-
"start": "tsc && node ./build/index.js",
428
-
"build": "tsc && node ./build/index.js"
427
+
"build": "tsc",
428
+
"start": "npm run build && node ./build/index.js",
429
429
},
430
430
"keywords": [],
431
431
"author": "",
@@ -494,7 +494,7 @@ For Java Spring Boot projects, the project structure is created automatically.
494
494
495
495
For Rust, a *src/main.rs* file is created by default when you run `cargo init`. Open the file and delete the default code.
496
496
497
-
### -4- Create Server Code
497
+
### -4- Create server code
498
498
499
499
#### TypeScript
500
500
@@ -512,7 +512,7 @@ const server = new McpServer({
512
512
});
513
513
```
514
514
515
-
Now you have a server, but it doesn't do much. Let's fix that.
515
+
Now you have a server, but it doesn't do much, let' fix that.
516
516
517
517
#### Python
518
518
@@ -829,6 +829,8 @@ Calculator MCP Server v1.0
829
829
Spring Boot MCP Application
830
830
```
831
831
832
+
</details>
833
+
832
834
#### Rust
833
835
834
836
Add the following code to the top of the *src/main.rs* file. This imports the necessary libraries and modules for your MCP server.
0 commit comments