Arduino MCP Serverのロゴ

Arduino MCP Server

コミュニティ
AimanMadan

Control an Arduino board from your computer using AI commands.

公開者AimanMadan
リポジトリArduino_MCP_Server
言語Python
フォーク
3
スター
11
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    Arduino MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには11件のスターと3件のフォークがあります。

Arduino MCP Server: Control Your Arduino with AI!

Welcome to the Arduino MCP Server project! This project lets you control an Arduino board from your computer using a special connection called MCP (Model Context Protocol). Think of it like giving instructions to your Arduino using a smart AI assistant!

What is this project for?

In this project, we're building a "server" that listens for commands from an AI (like Claude Desktop). When the AI tells it to, our Arduino will turn on or off some LEDs. This is a super cool way to see how AI can interact with the real world!

What you'll need

Before we start, make sure you have:

  • An Arduino board: Any Arduino board like an Uno or Nano will work.
  • Two LEDs: One white and one red.
  • Two 1k Resistors: These are important to protect your LEDs.
  • Jumper wires: To connect everything.
  • USB cable: To connect your Arduino to your computer.
  • Claude Desktop: This is the AI assistant we'll be using.
  • Python 3.12 or higher: Our code is written in Python.
  • uv (Ultrafast Python package installer and resolver): We use this to manage our Python libraries.
  • Claude Desktop

How to set up your Arduino

  1. Connect the LEDs:

    • White LED: Connect the longer leg (positive) of the white LED to Digital Pin 12 on your Arduino through a 220 Ohm resistor. Connect the shorter leg (negative) to a GND (Ground) pin on your Arduino.
    • Red LED: Connect the longer leg (positive) of the red LED to Digital Pin 11 on your Arduino through a 220 Ohm resistor. Connect the shorter leg (negative) to a GND (Ground) pin on your Arduino.

    (Remember to always use a resistor with LEDs to prevent them from burning out!)

  2. Upload the StandardFirmataPlus sketch:

    • Open the Arduino IDE (Integrated Development Environment).
    • Go to Library Library Manager > Search and download Firmata
    • Go to File > Examples > Firmata > StandardFirmata.
    • Select your Arduino board from Tools > Board.
    • Select the correct Port from Tools > Port.
    • Upload the StandardFirmata sketch to your Arduino board. This program allows Python to control your Arduino.

Getting the Python code ready

  1. Download the project: If you haven't already, download or clone this project to your computer.

  2. Open your terminal/command prompt: Navigate to the folder where you saved this project.

  3. Install Python dependencies: We'll use uv to install everything our Python code needs.

    bash
    uv pip install

    This command reads the pyproject.toml file and installs the fastmcp and pyfirmata2 libraries.

Understanding the Python Code (main.py)

Let's take a quick look at the main parts of our Python code:

  • from fastmcp import FastMCP: This line imports the FastMCP library, which helps us create our MCP server.
  • import pyfirmata2: This line imports pyfirmata2, which is a library that lets Python talk to your Arduino.
  • Arduino = pyfirmata2.Arduino('/dev/cu.usbmodem212201'): IMPORTANT! You need to change '/dev/cu.usbmodem212201' to the COM port that your Arduino is connected to. You can find this in the Arduino IDE under Tools > Port. It might look something like COM3 on Windows or /dev/ttyUSB0 on Linux.
  • @ArduinoMCP.tool: These special lines (@ArduinoMCP.tool) are called "decorators." They tell FastMCP that the function right below them is a "tool" that the AI client can use.
  • white_led_ON(), red_led_ON(), led_OFF(): These are our functions (mini-programs) that tell the Arduino to turn the white LED on, the red LED on, or both LEDs off.
  • ArduinoMCP.run(): This line starts our MCP server, making it ready to receive commands!

Setting up Claude Desktop

Now, let's tell Claude Desktop how to connect to our Arduino server.

  1. Open your MCP Client in this case Claude Desktop
  2. Go to Settings > Developer > Edit Config > and open the config file claude_desktop_config.json
  3. Copy and paste what is below and update the path:
    json
    {
        "mcpServers": {
            "arduino": {
                "command": "/Users/aiman/.local/bin/uv", # this too
                "args": [
                    "--directory",
                    "/Users/aiman/Dev/Arduino_MCP", # update to the path 
                    "run",
                    "main.py"
                ]
            }
        }
    }
    • "command": This should be the full path to your uv executable. If you're on Windows, it might be something like C:\Users\YourUser\AppData\Local\uv\uv.exe. On macOS/Linux, it's often in your user's local bin directory as shown.
    • "--directory": This should be the full path to the Arduino_MCP folder on your computer where your main.py file is located. Make sure this path is correct!
    • "run", "main.py": These tell uv to run your main.py script.

Running the Project!

  1. Start Claude Desktop.

  2. The MCP server should start automatically. Claude Desktop will use the claude_desktop_config.json file to launch your Arduino MCP server.

  3. Talk to Claude! Now you can ask Claude to control your Arduino. Try saying things like:

    • "Turn on the white LED."
    • "Turn on the red LED."
    • "Turn off all LEDs."

    Claude Desktop will understand your commands and send them to your Arduino MCP server, which will then tell your Arduino what to do!

Have fun controlling your Arduino with AI! This is just the beginning of what you can do!

Arduino MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Arduino MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Arduino MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Arduino MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "aimanmadan-arduino-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてArduino MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Arduino MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Arduino MCP Serverを使ってこのタスクを手伝ってもらえますか?
Arduino MCP Server
はい、読みました。
Arduino MCP Serverで調べた結果をお伝えします。

よくある質問

Arduino MCP Server MCPサーバーは何に使いますか?

Arduino MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでArduino MCP Server MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでArduino MCP Serverを利用できます。

TypingMindでArduino MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。Arduino MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Arduino MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Arduino MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでArduino MCP Server MCPのどのようなツールを利用できますか?

Arduino MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Arduino MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Arduino MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