Skip to main content
Glama
IamOumarIbrahim

SpectraMCP

Python 3.11+ License: MIT CI MCP Standard

RTL-SDR HackRF SoapySDR

IMPORTANT

Hardware Optional: SpectraMCP runs fully in file-based mode (.wav, .iq, .sigmf-data, .npy radar cubes) with zero hardware. If an RTL-SDR, HackRF, or any SoapySDR-supported device is attached, live-capture tools unlock automatically.

SpectraMCP is a zero-trust Model Context Protocol (MCP) server that gives AI agents (Claude Desktop, Claude Code, Cursor, Antigravity) native tool access to RF spectrum capture, spectral analysis, and classical radar-DSP primitives โ€” no SDR hardware required to get started.

// Add directly to claude_desktop_config.json
{
  "mcpServers": {
    "spectramcp": {
      "command": "uvx",
      "args": ["spectramcp"]
    }
  }
}
TIP

GitHub About Section: ๐Ÿ›ฐ๏ธ The Model Context Protocol Server for RF Signal Processing, SDR & Radar DSP โ€” We're totally on the same wavelength! ๐Ÿ“ถ

Repository Topics / Tags: mcp ยท sdr ยท radar-dsp ยท rf-signals ยท fft ยท cfar ยท mvdr ยท kalman-filter ยท spectrogram ยท sigmf ยท rtl-sdr ยท hackrf ยท soapysdr ยท fastmcp ยท python


๐Ÿ“– Table of Contents


Related MCP server: SDR MCP Server

๐Ÿ’ก What is SpectraMCP?

Every AI coding agent can write a DSP script. None of them can see a spectrum. Today, working with RF signals alongside an AI agent means a constant context-switch: the agent writes a matplotlib script, you run it, you screenshot the plot back into the chat, and you describe what you're looking at in words. SpectraMCP removes that loop entirely.

Instead of maintaining a folder of one-off analysis scripts, SpectraMCP unifies RF and radar DSP behind a single, structured tool interface:

  • Spectral Analysis: FFTs, STFT spectrograms, and rolling PSD waterfalls rendered directly as images the agent can reason over.

  • Radar DSP Primitives: 2D Range-Doppler processing, CA-CFAR detection, MVDR/Capon beamforming, and Kalman-filter multi-target tracking โ€” exposed as callable tools instead of standalone scripts.

  • Signal Classification: Rule-based modulation and micro-Doppler cadence classification for quick "what am I looking at" triage.

  • Hardware Bridge: Optional live capture from RTL-SDR, HackRF, and any SoapySDR-supported device.


โœจ Key Features

  • ๐Ÿ“ก Signal I/O & Format Parser: Loads .wav, raw .iq, .sigmf-data/.sigmf-meta, and .npy radar cubes into a normalized, zero-copy IQBuffer.

  • ๐Ÿ“Š Spectral Analysis Engine: Windowed FFTs (Hann/Hamming/Blackman), high-resolution STFT spectrograms, and rolling PSD waterfall visualization.

  • ๐ŸŽฏ Radar DSP Suite: 2D FMCW Range-Doppler processing, 2D CA-CFAR adaptive thresholding, MVDR/Capon beamforming with diagonal loading, and constant-velocity Kalman multi-target tracking.

  • ๐Ÿ” Signal & Micro-Doppler Classifier: Feature-based modulation scheme identification (AM/FM/OOK/FSK/PSK) and cadence-spectrum periodicity extraction for rotor-vs-flutter discrimination.

  • ๐Ÿ“ Local Workspace Export: Saves generated plots and sliced IQ data segments directly to a user-configured local directory via SPECTRAMCP_WORKSPACE.


โš™๏ธ System Architecture

SpectraMCP unifies file loaders, SDR hardware bridges, spectral rendering, radar processing, and classification engines behind the stdio FastMCP transport layer.

