Content
# MCP Control STM32
## MCP Section
### 1. Download Source Code
```bash
git clone https://github.com/ana52070/MCP_Control_STM32.git
cd MCP_Control_STM32
cd mcp-led_oled
```
### 2. Create and Activate Virtual Environment
To avoid dependency conflicts between different projects, it is recommended to use a virtual environment. Create and activate a virtual environment based on your operating system and Python version:
#### For Python 3.3 and above
```bash
python -m venv .venv
```
#### Activate Virtual Environment on Windows
```bash
.venv\Scripts\activate
```
#### Activate Virtual Environment on Linux or macOS
```bash
source .venv/bin/activate
```
### 3. Install Dependencies
Install dependencies directly using `pip`:
```bash
pip install httpx>=0.28.1 mcp>=1.8.0 openai>=1.78.0 python-dotenv>=1.1.0
```
### 4. Modify Code
Change the `.env` file to specify your own large language model, with the default set to ollama:
```
BASE_URL=http://localhost:11434/v1/
MODEL=qwen2.5:1.5b
OPENAI_API_KEY=ollama
```
If you are using the DeepSeek model, you need to write the following content in the `.env` file:
```
BASE_URL=https://api.deepseek.com
MODEL=deepseek-chat
OPENAI_API_KEY="DeepSeek API-Key"
```
Modify the serial port configuration in `server-led.py`:
```
# Serial Port Configuration
SERIAL_PORT = "COM1"
BAUDRATE = 115200
TIMEOUT = 1 # seconds
```
### 5. Run MCP Code
```
python client.py server-led.py
```
## STM32 Section
```
cd MCP_Control_STM32
```
Compile and program using Keil5, with the model being STM32F103C8T6.
Alternatively, you can manually program using the hex file:
```
MCP_Control_STM32\STM32_Project\Objects\Project.hex
```
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.