Skip to main content
Glama

モデルコンテキストプロトコルを備えた脳コンピュータインターフェース(BCI-MCP)

このプロジェクトでは、脳コンピュータインターフェース (BCI) テクノロジーとモデルコンテキストプロトコル (MCP) を統合して、神経信号の取得、処理、AI 対応のインタラクションのための強力なフレームワークを作成します。

GitHubページ ライセンス: MIT

概要

BCI-MCP は次のものを組み合わせます:

  • 脳コンピュータインターフェース(BCI) :神経信号のリアルタイム取得と処理

  • モデルコンテキストプロトコル(MCP) :標準化されたAI通信インターフェース

この統合により、ヘルスケア、アクセシビリティ、研究、人間とコンピュータの相互作用における高度なアプリケーションが可能になります。

Related MCP server: KOI-MCP Integration

主な特徴

BCIコア機能

  • 神経信号取得:脳活動からの電気信号をリアルタイムで捕捉する

  • 信号処理:脳信号の前処理、特徴抽出、分類

  • コマンド生成: 解釈された脳信号をコマンドに変換する

  • フィードバックメカニズム: ユーザーのコントロールを向上させるためのフィードバックを提供する

  • リアルタイム操作:最小限の遅延で脳活動を処理

MCP統合機能

  • 標準化されたコンテキスト共有:MCPを使用してBCIデータをAIモデルに接続

  • ツール公開:BCI機能をAIアプリケーションで利用できるようにする

  • 構成可能なワークフロー: BCI信号とAI処理を組み合わせた複雑な操作を構築

  • 安全なデータ交換:プライバシーを保護した神経データ伝送を可能にする

システムアーキテクチャ

BCI-MCP システムは、いくつかの主要コンポーネントで構成されています。

┌─────────────────┐      ┌─────────────────┐      ┌─────────────────┐
│                 │      │                 │      │                 │
│  BCI Hardware   │──────│  BCI Software   │──────│   MCP Server    │
│                 │      │                 │      │                 │
└─────────────────┘      └─────────────────┘      └────────┬────────┘
                                                           │
                                                           │
                                                  ┌────────▼────────┐
                                                  │                 │
                                                  │  AI Applications │
                                                  │                 │
                                                  └─────────────────┘

はじめる

前提条件

  • Python 3.10以上

  • 互換性のある EEG ハードウェア (またはテストにはシミュレーション モードを使用)

  • requirements.txt にリストされている追加の依存関係

インストール

# Clone the repository
git clone https://github.com/enkhbold470/bci-mcp.git
cd bci-mcp

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Dockerの使用

セットアップを簡単にするには、Docker を使用できます。

# Build and start all services
docker-compose up -d

# Access the documentation at http://localhost:8000
# The MCP server will be available at ws://localhost:8765

基本的な使い方

# Start the MCP server
python src/main.py --server

# Or use the interactive console
python src/main.py --interactive

# List available EEG devices
python src/main.py --list-ports

# Record a 60-second BCI session
python src/main.py --port /dev/tty.usbmodem1101 --record 60

高度なアプリケーション

BCI-MCP 統合により、さまざまな最先端アプリケーションが可能になります。

ヘルスケアとアクセシビリティ

  • 支援技術:運動障害のある人がデバイスを制御できるようにする

  • リハビリテーション:リアルタイムフィードバックによる神経学的リハビリテーションのサポート

  • 診断ツール:神経疾患の診断を支援する

研究開発

  • 神経科学研究:脳機能と認知の研究を促進する

  • BCIトレーニング:BCI制御の学習と適応を加速

  • プロトコル開発:神経データ交換の標準を確立する

AI強化インターフェース

  • アダプティブインターフェース:神経信号とAI支援に基づいて調整するインターフェース

  • 意図認識:神経信号を通じてユーザーの意図をより深く理解する

  • 補助的コミュニケーション:言語障害のある人のための強化されたコミュニケーション

ドキュメント

プロジェクトのドキュメントは、GitHub Pages のhttps://enkhbold470.github.io/bci-mcp/でホストされています。

ドキュメントの維持

ドキュメントはMkDocsとMaterialテーマを使用して作成されています。ドキュメントを更新するには、以下の手順に従ってください。

  1. mainブランチのdocs/ディレクトリにある Markdown ファイルに変更を加える

  2. 変更をコミットしてmainブランチにプッシュします

  3. GitHub Actionsワークフローは、更新されたドキュメントを自動的にビルドしてGitHub Pagesにデプロイします。

ローカルドキュメントの開発

ドキュメントをローカルで操作するには:

  1. 必要な依存関係をインストールします。

    pip install mkdocs-material mkdocstrings mkdocstrings-python
  2. ローカル サーバーを実行します。

    mkdocs serve
  3. ドキュメントはhttp://localhost:8000で参照できます。

