Skip to main content
Glama
IamOumarIbrahim

Interlock

Python 3.11+ License: MIT MCP 2025-06-18 Status: Beta

IMPORTANT

Zero-Trust Safety Boundary: Interlock runs entirely on your local machine. Every mutating action is deny-by-default, staged against a shadow copy, and diffed in domain-real terms before committing to disk.

// Add to Claude Desktop configuration (claude_desktop_config.json)
{
  "mcpServers": {
    "interlock": {
      "command": "uvx",
      "args": ["interlock-mcp", "serve", "--policy", "/path/to/interlock.policy.yaml"]
    }
  }
}

Repository About & Topics

About

A zero-trust Model Context Protocol (MCP) server that gives AI agents native, governed access to the CAD, EDA, and SPICE tools already installed on your machine.

Topics / Tags

mcp · model-context-protocol · zero-trust · cad · eda · spice · freecad · kicad · ngspice · ltspice · fusion360 · governance · security · python


Related MCP server: Universal Netlist MCP Server

Table of Contents


What is Interlock?

Interlock sits between an MCP client (Claude Desktop, Claude Code, or any MCP host) and desktop engineering software (FreeCAD, KiCad, ngspice). It exposes one normalized MCP interface so an agent can sketch parts, route PCBs, or run SPICE simulations without ungoverned, destructive access.

Instead of granting raw macro or IPC access, Interlock enforces policy governance:

  • Deny-by-Default Grants: Capabilities remain disabled until explicitly enabled in interlock.policy.yaml.

  • Git-Style Staging: Mutating tool calls operate on a shadow copy; live files remain untouched until an explicit commit.

  • Domain-Aware Diffing: Outputs structural deltas (solids/volume for CAD, nets/tracks for EDA, elements for SPICE) rather than text or binary diffs.


Key Features

  • Non-Downgradable Destructive Tier: destructive-tier capabilities (e.g. cad.delete_feature, eda.delete_track, fs.write_file) are strictly approval-required. Policy loading fails if set to auto.

  • Local-First Processing: Sockets, subprocesses, and file operations remain 100% local on host hardware.

  • SQLite Audit Store: Every tool call, domain diff, timestamp, decision, and SHA-256 diff hash is logged to .interlock/audit.db.

  • In-Chat Approval & CLI Fallback: Inline review via elicitation/create or terminal fallbacks (interlock approve <session-id>, interlock reject <session-id> --reason "...").

  • Path Scoping: Restricts access strictly inside project_root. Deny rules (file_scope.deny) take precedence over allow rules.


System Architecture

Interlock proxies communication between MCP clients and local engineering binaries:

graph TD
    Client["MCP Client (Claude Desktop / CLI)"] -->|JSON-RPC 2.0 stdio/HTTP| PolicyEngine["Interlock Policy Engine"]
    PolicyEngine -->|Policy Check| DiffEngine["Sandbox & Diff Engine"]
    DiffEngine -->|Log Event & Hash| AuditStore[("SQLite Audit Store .interlock/audit.db")]
    DiffEngine -->|Staged Automation| Adapters["Adapter Layer (FreeCAD / KiCad / ngspice / Workspace)"]
    Adapters -->|Local Sockets & SCLI| LocalTools["Host Engineering Tools & Files"]

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

Security Boundary: Downstream tool capabilities are categorized by risk tier in adapter manifests (safe, mutating, destructive). Risk tiers are enforced independently by Interlock's policy engine.


Mathematical / Technical Formulation

1. Sallen-Key Low-Pass Filter Cutoff Frequency

Interlock validates analog SPICE simulation results against the theoretical closed-form cutoff equation:

$$f_c = \frac{1}{2 \pi \sqrt{R_1 R_2 C_1 C_2}}$$

Where:

  • $f_c$ — Cutoff frequency in Hertz (Hz)

  • $R_1, R_2$ — Filter resistor values in Ohms ($\Omega$)

  • $C_1, C_2$ — Filter capacitor values in Farads (F)

When $R_1 = R_2 = R$ and $C_1 = C_2 = C$:

$$f_c = \frac{1}{2 \pi R C}$$

Verification Target: Simulated AC sweep cutoff frequency must be within 2% of theoretical target frequency.


Setup & Installation

Option A: 1-Click Setup with uv or pip

# Recommended
uv tool install interlock-mcp

# Or with pip
pip install interlock-mcp

Option B: From Source

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

Verification Command:

interlock doctor

Expected Output:

Interlock v0.4.2 — environment check

  ✓ python      3.12.3
  ✓ freecad     FreeCAD 1.0.1 found at /usr/bin/freecadcmd
  ✓ kicad       KiCad 9.0.2 — IPC API reachable on /tmp/kicad/api.sock
  ✗ ngspice     binary not found on PATH
  ✓ workspace   C:\Dev\interlock is readable and writable

1 adapter needs attention — run `interlock doctor --fix` for platform-specific install instructions.

Connecting to AI Clients

  1. Open your Claude Desktop configuration file:

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

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

    • Linux: ~/.config/Claude/claude_desktop_config.json

  2. Add Interlock to mcpServers:

{
  "mcpServers": {
    "interlock": {
      "command": "uvx",
      "args": [
        "interlock-mcp",
        "serve",
        "--policy",
        "/path/to/project/interlock.policy.yaml"
      ]
    }
  }
}

