Skip to content

MCP: Device Profiles#20

Merged
rnovatorov merged 3 commits into
mainfrom
rnovatorov/device-profiles
Jun 22, 2026
Merged

MCP: Device Profiles#20
rnovatorov merged 3 commits into
mainfrom
rnovatorov/device-profiles

Conversation

@rnovatorov

Copy link
Copy Markdown
Member

Closes #15.

Copilot AI review requested due to automatic review settings June 22, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the MCP API to better expose Enapter blueprint/profile information to clients by (1) adding blueprint_id to device results and (2) exposing device profile membership via a new read_blueprint(section="implements") section, alongside propagating per-declaration implements mappings.

Changes:

  • Add required blueprint_id propagation from SDK → DTO → domain → MCP Device, and update search_devices schema/docstring accordingly.
  • Add BlueprintSection.IMPLEMENTS and support read_blueprint(section="implements") returning list[str] of implemented profile names with filtering/pagination.
  • Add optional implements: list[str] | None metadata to telemetry/property/command declarations (domain + MCP models) and map it from the HTTP manifest payload.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/mcp/test_server.py Adds MCP-layer tests ensuring read_blueprint returns bare strings for implements and models for other sections.
tests/unit/mcp/models/test_telemetry_attribute_declaration.py Verifies MCP telemetry declaration model propagates implements from domain and defaults to None.
tests/unit/mcp/models/test_property_declaration.py Verifies MCP property declaration model propagates implements from domain and defaults to None.
tests/unit/mcp/models/test_device.py Updates device model tests for required blueprint_id propagation.
tests/unit/mcp/models/test_command_declaration.py Verifies MCP command declaration model propagates implements from domain and defaults to None.
tests/unit/http/test_enapter_data_mapper.py Adds mapper tests for top-level manifest implements, per-declaration implements, and blueprint_id mapping.
tests/unit/domain/test_blueprint_summary.py Updates manifest construction in tests to include required implements field.
tests/unit/core/test_device_search_query.py Updates DTO construction in tests to include required blueprint_id.
tests/unit/core/test_application_server.py Adds coverage for read_blueprint implements section and updates test DTO/manifest helpers.
tests/integration/schemas/search_devices.json Regenerates schema snapshot to include required blueprint_id and updated tool description.
tests/integration/schemas/read_blueprint.json Regenerates schema snapshot to include implements section and string output variant; adds declaration-level implements fields.
src/enapter_mcp_server/mcp/server.py Updates tool docstrings and extends read_blueprint to return strings for the implements section.
src/enapter_mcp_server/mcp/models/telemetry_attribute_declaration.py Adds optional implements field and maps it from domain.
src/enapter_mcp_server/mcp/models/property_declaration.py Adds optional implements field and maps it from domain.
src/enapter_mcp_server/mcp/models/device.py Adds required blueprint_id to MCP Device model and maps it from domain.
src/enapter_mcp_server/mcp/models/command_declaration.py Adds optional implements field and maps it from domain.
src/enapter_mcp_server/mcp/models/blueprint_section.py Extends MCP blueprint section literal to include "implements".
src/enapter_mcp_server/http/enapter_data_mapper.py Maps blueprint_id, top-level manifest implements, and per-declaration implements from HTTP payloads.
src/enapter_mcp_server/domain/telemetry_attribute_declaration.py Adds optional per-declaration implements field to domain telemetry declarations.
src/enapter_mcp_server/domain/property_declaration.py Adds optional per-declaration implements field to domain property declarations.
src/enapter_mcp_server/domain/device.py Adds required blueprint_id to domain device model.
src/enapter_mcp_server/domain/device_manifest.py Adds required top-level implements: list[str] to manifests.
src/enapter_mcp_server/domain/command_declaration.py Adds optional per-declaration implements field to domain command declarations.
src/enapter_mcp_server/domain/blueprint_section.py Adds IMPLEMENTS = "implements" enum member.
src/enapter_mcp_server/core/device_dto.py Adds required blueprint_id to the internal DTO.
src/enapter_mcp_server/core/application_server.py Propagates blueprint_id into domain devices; adds implements support in read_blueprint.
specs/SPEC-004-blueprint-id.md Documents design/constraints for exposing blueprint_id on devices.
specs/SPEC-005-profile-mappings-on-declarations.md Documents design/constraints for per-declaration implements mappings.
specs/SPEC-006-device-profile-membership.md Documents design/constraints for top-level manifest implements and read_blueprint(section="implements").

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rnovatorov rnovatorov merged commit d0e00a1 into main Jun 22, 2026
4 checks passed
@rnovatorov rnovatorov deleted the rnovatorov/device-profiles branch June 22, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: Device Profiles

2 participants