25 Commits

Author SHA1 Message Date
Daniel Bauer
a4d12d526b feat: remove resources for schemas and replace them with tool calls 2025-12-04 13:47:42 +01:00
Daniel Bauer
ad6dce005b feat: remove cordra object resource and made design object retrieval a tool call 2025-12-04 13:40:57 +01:00
Daniel Bauer
3c8367f804 feat: add get_object tool for retrieving Cordra digital objects by ID with error handling 2025-12-02 17:34:45 +01:00
Daniel Bauer
7b77186ced feat: enhance tool documentation and add unit test for slash-prefixed properties 2025-12-02 16:53:25 +01:00
Daniel Bauer
f35305568c fix: typing errors in tests 2025-07-09 11:09:17 +02:00
Daniel Bauer
663e6c3064 chore: reformat code 2025-07-09 11:01:32 +02:00
Daniel Bauer
e01d732014 feat: add tool to count objects 2025-07-09 11:01:17 +02:00
Daniel Bauer
3dc4e664af feat: change search_objects to return only object IDs
- Changed search_objects function to return only object IDs instead of full objects
- Updated response format to include object_ids, total_count, page_num, and page_size
- Increased default page size from 1 to 25 for better performance
- Updated documentation to reflect new return format

This improves performance by reducing response size and encourages proper
use of cordra:// resources for full object retrieval.
2025-07-09 11:00:00 +02:00
Daniel Bauer
64c625dcb9 refactor(search): change default limit from None to 1
Change the default limit parameter for search_objects from None to 1
to optimize for single object searches. This makes the API more
intuitive for common use cases where users want to find a specific
object without specifying pagination parameters.

Changes:
- Update limit parameter type from `int | None = None` to `int = 1`
- Remove conditional logic handling None values
- Update documentation to reflect new default
- Update all tests to expect new default behavior

This improves usability for exploratory searches while maintaining
full pagination functionality when larger limits are specified.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 12:37:40 +02:00
Daniel Bauer
dec0b7702a feat: add pagination support to search_objects MCP tool
Add page_num parameter to the search_objects tool to enable pagination
control for users. This provides full pagination functionality while
maintaining backward compatibility.

Changes:
- Add page_num parameter with default value of 0 (0-based pagination)
- Update tool description to document pagination parameters
- Enhance docstring to explain page_num and clarify limit as page_size
- Add comprehensive tests for pagination scenarios
- All existing functionality remains unchanged

Users can now paginate through search results:
- search_objects("query") - first page, 20 results
- search_objects("query", limit=50) - first page, 50 results
- search_objects("query", page_num=1) - second page, 20 results
- search_objects("query", limit=10, page_num=5) - sixth page, 10 results

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 12:32:43 +02:00
Daniel Bauer
56e1a85d5e refactor: remove unused max_search_results config parameter
The max_search_results configuration parameter was only used in one
location and added unnecessary complexity. Search operations now use
a consistent default page size of 20, which aligns with the pagination
implementation and provides better user experience.

Changes:
- Remove max_search_results from CordraConfig
- Update search_objects to use default page size of 20
- Simplify tests by removing config mocking
- Maintain backward compatibility through limit parameter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 12:23:57 +02:00
Daniel Bauer
f32b4c9448 fix: implement pagination for schema resource fetching
The schema resource registration was only fetching the first page of
schemas from Cordra, causing schemas beyond the page limit to not be
registered as MCP resources.

Changes:
- Enhanced find() method to support pagination with page_size/page_num
- Modified schema registration to paginate through all results
- Updated return structure to include pagination metadata
- Added comprehensive test coverage for pagination scenarios
- Maintains backward compatibility with existing code

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 12:16:38 +02:00
Daniel Bauer
748d9b604f feat: add design object resource for repository configuration access
Add new MCP resource cordra://design to retrieve Cordra's central design object
containing repository configuration, type definitions, and system settings.

- Add CordraClient.get_design() method using /api/objects/design endpoint
- Add get_cordra_design() resource handler with proper MCP annotations
- Include comprehensive error handling for authentication failures
- Document administrative privilege requirements in descriptions
- Add complete test coverage for both client and server functionality

The design object provides AI systems access to understand the complete
data model and configuration structure of a Cordra repository.
2025-07-04 10:07:16 +02:00
Daniel Bauer
94340e2bb1 feat: add search tool for digital object discovery
Implement MCP tool to search Cordra repository using Lucene/Solr syntax.
Enables AI assistants to discover and filter digital objects by content,
type, and other metadata fields.

Features:
- Lucene/Solr compatible query syntax support
- Optional type filtering (e.g., Person, Document)
- Configurable result limits with sensible defaults
- Comprehensive error handling and validation
- JSON formatted results with proper indentation

Technical changes:
- Enhanced CordraClient.find() with type and limit parameters
- Added search_objects MCP tool with detailed annotations
- Removed unused tools module in favor of decorator approach
- Added 12 comprehensive unit tests covering all scenarios
2025-07-04 09:30:38 +02:00
Daniel Bauer
2fdf4184de feat: change variable name for base url 2025-06-30 12:07:09 +02:00
Daniel Bauer
96df10adb0 fix: update tests for module rename from mcp_cordra to cordra_mcp
- Updated all import statements in test files
- Added types-requests dependency for mypy type checking
- Fixed code formatting with ruff
2025-06-30 12:01:53 +02:00
Daniel Bauer
4102860d98 feat: linting 2025-06-30 11:52:10 +02:00
Daniel Bauer
9901f51f06 fix: linter and unit tests 2025-06-30 11:44:25 +02:00
daniel
4ef2f50e72 feat: better error handling. 2025-06-29 23:45:00 +02:00
daniel
53cbb53178 feat: replace CordraPy with http requests 2025-06-29 14:50:42 +02:00
daniel
cc06e1eace feat: add schema listing functionality
- Add find method to CordraClient for querying objects
- Implement cordra://schemas resource for listing available type schemas
- Add comprehensive unit tests for both client find method and server schema listing
- Handle CordraPy response format with results array extraction
- Support schema name extraction from returned objects
2025-06-29 14:28:08 +02:00
daniel
0f9d33c20b feat: add digital object resource 2025-06-29 13:59:22 +02:00
daniel
fed4c26f21 fix: cordapy response parsing 2025-06-29 13:54:15 +02:00
daniel
2cca4adeb8 feat: implement cordra client 2025-06-29 11:42:58 +02:00
daniel
d95151f9a4 feat: initialize Python MCP server project structure
- Add pyproject.toml with dependencies and dev tools
- Create src/mcp_cordra package structure
- Add tests directory
- Configure uv environment with lock file
- Add comprehensive .gitignore

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-28 19:42:10 +02:00