// KI-integration
MCP-Server
Eidolon stellt einen Model Context Protocol (MCP)-Server bereit, der KI-Agenten (Claude, Cursor und andere) ermöglicht, Schaltungen zu erstellen, Code zu generieren und Arduino-Sketche direkt zu kompilieren.
Verfügbare Werkzeuge
| Werkzeug | Beschreibung |
|---|---|
compile_project | Arduino-Sketch-Dateien kompilieren - Intel HEX / Binär |
run_project | Kompilieren und Artefakt als simulationsbereit markieren |
import_wokwi_json | Ein Wokwi diagram.json parsen - Eidolon-Schaltung |
export_wokwi_json | Eine Eidolon-Schaltung serialisieren - Wokwi diagram.json |
create_circuit | Eine neue Schaltungsdefinition erstellen |
update_circuit | Änderungen in eine bestehende Schaltung einfügen |
generate_code_files | Starter-.ino-Code aus einer Schaltung generieren |
Transportoptionen
1. stdio: Claude Desktop / CLI-Agenten
cargo run --locked -p eidolon-mcpClaude Desktop-Konfiguration (claude_desktop_config.json):
1{
2 "mcpServers": {
3 "eidolon": {
4 "command": "/absolute/path/to/velxio/target/debug/eidolon-mcp"
5 }
6 }
7}2. SSE / HTTP: Cursor IDE / Web-Agenten
eidolon-mcp sse --host 127.0.0.1 --port 8002MCP-Client-Konfiguration:
1{
2 "mcpServers": {
3 "eidolon": { "url": "http://127.0.0.1:8002/sse" }
4 }
5}Schaltungsdatenformat
Eidolon-Schaltungen sind einfache JSON-Objekte:
1{
2 "board_fqbn": "arduino:avr:uno",
3 "version": 1,
4 "components": [
5 { "id": "led1", "type": "wokwi-led", "left": 200, "top": 100,
6 "rotate": 0, "attrs": { "color": "red" } }
7 ],
8 "connections": [
9 { "from_part": "uno", "from_pin": "13",
10 "to_part": "led1", "to_pin": "A", "color": "green" }
11 ]
12}Unterstützte Board-FQBNs
| Board | FQBN |
|---|---|
| Arduino Uno | arduino:avr:uno |
| Arduino Mega | arduino:avr:mega |
| Arduino Nano | arduino:avr:nano |
| Raspberry Pi Pico | rp2040:rp2040:rpipico |
Beispiel: LED-Blink von Grund auf
1// Step 1 — Create a circuit
2{
3 "tool": "create_circuit",
4 "arguments": {
5 "board_fqbn": "arduino:avr:uno",
6 "components": [
7 { "id": "led1", "type": "wokwi-led",
8 "left": 150, "top": 100, "attrs": { "color": "red" } },
9 { "id": "r1", "type": "wokwi-resistor",
10 "left": 150, "top": 180, "attrs": { "value": "220" } }
11 ],
12 "connections": [
13 { "from_part": "uno", "from_pin": "13",
14 "to_part": "led1", "to_pin": "A", "color": "green" },
15 { "from_part": "led1", "from_pin": "C",
16 "to_part": "r1", "to_pin": "1", "color": "black" },
17 { "from_part": "r1", "from_pin": "2",
18 "to_part": "uno", "to_pin": "GND.1", "color": "black" }
19 ]
20 }
21}
22
23// Step 2 — Generate code
24{
25 "tool": "generate_code_files",
26 "arguments": {
27 "circuit": "<result from Step 1>",
28 "sketch_name": "blink",
29 "extra_instructions": "Blink the red LED every 500ms"
30 }
31}
32
33// Step 3 — Compile
34{
35 "tool": "compile_project",
36 "arguments": {
37 "files": [
38 {
39 "name": "blink.ino",
40 "content": "void setup(){pinMode(13,OUTPUT);}\nvoid loop(){digitalWrite(13,HIGH);delay(500);digitalWrite(13,LOW);delay(500);}"
41 }
42 ],
43 "board": "arduino:avr:uno"
44 }
45}Einrichtung
cargo build --locked -p eidolon-mcp
arduino-cli version
arduino-cli core update-index
arduino-cli core install arduino:avr
cargo test --locked -p eidolon-mcpVollständige Referenz: Siehe docs/MCP.md im Repository.