Skip to main content
The OCI Object Storage MCP server provides tools to interact with Oracle Cloud Infrastructure Object Storage resources, enabling management of buckets, objects, and storage configurations.

Installation

uvx oracle.oci-object-storage-mcp-server

Running the Server

STDIO Transport Mode

uvx oracle.oci-object-storage-mcp-server

HTTP Streaming Transport Mode

ORACLE_MCP_HOST=<hostname/IP address> ORACLE_MCP_PORT=<port number> uvx oracle.oci-object-storage-mcp-server

Available Tools

The server provides the following tools for managing object storage:
Tool NameDescription
get_namespaceGet the object storage namespace for the tenancy
list_bucketsList object storage buckets in a given compartment
get_bucket_detailsGet details for a specific object storage bucket
list_objectsList objects in a given object storage bucket
list_object_versionsList object versions in a given object storage bucket
get_objectGet a specific object from an object storage bucket
upload_objectUpload an object to an object storage bucket

Usage Examples

Get Storage Namespace

What is my object storage namespace?
Retrieves the unique namespace for your tenancy, required for many object storage operations.

List Buckets

List all object storage buckets in my compartment
Shows all buckets with their names, creation dates, and storage tiers.

Get Bucket Details

Show me details for bucket "data-backup"
Retrieves comprehensive bucket information including:
  • Storage tier (Standard/Archive)
  • Public access settings
  • Versioning status
  • Encryption configuration
  • Size and object count

List Objects in a Bucket

List all objects in bucket "documents"
Shows all objects with their names, sizes, and last modified dates.
List objects with prefix "reports/2024/" in bucket "documents"
Filters objects by prefix for hierarchical organization.

Download an Object

Get object "report.pdf" from bucket "documents"
Retrieves the object content and metadata.

Upload an Object

Upload file "/path/to/file.txt" to bucket "documents" as "archive/file.txt"
Uploads a file to the specified bucket with the given object name.

Work with Object Versions

List all versions of objects in bucket "documents"
When versioning is enabled, shows all versions of objects including version IDs and timestamps.

Understanding Object Storage

What is Object Storage?

OCI Object Storage is a highly durable, scalable storage service for:
  • Unstructured data (files, images, videos, backups)
  • Big data and analytics
  • Archive and compliance
  • Content delivery
  • Application data

Key Features

  • Unlimited Scalability - Store any amount of data
  • High Durability - 99.999999999% (11 nines) durability
  • Strong Consistency - Read-after-write consistency
  • Security - Encryption at rest and in transit
  • Versioning - Maintain multiple versions of objects
  • Lifecycle Management - Automate data archival and deletion

Storage Tiers

Standard (Hot)
  • Frequent access patterns
  • Immediate availability
  • Higher storage cost, no retrieval fees
  • Default tier for most use cases
Infrequent Access (Cool)
  • Data accessed less than once per month
  • Lower storage cost
  • Retrieval fees apply
  • Minimum retention: 31 days
Archive (Cold)
  • Long-term retention (90+ days)
  • Lowest storage cost
  • Objects must be restored before access
  • Restoration takes up to 1 hour
  • Minimum retention: 90 days

Namespaces

A namespace is a top-level container for all buckets and objects:
  • Unique per tenancy across all regions
  • Used in API calls and URLs
  • Forms part of object URLs: https://objectstorage.{region}.oraclecloud.com/n/{namespace}/b/{bucket}/o/{object}

Buckets

Buckets are logical containers for objects:
  • Unique names within a namespace
  • Configurable public/private access
  • Support versioning and lifecycle policies
  • Can enable encryption with customer-managed keys

Objects

Objects are the files stored in buckets:
  • Up to 10 TiB per object (using multipart upload)
  • Immutable (modify requires overwrite)
  • Support custom metadata
  • Can have object lifecycle policies

Authentication

