# EPICS Channel Access

Gives an agent access to EPICS process variables: read them, watch them change, and write when you allow it. Built for accelerator and lab control systems.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 23
- Author: K-Dense-AI
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/lab-instrument-mcps/tree/HEAD/servers/protocols/epics
- Updated: 2026-09-26
- HTML: https://affpapa.org/en/nevibecode/mcp/epics-channel-access

## What it does

The server talks to EPICS over Channel Access and exposes a set of tools for process variables. Reading covers a lot: `get_pv` returns a value with units, precision, alarm state and limits, `get_pvs` fetches a batch at once, and `monitor_pv` subscribes for a chosen number of seconds and reports statistics. `pv_info` shows which IOC serves a variable and whether this client holds write access.

Writes live in `put_pv` and `put_pvs` and stay off unless you turn them on. A write goes through only when the PV matches the allow-list set with `--option put_allowlist=`, the IOC grants access, and the value sits inside DRVL/DRVH. Run with `--read-only` until the responsible scientist authorises otherwise — a write can move motors, open shutters or change magnet setpoints. Even in read-only mode `apply_safe_state` remains available for the preconfigured emergency state.

No build step is involved: caproto handles CA in pure Python, so `libca` never enters the picture. Before touching hardware, `uvx labmcp-epics --simulate --check` starts a real CA server in-process on `127.0.0.1` with random ports and test PVs such as `SIM:TEMP` and `SIM:MTR`. A live control network needs UDP 5064 and 5065 plus TCP 5064 open to the IOC or gateway. Point the client with `--address` or `EPICS_CA_ADDR_LIST`; supplying a list turns the automatic broadcast search off unless `--option auto_addr_list=yes` is present.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LABMCP_ADDRESS`, `LABMCP_SIMULATE`, `LABMCP_READ_ONLY`, `LABMCP_LIMITS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio epics -- uvx labmcp-epics
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-epics <command>

### Codex

**Platform CLI**
```bash
codex mcp add epics --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> -- uvx labmcp-epics
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-epics <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "epics": {
            "command": "uvx",
            "args": [
                "labmcp-epics"
            ],
            "env": {
                "LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
                "LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
                "LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
                "LABMCP_LIMITS": "<LABMCP_LIMITS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-epics <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "epics": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "labmcp-epics"
            ],
            "env": {
                "LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
                "LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
                "LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
                "LABMCP_LIMITS": "<LABMCP_LIMITS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-epics <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LABMCP_ADDRESS=<LABMCP_ADDRESS> -e LABMCP_SIMULATE=<LABMCP_SIMULATE> -e LABMCP_READ_ONLY=<LABMCP_READ_ONLY> -e LABMCP_LIMITS=<LABMCP_LIMITS> epics uvx labmcp-epics
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-epics <command>

## When to use it
- read vacuum gauge values on a beamline
- watch beam current and catch trips
- check whether the client may write to a PV
- move a sample stage or filter wheel under authorisation
- drive the setup into a safe state with one call

## Example prompts
- Read `BL7:RING:I` and tell me if it's in alarm.
- Monitor `SIM:TEMP` for ten seconds and show the statistics.
- Set `BL7:SAMPLE:X.STOP` to 1, writes are allowed.

## Similar
- [create-epics](https://affpapa.org/en/nevibecode/skills/create-epics.md) — skill · 419 installs
- [pylabrobot](https://affpapa.org/en/nevibecode/skills/pylabrobot.md) — skill · 1900 installs
- [opentrons-integration](https://affpapa.org/en/nevibecode/skills/opentrons-integration.md) — skill · 1900 installs
- [create-stories](https://affpapa.org/en/nevibecode/skills/create-stories.md) — skill · 420 installs
- [service-agentforce-channel-configure](https://affpapa.org/en/nevibecode/skills/service-agentforce-channel-configure.md) — skill · 1200 installs
- [service-de-channel-create](https://affpapa.org/en/nevibecode/skills/service-de-channel-create.md) — skill · 654 installs

From the same set: [k-dense-ai/lab-instrument-mcps](https://affpapa.org/en/nevibecode/by/k-dense-ai/lab-instrument-mcps.md) — 15 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