プロジェクト構造

.
├── docs/                  # Documentation files
│   ├── api/               # API Documentation
│   ├── features/          # Feature Documentation
│   ├── getting-started/   # Getting Started Guides
│   └── index.md           # Documentation Home Page
├── mkdocs.yml             # MkDocs Configuration
└── .github/workflows/     # GitHub Actions Workflows

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

  1. リポジトリをフォークする

  2. 機能ブランチを作成する ( git checkout -b feature/amazing-feature )

  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )

  4. ブランチにプッシュする ( git push origin feature/amazing-feature )

  5. プルリクエストを開く

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

謝辞

接触

Enkhbold Ganbold - GitHub プロフィール

プロジェクトリンク: https://github.com/enkhbold470/bci-mcp

Available Tools

14 tools
calibrateC

Capture a baseline so focus/calm/etc. are personalized to the wearer.

Inputs: seconds, condition.

connectB

Connect to an EEG device and start streaming. Default is the synthetic brain.

Inputs: device_uri.

disconnectA

Disconnect from the current EEG device.

Inputs: no named parameters.

get_band_powersB

Get absolute and relative EEG band powers (delta, theta, alpha, beta, gamma).

Inputs: no named parameters.

get_brain_stateA

Get the current brain state. Returns heuristic band-power proxy metrics (focus, calm, attention, engagement, fatigue, meditation), band powers, and signal quality. Each reading carries confidence (0..1), per-metric metric_confidence, and a status ('ok'/'warming_up'/'unreliable') — weight the metrics by these and do not interpret an unreliable/low-confidence reading. Call get_metric_definitions to learn what each metric means.

Inputs: no named parameters.

get_metric_definitionsA

Explain each brain metric: its exact formula, the literature it draws on (with DOIs under references), and an honest caveat. Call this to learn what focus/calm/attention/engagement/fatigue/meditation actually measure and how much to trust them — they are heuristic proxies, not validated cognitive measurements. Cite a reference only for its role: a caveat source contests the metric and must never be cited as support.

Inputs: no named parameters.

get_neurofeedback_scoreA

Sample the current neurofeedback score (in-zone now + cumulative %).

Inputs: no named parameters.

get_pipeline_limitationsA

What this pipeline can and cannot do: the exact analysis method (Welch PSD window, band edges, filters), a plain-English list of limitations (it averages transients out, is not clinical/qEEG, metrics are heuristic proxies, no source localization/connectivity), and its intended use. Read this before drawing any conclusion from the metrics — especially do not present them as clinical, diagnostic, or event-level (ERP/spindle) results.

Inputs: no named parameters.

get_signal_qualityA

Get electrode signal quality, reading confidence, and detected artifacts (blink, railing, emg, flatline).

Inputs: no named parameters.

list_devicesA

List EEG devices/URIs you can connect to.

Inputs: no named parameters.

mark_eventC

Annotate the live stream with a labeled event marker.

Inputs: label (required).

recordB

Record the live stream for N seconds to a file (npz/csv/edf).

Inputs: fmt, path, seconds.

start_neurofeedbackC

Begin a neurofeedback session rewarding time spent above a metric target.

Inputs: metric, target.

stream_summaryB

Current brain-state snapshot. (The seconds window for rolling stats arrives in a later phase; this currently returns the live reading.)

Inputs: seconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 14 tools

    Disambiguation3/5

    Most tools target distinct actions, but get_brain_state, get_band_powers, get_signal_quality, and stream_summary overlap significantly because get_brain_state already bundles band powers, metrics, and signal quality. stream_summary is especially vague and its description admits it currently returns only the live reading, making it hard to distinguish from get_brain_state.

    Naming Consistency4/5

    The set mostly follows a predictable snake_case pattern with clear verb/noun forms such as list_devices, get_brain_state, mark_event, and start_neurofeedback. Minor deviations are bare verbs like connect, disconnect, record, and calibrate, plus the noun-like stream_summary, but these remain readable and conventional for session lifecycle actions.

    Tool Count5/5

    Fourteen tools is well-scoped for an EEG/BCI server that needs device lifecycle, signal inspection, calibration, events, recording, and neurofeedback. Each tool generally corresponds to a meaningful part of the live BCI workflow without excessive surface area.

    Completeness4/5

    The surface covers the core lifecycle: device discovery, connect/disconnect, signal and brain-state reads, calibration, event marking, recording, and neurofeedback start/score. Minor gaps remain, notably no explicit stop_neurofeedback or clear session-stop operation beyond disconnect, and marker/event retrieval is absent.

    Maintenance

    ActivityMaintained
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers