Schemdraw MCP Server
Enables AI assistants like Claude to create and edit electronic circuit diagrams using the schemdraw library through the Model Context Protocol.
README
Schemdraw MCP Server
回路図描画ライブラリ schemdraw のための Model Context Protocol (MCP) サーバーです。Claude や他の AI アシスタントが電子回路図を作成・編集できるようになります。
🌟 機能
- 回路図作成: 基本的な電子回路素子(抵抗、コンデンサ、ダイオード等)の配置
- 自動レイアウト: コンポーネント間の接続と最適な配置
- 多様な出力形式: PNG、SVG、PDF 形式での回路図出力
- 柔軟な構成: シンプルな回路からループ回路まで対応
- リアルタイム編集: 回路の動的な変更と更新
📋 必要条件
- Python 3.10+
- uv (推奨) または pip
🚀 インストール
uv を使用(推奨)
# プロジェクトのクローン
git clone https://github.com/fukayatti/schemdraw-mcp-server.git
cd schemdraw-mcp-server
# 依存関係のインストール
uv sync
# 開発用依存関係も含める場合
uv sync --all-extras
pip を使用
# プロジェクトのクローン
git clone https://github.com/fukayatti/schemdraw-mcp-server.git
cd schemdraw-mcp-server
# インストール
pip install -e .
# 開発用依存関係も含める場合
pip install -e ".[dev]"
🔧 使用方法
1. MCP サーバーとして起動
# 標準入出力で MCP サーバーを起動
uv run python server.py
# または JSON-RPC over stdio で起動
python server.py --stdio
2. Claude Desktop での設定
claude_desktop_config.json ファイルに以下を追加:
{
"mcpServers": {
"schemdraw": {
"command": "uv",
"args": ["run", "python", "/path/to/schemdraw-mcp-server/server.py"],
"cwd": "/path/to/schemdraw-mcp-server"
}
}
}
3. 基本的な使用例
Claude で以下のようにリクエストできます:
抵抗とコンデンサと LED を使ったシンプルな回路図を作成してください
🛠️ 開発
開発環境セットアップ
# 開発用依存関係のインストール
uv sync --all-extras
# コードフォーマット
uv run black .
uv run isort .
# リントチェック
uv run flake8 .
uv run mypy .
# テスト実行
uv run pytest
📚 サポートされる回路素子
基本素子
resistor- 抵抗器capacitor- コンデンサinductor- インダクタdiode- ダイオード
電源
voltage_source- 電圧源current_source- 電流源battery- バッテリー
半導体
bjt_npn- NPN バイポーラトランジスタbjt_pnp- PNP バイポーラトランジスタmosfet_n- N-ch MOSFETmosfet_p- P-ch MOSFET
演算増幅器
opamp- オペアンプ
ロジックゲート
and_gate- AND ゲートor_gate- OR ゲートnot_gate- NOT ゲートnand_gate- NAND ゲートnor_gate- NOR ゲートxor_gate- XOR ゲート
その他
ground- グラウンドvdd- 電源vss- 負電源label- ラベル
🔌 提供される MCP ツール
create_circuit
新しい回路図を作成します。
パラメータ:
title(オプション): 回路図のタイトルsize(オプション): [幅, 高さ] の配列
add_component
回路に素子を追加します。
パラメータ:
component_type(必須): 素子のタイプcomponent_id(必須): 素子の識別子label(オプション): 素子のラベルvalue(オプション): 素子の値direction(オプション): 配置方向 (right,left,up,down)position(オプション): [x, y] 座標
connect_components
素子間を接続します。
パラメータ:
from_component(必須): 接続元の素子 IDto_component(必須): 接続先の素子 IDconnection_type(オプション): 接続タイプ (wire,dot)
create_loop_circuit
ループ回路を作成します。
パラメータ:
components(必須): コンポーネントのリストsize(オプション): 回路の一辺の長さ
save_circuit
回路図を保存します。
パラメータ:
filename(必須): 保存ファイル名format(オプション): 出力形式 (png,svg,pdf)dpi(オプション): 解像度
get_circuit_info
現在の回路図の情報を取得します。
list_available_components
利用可能な素子タイプの一覧を取得します。
add_spacer
コンポーネント間にスペースを追加します。
optimize_layout
回路図のレイアウトを最適化します。
📸 使用例
シンプルな RC 回路
Claude への指示例:
抵抗(1kΩ)とコンデンサ(100µF)を直列に接続した RC 回路を作成してください
この指示により、以下のような回路図が生成されます:
[電源] ――[R1: 1kΩ]――[C1: 100µF]――[GND]
⚙️ 設定
環境変数
SCHEMDRAW_DPI: デフォルトの出力解像度 (デフォルト: 150)SCHEMDRAW_FORMAT: デフォルトの出力形式 (デフォルト: svg)
🤝 コントリビューション
- このリポジトリをフォーク
- フィーチャーブランチを作成 (
git checkout -b feature/amazing-feature) - 変更をコミット (
git commit -m 'Add some amazing feature') - ブランチにプッシュ (
git push origin feature/amazing-feature) - プルリクエストを作成
📝 ライセンス
このプロジェクトは MIT ライセンスの下で公開されています。詳細は LICENSE ファイルを参照してください。
🙏 謝辞
- schemdraw - 優れた回路図描画ライブラリ
- Model Context Protocol - AI との統合を可能にするプロトコル
📞 サポート
問題や質問がある場合は、Issues でお知らせください。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.