The server uses OCI CLI configuration from ~/.oci/config. Ensure you have:
  1. OCI CLI installed and configured
  2. Valid API credentials
  3. Appropriate IAM permissions for object storage operations
oci setup config

Required Permissions

Your OCI user or instance principal needs these IAM permissions: Full Management:
Allow group ObjectStorageAdmins to manage buckets in compartment MyCompartment
Allow group ObjectStorageAdmins to manage objects in compartment MyCompartment
Read/Write Objects:
Allow group ObjectStorageUsers to read buckets in compartment MyCompartment
Allow group ObjectStorageUsers to manage objects in compartment MyCompartment
Read-Only:
Allow group ObjectStorageReaders to read buckets in compartment MyCompartment
Allow group ObjectStorageReaders to read objects in compartment MyCompartment
Security NoticeAll actions are performed with the permissions of the configured OCI CLI profile. We advise:
  • Least-privilege IAM setup
  • Secure credential management
  • Safe network practices
  • Secure logging
  • Never expose secrets in logs or responses
  • Be cautious with public bucket access

Common Use Cases

Backup and Archive

  • Store database backups
  • Archive logs and audit trails
  • Disaster recovery storage
  • Long-term compliance data retention

Big Data and Analytics

  • Data lake storage
  • ETL pipeline input/output
  • Machine learning datasets
  • Analytics source data

Content Distribution

  • Static website hosting
  • Media file storage
  • Software distribution
  • Document repositories

Application Data

  • User uploads and attachments
  • Application state storage
  • Configuration files
  • Export/import files

Best Practices

Organization

  • Use meaningful bucket names
  • Leverage object prefixes for hierarchy (folders)
  • Implement naming conventions
  • Tag buckets for cost tracking

Security

  • Enable encryption at rest
  • Use private buckets by default
  • Implement pre-authenticated requests (PARs) for temporary access
  • Enable versioning for critical data
  • Use object lifecycle policies to expire old data

Performance

  • Use multipart upload for large files (>100 MB)
  • Parallelize uploads/downloads
  • Consider CDN for content delivery
  • Use appropriate storage tier for access patterns

Cost Optimization

  • Move infrequently accessed data to Archive tier
  • Use lifecycle policies for automatic tiering
  • Delete unnecessary object versions
  • Monitor storage usage and costs
  • Use infrequent access tier for appropriate data

Advanced Features

Object Versioning

Enable versioning to maintain multiple versions of objects:
  • Protect against accidental deletion
  • Maintain history of changes
  • Recover previous versions
  • Each version has unique ID

Lifecycle Policies

Automate data management:
  • Transition objects to Archive tier after X days
  • Delete objects after retention period
  • Delete old object versions
  • Abort incomplete multipart uploads

Pre-Authenticated Requests (PARs)

Grant temporary access without authentication:
  • Time-limited URLs
  • Read or write access
  • Specific object or bucket prefix
  • No OCI credentials required

Replication

Replicate objects across regions:
  • Disaster recovery
  • Geographic distribution
  • Compliance requirements
  • Near-real-time replication

Troubleshooting

Access Denied Errors

  • Verify IAM policies grant necessary permissions
  • Check bucket-level policies
  • Ensure using correct namespace and bucket name
  • Validate API credentials

Upload Failures

  • Check object size limits
  • Verify network connectivity
  • Ensure sufficient permissions
  • Use multipart upload for large files

Object Not Found

  • Verify object name (case-sensitive)
  • Check bucket name and namespace
  • Ensure object exists in correct region
  • For versioned buckets, specify version ID if needed

Performance Issues

  • Use multipart upload for files >100 MB
  • Parallelize operations
  • Check network bandwidth
  • Consider geographic proximity to region
  • Database - Backup databases to object storage
  • Compute - Mount object storage to instances
  • Migration - Migrate data using object storage
  • Monitoring - Monitor storage metrics

Additional Resources

Build docs developers (and LLMs) love