genicam-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@genicam-mcp List available cameras"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
genicam-mcp
Vendor-neutral industrial camera control via GenICam GenTL.
An MCP server that enumerates, connects to, configures, and captures from industrial cameras through the GenICam GenTL standard — not through a single vendor's SDK.
Point it at any GenTL producer (.cti) and you get the camera's entire GenICam
feature tree: exposure, gain, trigger, ROI, pixel format, and everything else the
camera exposes.
Why this exists
Existing camera MCP servers bind to one vendor's SDK (typically pypylon, Basler-only)
and expose a single "grab a frame" call. This one goes through the vendor-neutral GenTL
layer instead, so one code path is meant to drive any GenTL-compliant camera — Basler,
HIKrobot, Teledyne FLIR, Allied Vision, XIMEA — regardless of vendor. (Actually tested
producers are listed under Verified below.) It also exposes feature control,
not just capture.
No vendor SDK is imported. The only path to the hardware is harvesters → .cti.
That constraint is the point of the project.
Related MCP server: dwf-mcp-server
Install
Requires Python 3.12 (the genicam wheels this depends on are version-specific).
git clone https://github.com/finnhyun12/genicam-mcp.git
cd genicam-mcp
uv venv --python 3.12
uv syncClaude Desktop setup
Add to your claude_desktop_config.json:
{
"mcpServers": {
"genicam": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/genicam-mcp", "run", "genicam-mcp"]
}
}
}If uv is not on your PATH, point at the venv interpreter directly:
{
"mcpServers": {
"genicam": {
"command": "/absolute/path/to/genicam-mcp/.venv/bin/python",
"args": ["-m", "genicam_mcp.server"]
}
}
}On Windows use .venv\\Scripts\\python.exe and escape backslashes in JSON.
Tools
Tool | Purpose |
| Register a GenTL producer ( |
| List cameras: |
| Open a camera. Required before feature access or capture. |
| Release the camera. |
| Walk the node map. Returns name, type, readable/writable, current value, range or options. |
| Read one feature with its type and |
| Write any GenICam feature — |
| Capture one frame → PNG. Returns |
Feature names are case-sensitive and vary by camera. Use list_features() to see
what a given camera actually offers rather than guessing.
Finding a .cti producer
Vendor SDKs install their producers and register the directory in the
GENICAM_GENTL64_PATH environment variable:
# Linux / macOS
echo $GENICAM_GENTL64_PATH# Windows
$env:GENICAM_GENTL64_PATHCommon locations:
Vendor | Producer |
Allied Vision Vimba X |
|
Basler pylon |
|
HIKrobot MVS |
|
If add_producer is given a bad path, the error message lists the .cti files it
found on your machine.
Demo without hardware
Allied Vision Vimba X ships a Camera Simulator TL — a GenTL producer that presents simulated cameras with real test-pattern frames. No camera required.
Install Vimba X (free).
Register the simulator producer and grab a frame:
add_producer("C:\\Program Files\\Allied Vision\\Vimba X\\cti\\VimbaCameraSimulatorTL.cti")
discover_cameras()
connect(0)
set_feature("TestPattern", "GreyVerticalRamp")
grab("frame.png")This is the exact producer path used for the end-to-end verification below. On that
machine it enumerated three simulated cameras; index 0 was
Camera Simulator (G1-030_VSWIR) at 656×520 Mono8. TestPattern accepts Off,
GreyVerticalRamp, GreyVerticalRampMoving, ColorVerticalBar, ColorHorizontalBar,
and ColorVerticalBarMoving — check get_feature("TestPattern") on your install rather
than assuming, since the simulator's model list can differ by Vimba X version.
Note: a vendor's virtual camera feature is not the same thing as a simulator transport layer. Basler's pylon Camera Emulator (
PYLON_CAMEMU) and HIKrobot's MVS Virtual Device both live above the GenTL layer and are visible only through their own vendor SDKs — GenTL consumers cannot see them. Vimba X's Camera Simulator is itself a.cti, which is why it works here.
Verified
✅ End-to-end (enumerate → connect → feature R/W → grab → PNG): Allied Vision Vimba X — Camera Simulator TL (GenTL producer)
✅ Producer load & camera enumeration: Basler pylon ProducerU3V.cti
genicam-mcp is built against the GenICam GenTL standard and is expected to work with any compliant producer (Basler, HIKrobot, Teledyne FLIR, Allied Vision, XIMEA, …). Only the producers listed above are actually tested; others are unverified — field reports welcome.
Development
uv run pytest # fake-GenTL suite; no hardware, no SDKThe real-producer suite is gated on an env var so day-to-day runs stay fast:
GENTL_CTI=/path/to/Producer.cti uv run pytest -m real_producer -v -sIf GENTL_CTI is set but no camera is found, the suite fails rather than skipping —
a gate that silently passes is not a gate.
Known quirks
These are documented because each one looks like a broken server when you hit it cold. Knowing them in advance turns a bug report into a shrug.
First
add_producercan be slow. Basler'sProducerU3V.ctitook over 60 s on its first load (USB bus enumeration). Nothing is wrong — it is enumerating the bus. Allow a generous tool timeout on the first call; a short client timeout will cancel the request and can tear down the MCP session with it.A bad producer can take the process down.
MvFGProducerCML.ctisegfaults (0xC0000005) when loaded without Camera Link hardware. This happens inside the native library, so no Pythontry/exceptcan catch it — register only producers that match your hardware.Trigger mode blocks capture. If
TriggerModeisOn,grab()waits for a trigger and then times out. Setset_feature("TriggerMode", "Off")for free-run.
Implementation notes
Three findings shaped this code. They are recorded here because none of them is visible from the source alone, and each cost real time to track down.
A vendor "virtual camera" is not a simulator transport layer. Basler's pylon Camera
Emulator (PYLON_CAMEMU) and HIKrobot's MVS Virtual Device both look like the answer to
"test without hardware" — and both are invisible to GenTL. They live above the GenTL
boundary, inside the vendor SDK, so only that vendor's own tools can see them. Measured
on HIKrobot MVS: the vendor SDK enumerated the virtual camera (MV_VIR_GIGE_DEVICE → 1
device, and only when run elevated), while MvProducerGEV.cti reported 0 through the
same machine. Vimba X's Camera Simulator works because it is a .cti. The question to
ask of any "virtual camera" feature is not whether it exists but which layer it lives in.
Import the native extensions at module load, never inside a tool call. Deferring
import harvesters into the tool body seems tidy — it lets the module import cleanly on
machines with no SDK. But FastMCP runs tool functions off the event loop, and loading the
genicam native extension there hangs forever: the server accepts the
CallToolRequest and then simply never answers. A silent hang is far worse than an
immediate error, because the client only sees a timeout and the user has nothing to go
on. So the import happens at module load and the failure reason is stashed and raised, as
a readable message, at first use.
A GenTL buffer is borrowed, not owned. ia.fetch() hands out a buffer from the
acquisition queue; once it is returned, the memory is recycled. Keeping a numpy view past
that point does not raise — it silently yields whatever the driver wrote next, which in
practice means an all-black frame. This surfaced only against the real Vimba simulator,
never against the fakes, because a fake buffer is just a live numpy array. The fake now
zeroes its data on __exit__ to model the real lifetime contract, so the failure is
reproducible without hardware, and test_real_producer.py asserts the frame is not
uniformly zero. A capture test that only checks "a PNG exists" passes on a black
image.
Scope
One camera at a time; one frame per grab(). Simultaneous multi-camera acquisition,
async streaming, GUI, and web serving are deliberately out of scope.
License
MIT — see LICENSE.
Available Tools
8 toolsadd_producerA
GenTL producer(.cti) 파일을 등록한다. 다른 모든 툴보다 먼저 호출해야 한다.
.cti 는 카메라 벤더 SDK 가 설치하는 GenTL 표준 드라이버다. 여러 벤더의
카메라를 동시에 쓰려면 이 툴을 여러 번 호출해 복수 등록하면 된다.
경로가 틀리면 이 PC 에서 발견된 .cti 후보를 에러 메시지에 담아 돌려준다.
Args:
cti_path: .cti 파일의 절대 경로.
Inputs: cti_path (required). Returns: object
connectA
카메라에 연결한다. feature 제어와 캡처 전에 반드시 필요하다.
이 서버는 한 번에 한 대만 연결한다. 이미 연결된 상태에서 호출하면 기존
연결을 먼저 해제한다.
Args:
index: discover_cameras() 가 돌려준 index.
Inputs: index (required). Returns: object
disconnectA
현재 카메라 연결을 해제한다. 연결돼 있지 않으면 아무 일도 하지 않는다.
Inputs: no named parameters. Returns: object
discover_camerasA
등록된 producer 전체에서 연결 가능한 카메라를 열거한다.
각 항목의 index 를 connect(index) 에 넘긴다. 벤더/모델/시리얼/전송규격
(tl_type: U3V, GEV 등)을 함께 돌려준다. 0대가 나오면 카메라 전원·케이블과
등록한 .cti 가 그 카메라의 전송규격과 맞는지 확인하라.
Inputs: no named parameters. Returns: result
get_featureB
feature 하나의 현재 값과 타입, 허용 범위(min/max) 또는 선택지를 반환한다.
Args:
name: GenICam feature 이름. 대소문자를 구분한다 (예: 'ExposureTime').
Inputs: name (required). Returns: object
grabA
1프레임을 획득해 PNG 로 저장하고 크기·픽셀포맷·저장경로를 반환한다.
TriggerMode 가 'On' 이면 트리거가 들어올 때까지 대기하다 타임아웃된다.
자유 실행 캡처를 원하면 먼저 set_feature('TriggerMode', 'Off') 를 호출하라.
Args:
save_path: 저장할 PNG 경로. 생략하면 임시 디렉터리에 저장하고 그
경로를 돌려준다.
Inputs: save_path. Returns: object
list_featuresA
카메라가 실제로 제공하는 GenICam feature 목록을 반환한다.
카메라마다 지원 feature 가 다르므로, get_feature/set_feature 로 이름을
추측하기 전에 이 툴로 확인하는 것이 확실하다. 각 항목은 이름·타입·
읽기/쓰기 가능 여부·현재 값을 담는다.
Args:
category: 지정하면 해당 카테고리 서브트리만 반환한다
(예: 'AcquisitionControl', 'ImageFormatControl'). 생략하면 전체.
Inputs: category. Returns: result
set_featureA
GenICam feature 값을 설정한다 (노출·게인·트리거·픽셀포맷·ROI 등).
값은 대상 노드 타입에 맞춰 자동 캐스팅된다. 설정에 실패하면 허용 범위나
선택 가능한 값을 에러 메시지에 담아 돌려준다.
일부 feature 는 선행 조건이 있다. 예를 들어 ExposureTime 을 바꾸려면
ExposureAuto 를 먼저 'Off' 로 두어야 하는 카메라가 많다.
Args:
name: GenICam feature 이름 (예: 'ExposureTime', 'Gain', 'TriggerMode').
value: 설정할 값. 숫자/문자열/불리언.
Inputs: name (required), value (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: registration (add_producer), discovery (discover_cameras), connection (connect/disconnect), feature inspection (list_features, get_feature), feature modification (set_feature), and image capture (grab). No overlap.
All tool names follow a consistent lowercase snake_case verb_noun pattern (e.g., add_producer, discover_cameras, set_feature). No mixing of conventions.
8 tools is well-scoped for a camera control server. Each tool serves a necessary role without redundancy or bloat.
Covers the full lifecycle: producer registration, camera discovery, connection, feature configuration, image capture, and disconnection. Minor gap: no built-in support for continuous or burst capture, but single-frame grab and trigger control via set_feature suffice for basic use.
Related MCP Connectors
Geometry and CAD file metadata extraction for STL, OBJ, PLY, PCD, LAS/LAZ, glTF/GLB.
Cross-OEM industrial machine intelligence: identity, normalization, automation, attestation.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Composable APIs for document extraction, image transformation, and document & sheet generation.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides camera and vision tools for AI assistants to list available cameras, capture images from USB cameras, and save frames to disk for use with LLMs.21 PyPI4MIT
- AlicenseNot gradedqualityDmaintenanceEnables control of Digilent WaveForms instruments (oscilloscope, AWG, logic analyzer) over USB, supporting devices like Analog Discovery 2/3 and Digital Discovery.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables control of Hikvision industrial cameras via MCP, including enumeration, image capture, parameter adjustment, and firmware upgrade.-
- AlicenseNot gradedqualityDmaintenanceEnables capturing live images from a USB camera and checking camera health via natural language.MIT