{"id":34979320,"url":"https://github.com/ezhuk/bacnet-mcp","last_synced_at":"2026-05-16T02:14:31.537Z","repository":{"id":293951103,"uuid":"984538854","full_name":"ezhuk/bacnet-mcp","owner":"ezhuk","description":"A Model Context Protocol (MCP) server for BACnet.","archived":false,"fork":false,"pushed_at":"2026-05-02T00:27:25.000Z","size":2234,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-02T02:29:12.847Z","etag":null,"topics":["bacnet","mcp","mcp-server"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ezhuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-16T05:15:03.000Z","updated_at":"2026-05-02T00:27:22.000Z","dependencies_parsed_at":"2025-05-18T06:24:25.790Z","dependency_job_id":"be068b1f-6400-4bef-8987-bb58bb0ba7b6","html_url":"https://github.com/ezhuk/bacnet-mcp","commit_stats":null,"previous_names":["ezhuk/bacnet-mcp"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/ezhuk/bacnet-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezhuk%2Fbacnet-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezhuk%2Fbacnet-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezhuk%2Fbacnet-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezhuk%2Fbacnet-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezhuk","download_url":"https://codeload.github.com/ezhuk/bacnet-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezhuk%2Fbacnet-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33087647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"online","status_checked_at":"2026-05-16T02:00:07.515Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bacnet","mcp","mcp-server"],"created_at":"2025-12-27T00:53:30.265Z","updated_at":"2026-05-16T02:14:31.531Z","avatar_url":"https://github.com/ezhuk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## BACnet MCP Server\n\n[![test](https://github.com/ezhuk/bacnet-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/ezhuk/bacnet-mcp/actions/workflows/test.yml)\n[![codecov](https://codecov.io/github/ezhuk/bacnet-mcp/graph/badge.svg?token=Y3N4ABR3WX)](https://codecov.io/github/ezhuk/bacnet-mcp)\n[![PyPI - Version](https://img.shields.io/pypi/v/bacnet-mcp.svg)](https://pypi.org/p/bacnet-mcp)\n\nA lightweight [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that connects LLM agents to [BACnet](https://en.wikipedia.org/wiki/BACnet) devices in a secure, standardized way, enabling seamless integration of AI-driven workflows with Building Automation (BAS), Building Management (BMS) and Industrial Control (ICS) systems, allowing agents to monitor real-time sensor data, actuate devices, and orchestrate complex automation tasks.\n\n## Getting Started\n\nUse [uv](https://github.com/astral-sh/uv) to add and manage the BACnet MCP server as a dependency in your project, or install it directly via `uv pip install` or `pip install`. See the [Installation](https://github.com/ezhuk/bacnet-mcp/blob/main/docs/bacnet-mcp/installation.mdx) section of the documentation for full installation instructions and more details.\n\n```bash\nuv add bacnet-mcp\n```\n\nThe server can be embedded in and run directly from your application. By default, it exposes a `Streamable HTTP` endpoint at `http://127.0.0.1:8000/mcp/`.\n\n```python\n# app.py\nfrom bacnet_mcp import BACnetMCP\n\nmcp = BACnetMCP()\n\nif __name__ == \"__main__\":\n    mcp.run(transport=\"http\")\n```\n\nIt can also be launched from the command line using the provided `CLI` without modifying the source code.\n\n```bash\nbacnet-mcp\n```\n\nOr in an ephemeral, isolated environment using `uvx`. Check out the [Using tools](https://docs.astral.sh/uv/guides/tools/) guide for more details.\n\n```bash\nuvx bacnet-mcp\n```\n\n### Configuration\n\nFor the use cases where most operations target a specific device, such as a Programmable Logic Controller (PLC) or BACnet gateway, its connection settings (`host` and `port`) can be specified at runtime using environment variables so that all prompts that omit explicit connection parameters will be routed to this device.\n\n```bash\nexport BACNET_MCP_BACNET__HOST=10.0.0.1\nexport BACNET_MCP_BACNET__PORT=47808\n```\n\nThese settings can also be specified in a `.env` file in the working directory.\n\n```text\n# .env\nbacnet_mcp_bacnet__host=10.0.0.1\nbacnet_mcp_bacnet__port=47808\n```\n\nWhen interacting with multiple devices, each device’s connection parameters (`host`, `port`) can be defined with a unique `name` in a `devices.json` file in the working directory. Prompts can then refer to devices by `name`.\n\n```json\n{\n  \"devices\": [\n    {\"name\": \"Boiler\", \"host\": \"10.0.0.3\", \"port\": 47808},\n    {\"name\": \"Valve\", \"host\": \"10.0.0.4\", \"port\": 47808}\n  ]\n}\n```\n\n### MCP Inspector\n\nTo confirm the server is up and running and explore available resources and tools, run the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) and connect it to the BACnet MCP server at `http://127.0.0.1:8000/mcp/`. Make sure to set the transport to `Streamable HTTP`.\n\n```bash\nnpx @modelcontextprotocol/inspector\n```\n\n![s01](https://github.com/user-attachments/assets/1dfcfda5-01ae-411c-8a6b-30996dec41c8)\n\n## Core Concepts\n\nThe BACnet MCP server leverages FastMCP 2.0's core building blocks - resource templates, tools, and prompts - to streamline BACnet read and write operations with minimal boilerplate and a clean, Pythonic interface.\n\n### Read Properties\n\nEach object on a device is mapped to a resource (and exposed as a tool) and [resource templates](https://gofastmcp.com/servers/resources#resource-templates) are used to specify connection details (host, port) and read parameters (instance, property).\n\n```python\n@mcp.resource(\"udp://{host}:{port}/{obj}/{instance}/{prop}\")\n@mcp.tool(\n    annotations={\n        \"title\": \"Read Property\",\n        \"readOnlyHint\": True,\n        \"openWorldHint\": True,\n    }\n)\nasync def read_property(\n    host: str = settings.bacnet.host,\n    port: int = settings.bacnet.port,\n    obj: str = \"analogValue\",\n    instance: str = \"1\",\n    prop: str = \"presentValue\",\n) -\u003e str:\n    \"\"\"Reads the content of a BACnet object property on a remote unit.\"\"\"\n    ...\n```\n\n### Write Properties\n\nWrite operations are exposed as a [tool](https://gofastmcp.com/servers/tools), accepting the same connection details (host, port) and allowing to set the content of an object property in a single, atomic call.\n\n```python\n@mcp.tool(\n    annotations={\n        \"title\": \"Write Property\",\n        \"readOnlyHint\": False,\n        \"openWorldHint\": True,\n    }\n)\nasync def write_property(\n    host: str = settings.bacnet.host,\n    port: int = settings.bacnet.port,\n    obj: str = \"analogValue,1\",\n    prop: str = \"presentValue\",\n    data: str = \"1.0\",\n) -\u003e str:\n    \"\"\"Writes a BACnet object property on a remote device.\"\"\"\n    ...\n```\n\n### Authentication\n\nTo enable authentication using the built-in [AuthKit](https://www.authkit.com) provider for the `Streamable HTTP` transport, provide the AuthKit domain and redirect URL in the `.env` file. Check out the [AuthKit Provider](https://gofastmcp.com/servers/auth/remote-oauth#example%3A-workos-authkit-provider) section for more details.\n\n### Interactive Prompts\n\nStructured response messages are implemented using [prompts](https://gofastmcp.com/servers/prompts) that help guide the interaction, clarify missing parameters, and handle errors gracefully.\n\n```python\n@mcp.prompt(name=\"bacnet_help\", tags={\"bacnet\", \"help\"})\ndef bacnet_help() -\u003e list[Message]:\n    \"\"\"Provides examples of how to use the BACnet MCP server.\"\"\"\n    ...\n```\n\nHere are some example text inputs that can be used to interact with the server.\n\n```text\nRead the presentValue property of analogInput,1 at 10.0.0.4.\nFetch the units property of analogInput 2.\nWrite the value 42 to analogValue instance 1.\nSet the presentValue of binaryOutput 3 to True.\n```\n\n## Examples\n\nThe `examples` folder contains sample projects showing how to integrate with the BACnet MCP server using various client APIs to provide tools and context to LLMs.\n\n- [openai-agents](https://github.com/ezhuk/bacnet-mcp/tree/main/examples/openai-agents) - shows how to connect to the BACnet MCP server using the [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/mcp/).\n- [openai](https://github.com/ezhuk/bacnet-mcp/tree/main/examples/openai) - a minimal app leveraging remote MCP server support in the [OpenAI Python library](https://platform.openai.com/docs/guides/tools-remote-mcp).\n- [pydantic-ai](https://github.com/ezhuk/bacnet-mcp/tree/main/examples/pydantic-ai) - shows how to connect to the BACnet MCP server using the [PydanticAI Agent Framework](https://ai.pydantic.dev).\n\n## Docker\n\nThe BACnet MCP server can be deployed as a Docker container as follows:\n\n```bash\ndocker run -d \\\n  --name bacnet-mcp \\\n  --restart=always \\\n  -p 8080:8000 \\\n  --env-file .env \\\n  ghcr.io/ezhuk/bacnet-mcp:latest\n```\n\nThis maps port `8080` on the host to the MCP server's port `8000` inside the container and loads settings from the `.env` file, if present.\n\n## License\n\nThe server is licensed under the [MIT License](https://github.com/ezhuk/bacnet-mcp?tab=MIT-1-ov-file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezhuk%2Fbacnet-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezhuk%2Fbacnet-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezhuk%2Fbacnet-mcp/lists"}