graph TD
    Agent["AI Agent (Claude / Cursor / Antigravity)"] --> Server["SpectraMCP stdio Server"]

    Server --> IO[Signal I/O Layer]
    IO --> File["File Loaders: .wav / .iq / .sigmf / .npy"]
    IO --> HW["SDR Bridge: RTL-SDR / HackRF / SoapySDR"]

    Server --> Spectral[Spectral Analysis Engine]
    Spectral --> FFT["Windowed FFT"]
    Spectral --> STFT["STFT Spectrogram"]
    Spectral --> Waterfall["Rolling PSD Waterfall"]

    Server --> Radar[Radar DSP Engine]
    Radar --> RDM["2D Range-Doppler Map"]
    Radar --> CFAR["2D CA-CFAR Detector"]
    Radar --> Beam["MVDR / Capon Beamformer"]
    Radar --> Track["Kalman Multi-Target Tracker"]

    Server --> Classify[Classification Engine]
    Classify --> Mod["Modulation Classifier"]
    Classify --> MicroD["Micro-Doppler Cadence Extractor"]

    Server --> Workspace["Workspace Export"]
    Workspace --> Out["PNG / GIF / .npy / .sigmf Output"]

    classDef default fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#fff;
    classDef process fill:#1e1b4b,stroke:#a855f7,stroke-width:2px,color:#fff;
    class Spectral,Radar,Classify process;
NOTE

Zero-Trust & Stdio Isolation: SpectraMCP communicates strictly via standard I/O streams (stdio). It opens no network ports and requires no elevated privileges.


๐Ÿ“ Mathematical & Technical Formulation

1. FMCW Beat Frequency Model

For any supplied RadarCube, range-to-beat-frequency mapping follows the standard closed-form FMCW relation. For a target at range $R$, sweep bandwidth $B$, and chirp duration $T_c$:

$$f_b = \frac{2BR}{cT_c} \implies R = \frac{f_b c T_c}{2B}$$

range_doppler_map applies Blackman windowing across both fast-time and slow-time axes before 2D FFT computation to suppress sidelobe leakage.

2. 2D CA-CFAR Threshold

ca_cfar_detect estimates the local noise floor $P_n$ by averaging training cells around the cell-under-test (CUT), excluding guard cells, then applies:

$$T_{cell} = \alpha \cdot P_n, \qquad \alpha = N_{ref}\left(P_{fa}^{-1/N_{ref}} - 1\right)$$

where $N_{ref}$ is the number of reference training cells and $P_{fa}$ is the user-specified target false-alarm probability (default $10^{-3}$).

3. MVDR Diagonal Loading

mvdr_beamform regularizes the sample covariance matrix $\hat{\mathbf{R}}$ whenever snapshot count $K < M$ array elements:

$$\hat{\mathbf{R}}_{loaded} = \hat{\mathbf{R}} + \epsilon \cdot \text{tr}(\hat{\mathbf{R}}) \cdot \mathbf{I}$$

$$\mathbf{w} = \frac{\hat{\mathbf{R}}{loaded}^{-1}\mathbf{a}(\theta)}{\mathbf{a}(\theta)^H \hat{\mathbf{R}}{loaded}^{-1}\mathbf{a}(\theta)}$$


๐Ÿš€ Setup & Installation

Option A: 1-Click Setup (Windows)

setup.bat

Installs Python 3.12 via winget if missing, installs spectramcp and its Python dependencies, and auto-configures claude_desktop_config.json with an absolute interpreter path.

Option B: Manual Installation (Windows / macOS / Linux)

git clone https://github.com/IamOumarIbrahim/SpectraMCP.git
cd SpectraMCP
pip install -e .

๐Ÿ” Verification Command:

python -m spectramcp.selftest

Expected Output: [OK] Core DSP engine [OK] MCP transport [SDR: not detected โ€” file mode only]

Optional: SDR Hardware Drivers

Only required if you plan to use capture_from_sdr / list_sdr_devices:

# Windows (winget)
winget install --id PothosWare.SoapySDR -e

# macOS (Homebrew)
brew install soapysdr rtl-sdr hackrf

