|
1 | 1 | # Part 1: Prerequisites and Setup (Python) |
2 | 2 |
|
3 | | -> **Navigation**: [← Back to Overview](README-python.md) | [Next: Part 2 - Game App →](part2-game-app-python.md) |
4 | | -
|
5 | 3 | ## What You'll Need |
6 | 4 | Before diving into MCP development, ensure you have the following tools installed: |
7 | 5 |
|
8 | | -### 1. Visual Studio Code |
| 6 | +### 2.1 Project Setup |
| 7 | + |
| 8 | +If you haven't already set up your python environment: |
| 9 | + |
| 10 | +### 2.1.1. Visual Studio Code |
9 | 11 | - Download and install [VS Code](https://code.visualstudio.com/) |
10 | 12 | - Essential for MCP development and integration |
11 | 13 |
|
12 | | -### 2. Python 3.12+ |
| 14 | +### 2.1.2. Python 3.12+ |
13 | 15 | - Install Python 3.12 or later from [Python.org](https://www.python.org/downloads/) |
14 | 16 | - Verify installation: `python --version` or `python3 --version` |
15 | 17 | - Ensure pip is installed: `pip --version` or `pip3 --version` |
16 | 18 |
|
17 | | -### 3. Python Extension for VS Code |
| 19 | +### 2.1.3. Python Extension for VS Code |
18 | 20 | - Install the [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) extension |
19 | 21 | - Provides comprehensive Python development support |
20 | 22 | - Includes IntelliSense, debugging, and virtual environment management |
21 | 23 |
|
22 | | -### 4. Node.js |
23 | | -- Download and install [Node.js](https://nodejs.org/) (LTS version recommended) |
24 | | -- Required for MCP Inspector and other MCP development tools |
25 | | -- Verify installation: `node --version` and `npm --version` |
26 | | -- Enables npm package management for MCP tooling |
| 24 | +### 2.1.4. Install UV |
| 25 | +To install UV, run the following command in the terminal: |
| 26 | + |
| 27 | +```bash |
| 28 | +pip install uv |
| 29 | +``` |
| 30 | + |
| 31 | +### 2.1.5. Create Virtual Environment |
| 32 | + |
| 33 | +```bash |
| 34 | +# Using venv (recommended) |
| 35 | +python -m venv mcp-env |
| 36 | + |
| 37 | +# Activate on macOS/Linux |
| 38 | +source mcp-env/bin/activate |
| 39 | + |
| 40 | +# Activate on Windows |
| 41 | +mcp-env\Scripts\activate |
| 42 | +``` |
| 43 | + |
| 44 | +### 2.1.6. Install packages |
| 45 | + |
| 46 | +```bash |
| 47 | +uv sync |
| 48 | +``` |
27 | 49 |
|
28 | | -### 5. Docker Desktop |
29 | | -- Download and install [Docker Desktop](https://www.docker.com/products/docker-desktop/) |
30 | | -- Required for running MCP servers in containers |
31 | | -- Verify installation: `docker --version` |
32 | | -- Ensure Docker Desktop is running before starting MCP servers |
| 50 | +### 4. Understanding MCP |
33 | 51 |
|
34 | | -### 6. Understanding MCP |
| 52 | +Next lets look at the following topics: |
35 | 53 | - What is Model Context Protocol? |
36 | 54 | - How MCP Servers work with AI assistants |
37 | 55 | - The client-server architecture |
38 | 56 | - Use cases and benefits |
39 | 57 |
|
40 | | -## Environment Verification |
41 | | -- [ ] VS Code installed and running |
42 | | -- [ ] Python 3.12+ installed |
43 | | -- [ ] Python extension active in VS Code |
44 | | -- [ ] Node.js and npm installed |
45 | | -- [ ] Docker Desktop installed and running |
46 | | -- [ ] Basic understanding of MCP concepts |
47 | 58 |
|
48 | 59 | ## What is Model Context Protocol (MCP)? |
49 | 60 |
|
@@ -89,39 +100,8 @@ The Model Context Protocol (MCP) is an open standard that enables AI assistants |
89 | 100 | - **Web Scraping**: Build intelligent data collection tools |
90 | 101 | - **API Integration**: Create bridges to external services |
91 | 102 |
|
92 | | -## Python Virtual Environment Setup |
93 | | - |
94 | | -It's highly recommended to use virtual environments for Python MCP development: |
95 | | - |
96 | | -### Create Virtual Environment |
97 | | -```bash |
98 | | -# Using venv (recommended) |
99 | | -python -m venv mcp-env |
100 | | - |
101 | | -# Activate on macOS/Linux |
102 | | -source mcp-env/bin/activate |
103 | | - |
104 | | -# Activate on Windows |
105 | | -mcp-env\Scripts\activate |
106 | | -``` |
107 | | - |
108 | | -### Install Core Dependencies |
109 | | -```bash |
110 | | -# Install MCP Python SDK |
111 | | -pip install mcp |
112 | | - |
113 | | -# Install development dependencies |
114 | | -pip install asyncio aiofiles |
115 | | -``` |
116 | | - |
117 | | -### VS Code Python Environment |
118 | | -1. Open VS Code in your project folder |
119 | | -2. Press `Ctrl+Shift+P` (Cmd+Shift+P on Mac) |
120 | | -3. Type "Python: Select Interpreter" |
121 | | -4. Choose the interpreter from your virtual environment |
122 | | - |
123 | 103 | --- |
124 | 104 |
|
125 | 105 | > **Next Step**: Now that you understand MCP and have your environment set up, let's build your first application that uses existing MCP servers. |
126 | 106 |
|
127 | | -**Continue to**: [Part 2 - Building MyGame App →](part2-game-app-python.md) |
| 107 | +**Continue to**: [Part 2 - Building a Study Buddy App →](part2-study-buddy.md) |
0 commit comments