Skip to content

feat: Implement Phase 3.4 - Subscription System (CFOS-27)#43

Merged
jayscambler merged 1 commit intomainfrom
jay/cfos-27-mcp-server-components
Jun 19, 2025
Merged

feat: Implement Phase 3.4 - Subscription System (CFOS-27)#43
jayscambler merged 1 commit intomainfrom
jay/cfos-27-mcp-server-components

Conversation

@jayscambler
Copy link
Contributor

Summary

  • Implement polling-based subscription system for monitoring dataset changes
  • Add 4 new subscription tools to the MCP server
  • Enable clients to watch for changes without constant polling

Implementation Details

New Components:

  • SubscriptionManager: Core class for tracking dataset changes using Lance versioning
  • 4 subscription tools: subscribe_changes, poll_changes, unsubscribe, get_subscriptions
  • Comprehensive test suite with 11 tests (all passing)

Key Features:

  • Version-based change detection: Efficiently compares Lance dataset versions
  • Long polling support: Clients can wait up to 300s for changes
  • Resource filtering: Monitor documents, collections, or all resources
  • Transport-agnostic: Works with stdio, ready for HTTP/SSE

Architecture:

contextframe/mcp/subscriptions/
├── __init__.py
├── manager.py          # SubscriptionManager with change detection
└── tools.py           # 4 subscription tools

Test Plan

  • Run subscription tests: uv run pytest contextframe/tests/test_mcp/test_subscription_tools.py -v
  • Verify all 11 tests pass
  • Check test coverage (100% for subscription tools)
  • Manual testing with MCP client
  • Performance testing with large datasets

Progress Update

Phase 3.4 Complete!

  • Total tools implemented: 35/43
  • Next: Phase 3.5 (HTTP Transport) or Phase 3.6 (Analytics & Performance)

Related to #27

Add polling-based subscription system for monitoring dataset changes:

- Create SubscriptionManager for version-based change detection
- Implement 4 subscription tools:
  - subscribe_changes: Create subscriptions with filters
  - poll_changes: Long polling for changes (up to 300s)
  - unsubscribe: Cancel active subscriptions
  - get_subscriptions: List all subscriptions
- Add comprehensive test suite (11 tests, all passing)
- Transport-agnostic design ready for stdio and future HTTP/SSE
- Efficient change detection using Lance version comparison

Total tools implemented: 35/43
@linear
Copy link

linear bot commented Jun 19, 2025

@jayscambler jayscambler merged commit 1555460 into main Jun 19, 2025
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.

1 participant