# Linux (Debian/Ubuntu)
sudo apt install soapysdr-tools librtlsdr-dev libhackrf-dev

๐Ÿ”Œ Connecting to AI Clients

Claude Desktop

  1. Open your configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  2. Add the spectramcp server entry:

   {
     "mcpServers": {
       "spectramcp": {
         "command": "python",
         "args": ["-m", "spectramcp.server"],
         "env": {
           "SPECTRAMCP_WORKSPACE": "C:\\Users\\YourUsername\\Downloads\\Spectra_Outputs"
         }
       }
     }
   }
  1. Restart Claude Desktop and open the tool icon to confirm all 13 tools are registered.


๐Ÿ–ฅ๏ธ How to Use

User: Load capture_2026_07_29.sigmf-data, show me the waterfall for the first 5 seconds,
      then run CA-CFAR at Pfa=1e-3 and tell me what you find.

Agent:
  โ†’ load_iq_file(path="capture_2026_07_29.sigmf-data")
  โ†’ render_waterfall(duration_s=5.0)
  [returns waterfall.png]
  โ†’ range_doppler_map(source="last_loaded")
  โ†’ ca_cfar_detect(pfa=1e-3, guard_cells=2, training_cells=12)
  [returns detections at ranges 41.2m, 118.6m, 203.9m]

  "The waterfall shows a steady carrier around 433.9 MHz with two brief bursts.
   CFAR detected 3 targets after Range-Doppler processing โ€” ranges and radial
   velocities are annotated on the returned detection map."

๐Ÿ“Š Reference Tables

Highlights of provided tools. View complete parameters in docs/TOOLS_REFERENCE.md.

Category

MCP Tool

Description

Signal I/O

load_iq_file

Loads .wav, .iq, .sigmf-data/.sigmf-meta, or .npy into a normalized IQBuffer

Signal I/O

capture_from_sdr

Captures a fixed-duration IQ segment from an attached RTL-SDR/HackRF/SoapySDR device

Signal I/O

list_sdr_devices

Enumerates attached SDR hardware and reports supported sample rates / tunable range

Spectral Analysis

compute_fft

Windowed FFT with configurable window (Hann/Hamming/Blackman) and zero-padding factor

Spectral Analysis

render_spectrogram

STFT spectrogram image with configurable frame size, hop, and dB dynamic range

Spectral Analysis

render_waterfall

Rolling PSD waterfall across N consecutive capture segments

Radar DSP

range_doppler_map

2D windowed FFT (fast-time/slow-time) over a supplied RadarCube

Radar DSP

ca_cfar_detect

2D Cell-Averaging CFAR detector with configurable guard/training cell geometry

Radar DSP

mvdr_beamform

Adaptive Capon/MVDR beamformer with diagonal-loading stabilization for rank-deficient snapshots

Radar DSP

kalman_track

Constant-velocity Kalman tracker associating detections across sequential frames

Classification

classify_modulation

Rule-based AM/FM/OOK/FSK/PSK-family classifier using envelope, kurtosis, and spectral-flatness features

Classification

micro_doppler_signature

Cadence-spectrum periodicity extraction for rotor-vs-flutter style signature comparison

Workspace

export_plot / export_iq_segment

Saves any generated figure or IQ slice directly to a local folder on the user's PC


โš–๏ธ Benchmarks & Comparisons

Tool

Primary Purpose

Where SpectraMCP Fits

GNU Radio

Full flow-graph SDR runtime

SpectraMCP exposes discrete, agent-callable analysis primitives rather than a visual flow-graph builder

GQRX / SDR#

Live GUI spectrum viewer

SpectraMCP is headless; built to be driven by an AI agent reasoning over spectral images

Universal Radio Hacker

Manual protocol reverse-engineering

Complementary โ€” URH is for interactive dissection, SpectraMCP is for agent-driven automated triage


