connect_to_apache_iceberg
Create a Timeplus database in Iceberg type to connect to Apache Iceberg using an AWS account, S3 bucket, and region.
Instructions
Create a Timeplus database in iceberg type to connect to Iceberg
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iceberg_db | Yes | ||
| aws_account_id | Yes | ||
| s3_bucket | Yes | ||
| aws_region | No | us-west-2 | |
| is_s3_table_bucket | No |
Implementation Reference
- mcp_timeplus/mcp_server.py:242-263 (handler)The `connect_to_apache_iceberg` function is the handler decorated with @mcp.tool(). It creates a Timeplus database of type 'iceberg' configured to connect to Apache Iceberg via AWS Glue catalog and S3 storage, then shows the streams in that database.
@mcp.tool() def connect_to_apache_iceberg(iceberg_db: str,aws_account_id: int, s3_bucket: str, aws_region: str="us-west-2",is_s3_table_bucket: bool=False): """Create a Timeplus database in iceberg type to connect to Iceberg""" if iceberg_db is None or aws_account_id is None or s3_bucket is None: return {"error": "iceberg_db, aws_account_id, and s3_bucket are required"} logger.info("Creating Iceberg database") warehouse=aws_account_id storage_endpoint=f"https://{s3_bucket}.s3.{aws_region}.amazonaws.com" if is_s3_table_bucket: warehouse=f"{aws_account_id}:s3tablescatalog/{s3_bucket}" storage_endpoint=f"https://s3tables.{aws_region}.amazonaws.com/{s3_bucket}" sql=f"""CREATE DATABASE {iceberg_db} SETTINGS type='iceberg',catalog_uri='https://glue.{aws_region}.amazonaws.com/iceberg',catalog_type='rest', warehouse='{warehouse}',storage_endpoint='{storage_endpoint}',use_environment_credentials=true, rest_catalog_sigv4_enabled=true,rest_catalog_signing_region='{aws_region}',rest_catalog_signing_name='glue' """ run_sql(sql) logger.info("Iceberg database created") sql=f"SHOW STREAMS FROM {iceberg_db}" return run_sql(sql) - mcp_timeplus/mcp_server.py:39-39 (registration)The FastMCP server is instantiated, and the @mcp.tool() decorator on line 242 registers 'connect_to_apache_iceberg' as an MCP tool.
mcp = FastMCP(MCP_SERVER_NAME, dependencies=deps) - mcp_timeplus/__init__.py:10-10 (registration)The function is imported and exposed in the package's __init__.py.
connect_to_apache_iceberg, - mcp_timeplus/__init__.py:22-22 (registration)The function name is listed in __all__ for public export.
"connect_to_apache_iceberg",