How to Use

  1. Initialize policy configuration in your project root:

interlock init
  1. Verify environment health:

interlock doctor
  1. Approve or reject staged agent actions:

# Approve staged session
interlock approve 8f2c-af31

# Reject staged session with reason
interlock reject 8f2c-af31 --reason "Untrusted footprint modification"
  1. View audit logs and replay sessions:

interlock audit tail
interlock audit show 8f2c-af31
interlock audit replay 8f2c-af31 --adapter kicad

Reference Tables

Configuration Schema (interlock.policy.yaml)

Field

Type

Default

Description

project_root

string

./

Root directory allowed for file operations

default_mode

string

approval-required

Default mode for unlisted capabilities (auto | approval-required)

adapters.<name>.enabled

boolean

true

Enable/disable adapter

adapters.<name>.capabilities

map

{}

Capability permission mapping (auto | approval-required)

file_scope.allow

list

["**"]

Allowed glob paths relative to project_root

file_scope.deny

list

["vendor/**", "**/*.lic"]

Denied glob paths (overrides allow rules)

approval.channel

string

elicitation

Channel (elicitation | cli | both)

approval.timeout_s

integer

600

Approval request timeout in seconds

audit.path

string

.interlock/audit.db

SQLite audit database location

Environment Variables

Variable

Default

Purpose

INTERLOCK_POLICY_PATH

./interlock.policy.yaml

Path to active policy file

INTERLOCK_AUDIT_DB

.interlock/audit.db

Override SQLite audit database path

INTERLOCK_LOG_LEVEL

info

Logging verbosity (debug | info | warn | error)

INTERLOCK_APPROVAL_TIMEOUT_S

600

Override approval timeout

INTERLOCK_NO_COLOR

unset

Disable ANSI colors in output


Benchmarks / Comparisons

Capability / Metric

Direct Tool Automation

Generic MCP Gateway

Interlock

Domain CAD/EDA/SPICE State

Yes

No

Yes

Blocks Destructive Calls

No

Generic rules only

Yes

Domain-Real Diffs

No

No

Yes

100% Local (No Cloud Relay)

Yes

Cloud-hosted

Yes

Standard MCP Protocol

Script-specific

Yes

Yes


Scope & Limitations

  • Application Security Boundary: Interlock does not sandbox underlying binaries (FreeCAD, KiCad, ngspice); it inherits their real system privileges.

  • Semantic Engineering Decisions: Interlock enforces capability permissions and risk policy, not whether a specific CAD parameter is good engineering practice.

  • Export Control Compliance: Audit logs provide full session traceability; compliance policies (ITAR/EAR) must pair Interlock with organizational host controls.


File Structure

interlock-mcp/
├── src/interlock/
│   ├── adapters/          - Adapter implementations (FreeCAD, KiCad, ngspice, workspace, LTspice, Fusion 360)
│   ├── audit.py           - SQLite audit store (.interlock/audit.db)
│   ├── cli.py             - Click CLI commands (init, doctor, serve, approve, reject, audit)
│   ├── diff.py            - Domain-aware diffing engine
│   ├── math_utils.py      - Sallen-Key low-pass filter equations & verification
│   ├── policy.py          - Zero-trust PolicyEngine & rule enforcement
│   └── server.py          - MCP Server implementation
├── tests/                 - Pytest suite (100% pass rate)
├── interlock.policy.yaml  - Default policy configuration
├── pyproject.toml         - Build configuration & dependencies
├── REQUIREMENTS.md        - Extracted specification checklist
└── VERIFICATION.md        - Verification matrix & test evidence

Troubleshooting

Issue

Root Cause

Resolution

ngspice binary not found

ngspice not on system PATH

Run interlock doctor --fix and install ngspice via OS package manager

Security Violation: Capability ... cannot be set to auto

Policy file maps destructive capability to auto

Set capability permission to approval-required in interlock.policy.yaml

Path ... outside project root

Agent attempted path traversal outside project_root

Move target file under project_root or update project_root in policy file

Path ... matches deny rule

File path matched pattern in file_scope.deny

Adjust file_scope.deny patterns in policy file if access is intended


Deployment & GitHub Release

Automated CI/CD & Deployment

Interlock uses GitHub Actions (.github/workflows/deploy.yml) for automated testing, linting, packaging, and GitHub Releases upon tag creation.

# Tag a release
git tag -a v0.4.2 -m "Release v0.4.2"
git push origin v0.4.2

Security Policy

Security issues are taken seriously. See SECURITY.md for vulnerability reporting procedures.


Code of Conduct

We are committed to providing a welcoming community. See CODE_OF_CONDUCT.md.


Contributing

Contributions and new adapters are welcome! See CONTRIBUTING.md and docs/writing-an-adapter.md for details.


License

MIT © 2026 Interlock Maintainers


Powered By

Model Context Protocol · FreeCAD · KiCad · ngspice

If Interlock keeps your engineering tools safe, starring the repo helps others find it!

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (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

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • Give AI agents secure access to ZERNO project briefs, tasks, and context over remote MCP.

  • MCP server teaching AI agents to implement TideCloak: auth, E2EE, IGA, security analysis

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/interlock-mcp'

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