๐Ÿ”ฌ Scope & Limitations

  • Passive Receiver Scope: SpectraMCP focuses exclusively on signal analysis, spectral visualization, and radar target extraction. It contains no transmission, jamming, or active protocol decoding logic.

  • Hardware Agnostic Fallback: If physical SDR hardware is unplugged or missing drivers, live capture tools fall back cleanly to file-based mode without crashing server execution.


๐Ÿ“ File Structure

SpectraMCP/
โ”œโ”€โ”€ spectramcp/
โ”‚   โ”œโ”€โ”€ server.py           - FastMCP stdio server & tool registration
โ”‚   โ”œโ”€โ”€ io.py                - File loaders and SDR hardware bridge
โ”‚   โ”œโ”€โ”€ spectral.py          - FFT, STFT, waterfall rendering
โ”‚   โ”œโ”€โ”€ radar.py             - Range-Doppler, CA-CFAR, MVDR, Kalman tracker
โ”‚   โ”œโ”€โ”€ classify.py          - Modulation & micro-Doppler classifiers
โ”‚   โ””โ”€โ”€ selftest.py          - Verification CLI module (python -m spectramcp.selftest)
โ”œโ”€โ”€ tests/                    - Pytest suite (DSP + MCP schema)
โ”œโ”€โ”€ docs/TOOLS_REFERENCE.md   - Full 13-tool parameter reference
โ”œโ”€โ”€ .github/workflows/        - CI/CD and release automation
โ”œโ”€โ”€ setup.bat                 - Windows 1-click installer
โ”œโ”€โ”€ pyproject.toml            - Package configuration
โ”œโ”€โ”€ SECURITY.md               - Security disclosure policy
โ”œโ”€โ”€ CONTRIBUTING.md           - Contribution guidelines
โ””โ”€โ”€ CODE_OF_CONDUCT.md        - Code of conduct

๐Ÿฉน Troubleshooting

Issue

Root Cause

Resolution

No SDR devices found

Missing SoapySDR driver or unplugged hardware

Reinstall drivers per Setup Guide; file-mode tools still work

ENOENT on Claude Desktop connect

Relative Python path in config

Use an absolute interpreter path, as shown in Connecting to AI Clients

CFAR returns 0 detections

pfa set too conservatively for signal SNR

Lower pfa (e.g. 1e-2) or verify the input RadarCube isn't pure noise

librtlsdr not found

RTL-SDR driver not installed

Run the SoapySDR driver install step under Setup Guide


๐Ÿงฉ Contributing & Security

  • Contributing: Please review CONTRIBUTING.md for development setup and PR guidelines.

  • Code of Conduct: Adheres to the Contributor Covenant. See CODE_OF_CONDUCT.md.

  • Security Policy: For vulnerability reporting, see SECURITY.md.


๐Ÿš€ Deployment & GitHub Releases

Automated releases and build artifacts are generated via GitHub Actions whenever a new release tag (e.g. v1.0.0) is pushed to the repository:

git tag v1.0.0
git push origin v1.0.0

See .github/workflows/release.yml for workflow details.


๐Ÿ“„ License

MIT ยฉ 2026 Oumar Ibrahim

๐Ÿ™ Powered By

NumPy ยท SciPy ยท SoapySDR ยท sigmf-python ยท FastMCP

If SpectraMCP saved you from writing another one-off FFT script, a โญ helps other people find it.

Install Server
A
license - permissive license
B
quality
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    Enables control of Software Defined Radios and decoding of radio protocols through an AI-friendly Model Context Protocol interface, supporting RTL-SDR and HackRF hardware for signal analysis and protocol decoding.
    Last updated
    16
    MIT
  • F
    license
    -
    quality
    B
    maintenance
    Exposes NVIDIA Sionna RT ray-tracing as 15 structured tools for AI agents, enabling wireless channel simulation (scene loading, antenna array setup, ray tracing, CSI extraction) through MCP.
    Last updated

View all related MCP servers

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Build, validate, and deploy multi-agent AI solutions from any AI environment.

  • Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IamOumarIbrahim/SpectraMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server