dataio.mcp.server¶
DataIO MCP Server - Core server implementation.
This server exposes DataIO platform capabilities as MCP tools that can be used by AI assistants like Claude via AWS Bedrock.
Module Contents¶
Classes¶
MCP Server for the DataIO platform. |
Functions¶
Context manager for database sessions. |
|
Check if a user has access to a dataset. |
Data¶
API¶
- dataio.mcp.server.logger¶
‘getLogger(…)’
- dataio.mcp.server.check_dataset_access(session, user_email: str, dataset_id: str) bool[source]¶
Check if a user has access to a dataset.
Returns True if:
Dataset is public (access_level = DOWNLOAD)
User is admin
User has direct permission
User’s group has permission
- class dataio.mcp.server.DataIOMCPServer[source]¶
MCP Server for the DataIO platform.
Provides tools for:
Searching datasets by query, category, tags
Getting detailed dataset information
Listing categories and data owners
Getting download information (for authorized users)
Getting dataset schemas/data dictionaries
Initialization
- _build_tool_definitions() dict[str, dataio.mcp.types.BedrockToolSpec][source]¶
Build the tool definitions for Bedrock.
- async execute_tool(tool_name: str, tool_input: dict, user_context: dataio.mcp.types.UserContext | None = None) dataio.mcp.types.ToolResult[source]¶
Execute a tool with the given input.
Args: tool_name: Name of the tool to execute tool_input: Input parameters for the tool user_context: Optional user context for permission checks
Returns: ToolResult with success status and data or error
- async _search_datasets(params: dict, user_context: dataio.mcp.types.UserContext | None) dataio.mcp.types.ToolResult[source]¶
Search for datasets.
- async _get_dataset_details(params: dict, user_context: dataio.mcp.types.UserContext | None) dataio.mcp.types.ToolResult[source]¶
Get detailed dataset information.
- async _list_categories() dataio.mcp.types.ToolResult[source]¶
List all categories.
- async _list_data_owners() dataio.mcp.types.ToolResult[source]¶
List all data owners.
- async _get_download_info(params: dict, user_context: dataio.mcp.types.UserContext | None) dataio.mcp.types.ToolResult[source]¶
Get download information for a dataset.
- async _get_dataset_schema(params: dict, user_context: dataio.mcp.types.UserContext | None) dataio.mcp.types.ToolResult[source]¶
Get dataset schema/data dictionary.