mirror of
https://github.com/dnlbauer/cordra-mcp.git
synced 2026-09-11 06:05:29 +00:00
feat: add basic MCP server with ping tool
This commit is contained in:
59
README.md
59
README.md
@@ -45,19 +45,17 @@ Access to repository design object and server information to understand behavior
|
|||||||
### Binary Payload Awareness
|
### Binary Payload Awareness
|
||||||
Discovery of attached binary files with metadata (names, sizes, types) without downloading the actual content.
|
Discovery of attached binary files with metadata (names, sizes, types) without downloading the actual content.
|
||||||
|
|
||||||
## Operations
|
## MCP Architecture
|
||||||
|
|
||||||
The MCP server provides eight essential operations:
|
### Resources
|
||||||
|
- `cordra://schemas/` - List all available schema types
|
||||||
|
- `cordra://schemas/{type_name}` - Schema definition for a specific type
|
||||||
|
- `cordra://objects/` - Browse repository objects
|
||||||
|
- `cordra://objects/{object_id}` - Object metadata and content
|
||||||
|
- `cordra://design_object/` - Repository design configuration
|
||||||
|
|
||||||
### 1. `get_object`
|
### Tools
|
||||||
Retrieve a specific digital object by its ID or handle, including all metadata and content.
|
#### `search_objects`
|
||||||
|
|
||||||
**Parameters:**
|
|
||||||
- `id` (string): Object identifier or handle
|
|
||||||
|
|
||||||
**Returns:** Complete object JSON with metadata
|
|
||||||
|
|
||||||
### 2. `search_objects`
|
|
||||||
Search for objects using queries, filters, and sorting options with pagination support.
|
Search for objects using queries, filters, and sorting options with pagination support.
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
@@ -69,45 +67,6 @@ Search for objects using queries, filters, and sorting options with pagination s
|
|||||||
|
|
||||||
**Returns:** Search results with object summaries and pagination info
|
**Returns:** Search results with object summaries and pagination info
|
||||||
|
|
||||||
### 3. `list_schemas`
|
|
||||||
List all available schemas/types in the repository.
|
|
||||||
|
|
||||||
**Returns:** Array of schema names and basic information
|
|
||||||
|
|
||||||
### 4. `get_schema`
|
|
||||||
Retrieve detailed schema definition for a specific object type.
|
|
||||||
|
|
||||||
**Parameters:**
|
|
||||||
- `type` (string): Schema/type name
|
|
||||||
|
|
||||||
**Returns:** Complete JSON schema with Cordra-specific extensions
|
|
||||||
|
|
||||||
### 5. `list_payloads`
|
|
||||||
List binary payloads attached to a specific object.
|
|
||||||
|
|
||||||
**Parameters:**
|
|
||||||
- `id` (string): Object identifier or handle
|
|
||||||
|
|
||||||
**Returns:** Array of payload metadata (names, sizes, content types)
|
|
||||||
|
|
||||||
### 6. `get_object_acl`
|
|
||||||
Retrieve access control list for a specific object.
|
|
||||||
|
|
||||||
**Parameters:**
|
|
||||||
- `id` (string): Object identifier or handle
|
|
||||||
|
|
||||||
**Returns:** Object permissions including readers and writers
|
|
||||||
|
|
||||||
### 7. `get_server_info`
|
|
||||||
Get server version, capabilities, and technical information.
|
|
||||||
|
|
||||||
**Returns:** Server metadata and configuration details
|
|
||||||
|
|
||||||
### 8. `get_design_object`
|
|
||||||
Retrieve the repository's design object containing behavioral configuration.
|
|
||||||
|
|
||||||
**Returns:** Repository configuration including authorization settings, handle minting rules, and UI behavior
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The MCP server requires connection details for the target Cordra instance:
|
The MCP server requires connection details for the target Cordra instance:
|
||||||
|
|||||||
23
src/mcp_cordra/server.py
Normal file
23
src/mcp_cordra/server.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
"""MCP server for Cordra digital object repository."""
|
||||||
|
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
from mcp.server.fastmcp import FastMCP
|
||||||
|
|
||||||
|
# Initialize the MCP server
|
||||||
|
mcp = FastMCP("mcp-cordra")
|
||||||
|
|
||||||
|
|
||||||
|
@mcp.tool()
|
||||||
|
async def ping() -> str:
|
||||||
|
"""Simple ping tool to test server connectivity."""
|
||||||
|
return "pong"
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
"""Main entry point for the MCP server."""
|
||||||
|
asyncio.run(mcp.run())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user