PicoScope MCP Server

PicoScope MCP Server

Enables LLMs like Claude to interact with PicoScope oscilloscopes for signal acquisition, measurement, and analysis. Supports device management, data capture, triggering, and signal generation through natural language commands.

Category
访问服务器

README

PicoScope MCP Server

License: GPL v3 Python 3.11+ FastMCP

A STDIO MCP server that enables LLMs like Claude to interact with PicoScope oscilloscopes for signal acquisition, measurement, and analysis. Built with FastMCP and the official PicoSDK Python bindings.

Features

  • Device Management: Auto-discover and connect to PicoScope devices
  • Channel Configuration: Set voltage ranges, coupling, and offsets
  • Data Acquisition: Block capture and streaming modes
  • Triggering: Simple and advanced trigger configurations
  • Measurements: Frequency, amplitude, rise time, FFT, THD, and more
  • Signal Generation: Control built-in arbitrary waveform generator
  • AI-Native: Designed for natural language control via Claude and other LLMs

Quick Start

# Clone the repository
git clone https://github.com/markuskreitzer/picoscope_mcp.git
cd picoscope_mcp

# Install dependencies (requires uv package manager)
uv sync

# Run the MCP server
uv run picoscope-mcp

The server runs in STDIO mode and is ready to communicate with MCP clients like Claude Desktop.

Installation

Prerequisites

  1. PicoSDK C Libraries (required for hardware operation)

    • Windows: Download from PicoTech Downloads
    • macOS: Download PicoScope software package
    • Linux: Install via package manager:
      # Ubuntu/Debian
      sudo apt-get install libps5000a libps4000a libps3000a libps2000a
      
  2. Python 3.11+ with uv package manager

Install Dependencies

# Clone or navigate to the project directory
cd picoscope_mcp

# Install dependencies
uv sync

Usage

Running the Server

uv run picoscope-mcp

The server runs in STDIO mode, communicating via standard input/output for use with MCP-compatible clients.

Using with Claude Desktop

Add this configuration to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "picoscope": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/picoscope_mcp",
        "run",
        "picoscope-mcp"
      ]
    }
  }
}

Restart Claude Desktop, and you'll see the PicoScope tools available in the MCP menu.

Testing Without Hardware

The server will run even without PicoScope hardware connected, though device operations will fail until:

  1. PicoSDK C libraries are installed
  2. A PicoScope device is connected

MCP Tools

Discovery & Connection

Tool Description
list_devices Find all connected PicoScope devices
connect_device Connect to a specific device (by serial) or first available
get_device_info Get details about connected device
disconnect_device Disconnect from current device

Channel Configuration

Tool Description
configure_channel Set channel parameters (range, coupling, offset)
get_channel_config Query current channel settings
set_timebase Configure sampling rate (informational)

Triggering

Tool Description
set_simple_trigger Configure edge trigger (rising/falling/both)

Data Acquisition

Tool Description
capture_block Single snapshot capture with pre/post trigger samples
start_streaming Begin continuous data capture
stop_streaming End streaming mode
get_streaming_data Retrieve latest streaming data

Analysis

Tool Description
measure_frequency Calculate signal frequency
measure_amplitude Measure voltage (pk-pk, RMS, etc.)
measure_rise_time Edge timing analysis
measure_pulse_width Pulse characteristics
compute_fft Frequency domain analysis
get_statistics Signal statistics (min/max/mean/std)
measure_thd Total Harmonic Distortion

Advanced

Tool Description
set_signal_generator Configure AWG output
stop_signal_generator Disable signal generator
configure_math_channel Channel operations (A+B, A-B, etc.)
export_waveform Save data to file (CSV/JSON/NumPy)
configure_downsampling Set downsampling mode

Example Usage with Claude

User: "Connect to the first PicoScope and measure the frequency on channel A"

Claude calls:
1. list_devices() -> finds available devices
2. connect_device() -> connects to first device
3. configure_channel(channel="A", enabled=true, voltage_range=5.0) -> enables channel A
4. set_simple_trigger(source="A", threshold_mv=0) -> sets auto-trigger
5. capture_block(pre_trigger_samples=1000, post_trigger_samples=1000) -> captures waveform
6. Returns captured data with time and voltage values

User can then analyze the returned data for frequency, or request additional captures.

Configuration

Typical Workflow

  1. Connect: connect_device()
  2. Configure Channels: configure_channel() for each channel
  3. Set Trigger: set_simple_trigger()
  4. Capture: capture_block() or start_streaming()
  5. Analyze: Use measurement tools on captured data

Supported Hardware

  • PS5000A Series (primary support)
  • PS2000/3000/4000/6000 Series (planned)

Currently optimized for PS5000A. Other series will require device-specific implementations.

Development

Project Structure

picoscope_mcp/
├── src/picoscope_mcp/
│   ├── server.py          # FastMCP server
│   ├── device_manager.py  # Device abstraction
│   ├── models.py          # Data structures
│   ├── utils.py           # Helper functions
│   └── tools/             # MCP tool implementations
│       ├── discovery.py
│       ├── configuration.py
│       ├── acquisition.py
│       ├── analysis.py
│       └── advanced.py
└── tests/
    └── test_tools.py

Running Tests

uv run pytest

Adding Support for New Device Series

  1. Update device_manager.py to detect device series
  2. Import appropriate picosdk module (e.g., ps3000a)
  3. Map device-specific constants and API calls
  4. Handle series-specific capabilities

Troubleshooting

"PicoSDK not found" Error

Install PicoSDK C libraries for your platform (see Prerequisites).

"No device connected" Errors

  1. Ensure PicoScope is connected via USB
  2. Check device appears in system (Windows Device Manager, macOS System Information, Linux lsusb)
  3. Verify PicoSDK drivers are installed
  4. Try reconnecting the device

Channel Configuration Fails

  • Check voltage range is supported: 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20V
  • Verify channel exists (A-D for 4-channel models)

Capture Timeout

  • Ensure trigger settings are appropriate for signal
  • Try increasing auto-trigger timeout
  • Check signal is within configured voltage range

Roadmap

  • [x] Phase 1: Foundation - Device discovery, connection, PS5000A support
  • [ ] Phase 2: Advanced acquisition - Streaming mode, advanced triggers
  • [ ] Phase 3: Multi-device support - PS2000/3000/4000/6000 series
  • [ ] Phase 4: Enhanced analysis - Real-time FFT, automated characterization
  • [ ] Phase 5: Visualization - Web dashboard for waveform viewing

See PROJECT_PLAN.md for detailed architecture and development plans.

Contributing

Contributions are welcome! This project is in active development.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/YOUR_USERNAME/picoscope_mcp.git
cd picoscope_mcp

# Install dependencies including dev tools
uv sync

# Run tests
uv run pytest

Areas for Contribution

  • Support for additional PicoScope series (PS2000, PS3000, PS4000, PS6000)
  • Streaming mode implementation
  • Advanced trigger modes (pulse width, window, logic)
  • Additional measurement algorithms
  • Documentation and examples
  • Test coverage
  • Bug reports and fixes

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Note: This license allows commercial use but requires derivative works to remain open source under GPLv3.

Acknowledgments

References

Contact

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选