npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

twincat-mcp

v0.3.2

Published

MCP stdio server for TwinCAT ADS operations.

Downloads

454

Readme

twincat-mcp

MCP stdio server for TwinCAT ADS PLC operations.

This package exposes twincat-mcp-core runtime operations as Model Context Protocol tools. MCP-specific protocol handling lives here; ADS domain behavior, configuration validation, watches, and write gates live in twincat-mcp-core.

Install

npm install -g twincat-mcp

Node.js 20 or newer is required.

Run

twincat-mcp --config ./plc.config.json

Config can also be supplied with environment variables:

  • TWINCAT_ADS_CONFIG='{"connectionMode":"router",...}'
  • TWINCAT_ADS_TARGET_AMS_NET_ID=192.168.1.120.1.1
  • TWINCAT_ADS_TARGET_ADS_PORT=851
  • TWINCAT_ADS_CONNECTION_MODE=router
  • TWINCAT_ADS_READ_ONLY=true
  • TWINCAT_ADS_WRITE_ALLOWLIST=MAIN.safeValue,MAIN.otherSafeValue
  • TWINCAT_ADS_CONTEXT_SNAPSHOT_SYMBOLS=MAIN.someValue
  • TWINCAT_ADS_NOTIFICATION_CYCLE_TIME_MS=250
  • TWINCAT_ADS_MAX_NOTIFICATIONS=128
  • TWINCAT_ADS_MAX_WAIT_UNTIL_MS=600000

Direct mode additionally uses:

  • TWINCAT_ADS_ROUTER_ADDRESS
  • TWINCAT_ADS_ROUTER_TCP_PORT
  • TWINCAT_ADS_LOCAL_AMS_NET_ID
  • TWINCAT_ADS_LOCAL_ADS_PORT

Example Config

{
  "connectionMode": "router",
  "targetAmsNetId": "192.168.1.120.1.1",
  "targetAdsPort": 851,
  "readOnly": true,
  "writeAllowlist": [],
  "notificationCycleTimeMs": 250,
  "maxNotifications": 128,
  "maxWaitUntilMs": 600000,
  "services": {
    "plc": {
      "targetAdsPort": 851,
      "symbolGroups": {}
    },
    "nc": {
      "targetAdsPort": 500
    },
    "io": {
      "targetAdsPort": 300
    }
  }
}

Tools

Connection:

  • ads_connect
  • ads_disconnect

PLC reads and state:

  • plc_list_symbols
  • plc_describe_symbol
  • plc_read
  • plc_read_many
  • plc_list_groups
  • plc_read_group
  • plc_state

plc_state includes ADS connection state, write gates, watch count, and a readable PLC runtime status summary such as Run or Stop.

Writes and write gates:

  • plc_set_write_mode
  • plc_get_write_mode
  • plc_evaluate_write_access
  • plc_write

Watches:

  • plc_watch
  • plc_wait_until
  • plc_unwatch
  • plc_list_watches

Watches are modeled only as tools. They are not MCP resources or subscriptions yet.

Safety Model

MCP writes use the same three gates as the core and Pi package:

  1. readOnly=false in config.
  2. plc_set_write_mode sets runtime write mode to enabled.
  3. The exact symbol name is present in writeAllowlist.

The default behavior is read-only.

Development

npm run test:mcp
npm run build
npm run pack:mcp

For package-level checks:

npm run check -w twincat-mcp
npm run test -w twincat-mcp