Skip to content

Conversation

@bjagg
Copy link
Contributor

@bjagg bjagg commented Jan 29, 2026

Checklist
  • commit message follows commit guidelines (see commitlint.config.mjs)
  • tests are included (unit and/or integration tests)
  • all tests are successful
  • documentation is changed or added (in /docs directory)
  • code passes linting checks (uv run ruff check)
  • code passes formatting checks (uv run ruff format)
  • code passes type checking (uv run ty check)
  • pre-commit hooks have been run successfully
  • database schema changes: migration files created and CHANGELOG.md updated
  • API changes: base (Python code) documentation in docs/
    and project README updated
  • configuration changes: relevant folder README updated
  • breaking changes: added to MIGRATION.md with upgrade instructions
    and CHANGELOG.md entry
Type of Change

Refactor Semantic Search MCP Server to only use MDR as a schema source

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • Documentation update
  • Infrastructure/deployment change
  • Performance improvement
  • Code refactoring
Description of Change
Related Issues

Resolves #782

Closes # [[add Github issue number]]

Testing
  • Manual testing performed
  • Automated tests added/updated
  • Integration testing completed
Project Area(s) Affected
  • bases/
  • components/
  • orchestrators/
  • frontends/
  • deployments/
  • CloudFormation/SAM templates
  • Database schema
  • API endpoints
  • Documentation
  • Testing
Additional Notes

Copy link
Contributor

@cbeach47 cbeach47 left a comment

Choose a reason for hiding this comment

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

Smoke test using the Advisor looked good. I noticed the following on start up of the MCP. Is the warning for Organization expected?

2026-01-30 14:35:52.715 INFO | lif.schema_state_manager.core | Initializing SchemaStateManager (sync)...
 2026-01-30 14:35:52.715 INFO | lif.mdr_client.core | Fetching OpenAPI schema from MDR: 17
2026-01-30 14:35:53.024 INFO | httpx | HTTP Request: GET [http://lif-mdr-api:8012/datamodels/open_api_schema/17?include_attr_md=true&include_entity_md=false⁠](http://lif-mdr-api:8012/datamodels/open_api_schema/17?include_attr_md=true&include_entity_md=false) "HTTP/1.1 200 OK"
2026-01-30 14:35:53.025 INFO | lif.mdr_client.core | Successfully loaded OpenAPI schema from MDR
2026-01-30 14:35:53.036 INFO | lif.schema_state_manager.core | Loaded 186 schema leaves for root 'Person'
2026-01-30 14:35:53.045 INFO | lif.schema_state_manager.core | Loaded 14 schema leaves for root 'Course'
2026-01-30 14:35:53.052 ERROR | lif.openapi_schema_parser.core | Root schema 'Organization' not found. Available: ['Assessment', 'Course', 'Credential', 'OperationalStatus', 'OrganizationCode', 'Person', 'Position', 'Program', 'RemunerationPackage']
2026-01-30 14:35:53.052 WARNING | lif.schema_state_manager.core | Failed to load schema leaves for optional root 'Organization': Root schema 'Organization' not found.
2026-01-30 14:35:53.060 INFO | lif.schema_state_manager.core | Loaded 47 schema leaves for root 'Credential'

Maybe a separate ticket, but I'd love to see an integration test where:

  1. MCP is queried and MDR data is pulled
  2. MDR data is changed
  3. MCP is queried and the update MDR data is pulled

Approving for a static review (skimmed the tests), and the smoke test with the default configuration. Is there a scenario you'd recommend to test that a change in MDR propagates into the MCP and the Advisor would adjust it's response?


Note: This updates the internal state but does NOT update the MCP tool
definitions, as those are set at module load time. To use new schema
definitions for tools, the server must be restarted.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a phased approach?

Seems less than ideal to require a restart just so lif_query() or lif_mutation() would pick up the refreshed schema.

Returns:
Tuple of (openapi_dict, source) or (None, source) on failure
"""
# For now, delegate to sync version since load_openapi_schema is sync
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the impact to MCP that this is only sync for now?

Comment on lines +299 to +302
for _ in range(10):
_ = manager.state
_ = manager.is_initialized
_ = manager.get_status()
Copy link
Contributor

Choose a reason for hiding this comment

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

is this really testing thread safety? Appears to be sequential access...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Update Semantic Search API to consume schemas from MDR

2 participants