All Products
Search
Document Center

Object Storage Service:OSS MCP Server (Alpha)

Last Updated:Mar 20, 2026

OSS MCP Server integrates Alibaba Cloud Object Storage Service (OSS) data management capabilities into AI applications via the Model Context Protocol (MCP).

Important

This is an Alpha version and is subject to major changes.

Prerequisites

Before you begin, ensure that you have:

  • Node.js >= 18.20.5

  • An Alibaba Cloud account with OSS access

  • An AccessKey ID and AccessKey secret (or temporary credentials)

Tools

OSS MCP Server provides the following tools:

ToolAPI nameDescription
List bucketsListBucketsList buckets in your account, with optional filtering by prefix or resource group
View bucket informationGetBucketInfoGet configuration and metadata for a specific bucket
Get bucket statsGetBucketStatGet storage capacity, object count, and multipart part count for a bucket

Tool parameters

ListBuckets

All parameters are optional.

ParameterDescription
prefixFilter results to bucket names that start with this prefix
markerResume pagination from this position. Results are returned in alphabetical order, starting from the entry after the marker.
maxKeysMaximum number of buckets to return. Default: 100. The upper limit is configurable on the OSS MCP Server instance (1-1000).
resourceGroupIdFilter results to buckets in this resource group
regionOSS-specific region ID (for example, oss-cn-hangzhou). Determines the endpoint for the request.

GetBucketInfo

ParameterRequiredDescription
bucketYesName of the bucket
regionNoOSS-specific region ID (for example, oss-cn-hangzhou)

GetBucketStat

ParameterRequiredDescription
bucketYesName of the bucket
regionNoOSS-specific region ID (for example, oss-cn-hangzhou)

Example prompts

Once connected, use natural language to interact with your OSS data:

  • "List all my OSS buckets"

  • "Show me the storage stats for my-bucket"

  • "What region is my-bucket in?"

  • "How many objects are in my-bucket?"

  • "List buckets in resource group rg-abc123"

Authentication

OSS MCP Server reads credentials from environment variables. Set the following before starting the server:

VariableRequiredDescription
OSS_ACCESS_KEY_IDYesYour AccessKey ID
OSS_ACCESS_KEY_SECRETYesYour AccessKey secret
OSS_SECURITY_TOKENOnly for temporary credentialsSecurity token from STS
OSS_REGIONNoDefault OSS region ID (for example, oss-cn-hangzhou)
OSS_ENDPOINTNoCustom endpoint URL

For production environments, use RAM roles or STS temporary credentials instead of long-term AccessKey credentials.

Connect via STDIO

STDIO is the simplest integration mode. The AI client launches the MCP Server as a subprocess and communicates over standard input/output.

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "alibabacloud-oss": {
      "command": "npx",
      "args": ["-y", "alibabacloud-oss-mcp-server@alpha"],
      "env": {
        "OSS_ACCESS_KEY_ID": "<your-access-key-id>",
        "OSS_ACCESS_KEY_SECRET": "<your-access-key-secret>"
      }
    }
  }
}

Cherry Studio

Configure a new MCP server with these settings:

FieldValue
TypeStandard input/output
Commandnpx
Parameters-y alibabacloud-oss-mcp-server@alpha
OSS_ACCESS_KEY_ID<your-access-key-id> (required)
OSS_ACCESS_KEY_SECRET<your-access-key-secret> (required)
OSS_SECURITY_TOKEN<your-security-token> (optional)
OSS_REGIONoss-cn-hangzhou (optional)
OSS_ENDPOINThttps://oss-cn-hangzhou.aliyuncs.com (optional)

Connect via Streamable HTTP

In Streamable HTTP mode, you run OSS MCP Server as a standalone HTTP service. AI clients connect over HTTP instead of spawning a subprocess. This mode suits remote deployments and server-side integrations.

Start the server

export OSS_ACCESS_KEY_ID="<your-access-key-id>"
export OSS_ACCESS_KEY_SECRET="<your-access-key-secret>"

npx -y -p alibabacloud-oss-mcp-server@alpha -p express alibabacloud-oss-mcp-server --transport=streamable-http --port=18081

The server listens at http://localhost:18081/mcp.

OSS MCP Server only listens on localhost. For remote access, set up a reverse proxy with port forwarding. Configure HTTPS and authentication on the reverse proxy before exposing it to external traffic.

Configure clients

Cherry Studio

FieldValue
TypeStreamable HTTP
URLhttp://localhost:18081/mcp

Dify

FieldValue
Server-side endpoint URLhttp://localhost:18081/mcp

Use programmatically

Install the package to embed OSS MCP Server directly in your application:

npm install alibabacloud-oss-mcp-server@alpha

Basic usage

import { OSSMcpServer, OSSMcpServerTransport } from 'alibabacloud-oss-mcp-server/server';

const server = new OSSMcpServer({
  accessKeyId: process.env.OSS_ACCESS_KEY_ID,
  accessKeySecret: process.env.OSS_ACCESS_KEY_SECRET,
  securityToken: process.env.OSS_SECURITY_TOKEN,  // Only for temporary credentials
  region: process.env.OSS_REGION,
  endpoint: process.env.OSS_ENDPOINT,
  transportType: OSSMcpServerTransport.STDIO
});

await server.runServer();

Configuration options

OSS client configuration

ParameterDefaultDescription
accessKeyIdAccessKey ID (required)
accessKeySecretAccessKey secret (required)
securityTokenSecurity token for temporary credentials
refreshCredentialsFunction to refresh temporary credentials before they expire
refreshCredentialsInterval300000 ms (5 min)How often to refresh credentials, in milliseconds
lastRefreshCredentialsTimeClient init timeTimestamp of the last credential refresh
regionoss-cn-hangzhouRegion ID or OSS-specific region ID. Converted to a region ID for request signing.
endpointInternet endpoint derived from regionService endpoint. Overrides the internal parameter. If the value includes a protocol, the secure parameter is ignored. Required if region is a plain region ID or if you're accessing OSS through a custom domain.
internalfalseUse an internal network endpoint
securetrueUse HTTPS
cnamefalseTreat endpoint as a CNAME (custom domain). Requires endpoint to be set.
sldEnablefalseUse a second-level domain to access OSS
signVersionESignVersion.V4Signature version
isRequestPayfalseEnable pay-by-requester mode. Adds the x-oss-request-payer: requester header to requests.
userAgentCustom User-Agent string, sent as part of the User-Agent request header
timeout60000 ms (60 s)Request timeout in milliseconds
disabledMD5falseSkip Content-MD5 calculation
proxyProxy settings for HTTP requests
retryMax0Maximum number of retries for failed requests
requestErrorShouldRetryRetry allFunction to determine whether to retry a failed request
amendTimeSkewed0Time drift correction in milliseconds
customRequestFunctionCustom request implementation
customSignCustom signing function, applied to all requests that require signing except POST signatures

MCP Server configuration

ParameterDefaultDescription
transportTypestdioCommunication mode: stdio or streamable-http
port18081HTTP server port (Streamable HTTP only)
toolsAll enabledList of tools to enable. Omit to enable all tools.
listToolsMaxKeysMaxValue100Upper limit for maxKeys in list-based tools (1-1000)
listToolsDefaultMaxKeysValue of listToolsMaxKeysMaxValueDefault value for maxKeys in list-based tools
httpServerCustom HTTP server instance (Streamable HTTP only)
loggerLogger instance
xmlContentTextfalseReturn tool results as raw XML instead of JSON
toolsRequestSuccessCallbackCallback invoked on successful tool requests
toolsRequestErrorCallbackCallback invoked on failed tool requests