Metadata-Version: 2.5
Name: bacpypes3
Version: 0.0.108
Summary: BACnet Communications Library
Project-URL: Homepage, https://github.com/JoelBender/bacpypes3
Project-URL: Repository, https://github.com/JoelBender/bacpypes3
Author-email: Joel Bender <joel@carrickbender.com>
License-Expression: MIT
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.8
Provides-Extra: ifaddr
Requires-Dist: ifaddr; extra == 'ifaddr'
Provides-Extra: mcp
Requires-Dist: mcp>=2; (python_version >= '3.10') and extra == 'mcp'
Requires-Dist: pydantic; (python_version >= '3.10') and extra == 'mcp'
Provides-Extra: pylibpcap
Requires-Dist: python-libpcap; extra == 'pylibpcap'
Provides-Extra: rdflib
Requires-Dist: rdflib; extra == 'rdflib'
Provides-Extra: websockets
Requires-Dist: websockets; extra == 'websockets'
Provides-Extra: yaml
Requires-Dist: pyyaml; extra == 'yaml'
Description-Content-Type: text/markdown

# BACpypes3 - Python library for BACnet applications

BACpypes provides a BACnet application layer and network layer written in
Python for daemons, scripting, and graphical interfaces.  This version is the
next generation for Python3.8+, completely overhauled from the Python2.5+
version using async/await methods and asyncio for communications.

## MCP (Model Context Protocol) integration

The `bacpypes3.mcp` module exposes the BACpypes3 CLI commands (`whois`,
`read`, `write`, `rpm`, `wirtn`, BBMD ops, …) as MCP tools with natural names
(`who_is`, `read_property`, `write_property`, `read_property_multiple`,
`who_is_router_to_network`, …). It has three personalities:

1. **Importable library.** Each tool is a plain `async` function returning
   JSON-serializable Python values. Inject an `Application` and call the
   tools directly.
2. **Stand-alone MCP server.** `python -m bacpypes3.mcp <BACpypes flags>`
   builds an `Application` via `SimpleArgumentParser` and serves the tools
   over stdio using `mcp.server.mcpserver.MCPServer` (renamed from
   `FastMCP` in the mcp 2.x SDK; BACpypes3 requires `mcp>=2`).
3. **Embedded server.** A long-running BACnet server can inject its own
   `Application` and start `mcp.serve_http(...)` as a concurrent asyncio
   task, so an LLM agent can drive it over HTTP without fighting the host
   application's stdout. See `samples/mini-device-with-mcp.py` for the
   reference pattern.

The `mcp` and `pydantic` packages are declared as an optional extra and are
only imported when a server is actually built; the tool functions are usable
without them:

    pip install -e ".[mcp]"      # to run the server
