bci_mcp.mcp.service ¶
Testable brain-service core. server.py adapts this to MCP.
BrainService ¶
Source code in src/bci_mcp/mcp/service.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
Pipeline ¶
Source code in src/bci_mcp/pipeline.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
safe_record_path ¶
safe_record_path(path)
Resolve path to an absolute path inside BCI_RECORD_DIR.
Raises ValueError on traversal attempts. When path is already absolute and inside the allowed directory it is returned as-is; otherwise the basename is appended to the allowed directory.
Source code in src/bci_mcp/recording/paths.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
validate_mcp_uri ¶
validate_mcp_uri(device_uri)
Raise ValueError if device_uri uses a scheme not allowed over MCP.
Source code in src/bci_mcp/recording/paths.py
42 43 44 45 46 47 48 49 50 51 52 | |
bci_mcp.devices.synthetic ¶
Synthetic EEG device — realistic brainwaves with no hardware.
Chunk
dataclass
¶
Source code in src/bci_mcp/core/device.py
21 22 23 24 | |
Device ¶
Bases: ABC
A streaming EEG source. Subclasses run their own acquisition internally.
Source code in src/bci_mcp/core/device.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
read
abstractmethod
¶
read()
Non-blocking pull of newly available samples, or None if none/not streaming.
Source code in src/bci_mcp/core/device.py
38 39 40 | |
DeviceInfo
dataclass
¶
Source code in src/bci_mcp/core/device.py
10 11 12 13 14 15 16 17 18 | |
SyntheticDevice ¶
Bases: Device
Generates band-mixed EEG. focus (0..1) trades alpha for beta.
Source code in src/bci_mcp/devices/synthetic.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
_factory ¶
_factory(parsed, params)
Source code in src/bci_mcp/devices/synthetic.py
69 70 71 72 73 74 75 76 | |
register ¶
register(scheme, factory)
Source code in src/bci_mcp/core/registry.py
13 14 | |
bci_mcp.devices.neurofocus ¶
NeuroFocus v4 device — USB-serial and BLE transports.
Chunk
dataclass
¶
Source code in src/bci_mcp/core/device.py
21 22 23 24 | |
Device ¶
Bases: ABC
A streaming EEG source. Subclasses run their own acquisition internally.
Source code in src/bci_mcp/core/device.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
read
abstractmethod
¶
read()
Non-blocking pull of newly available samples, or None if none/not streaming.
Source code in src/bci_mcp/core/device.py
38 39 40 | |
DeviceInfo
dataclass
¶
Source code in src/bci_mcp/core/device.py
10 11 12 13 14 15 16 17 18 | |
NeuroFocusDevice ¶
Bases: Device
Source code in src/bci_mcp/devices/neurofocus.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
_factory ¶
_factory(parsed, params)
Source code in src/bci_mcp/devices/neurofocus.py
200 201 202 203 204 205 206 207 208 209 | |
register ¶
register(scheme, factory)
Source code in src/bci_mcp/core/registry.py
13 14 | |