Metadata-Version: 2.5
Name: alibabacloud-sls-mcp-proxy
Version: 0.3.3
Summary: Local MCP proxy for Alibaba Cloud Simple Log Service
Keywords: alibabacloud,mcp,model-context-protocol,sls
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: Proxy Servers
Requires-Python: >=3.10
Requires-Dist: aiohttp<4,>=3.9
Description-Content-Type: text/markdown

# Alibaba Cloud SLS MCP Proxy

[简体中文](README.zh-CN.md) | English

Connect your MCP client to Alibaba Cloud Simple Log Service (SLS).

## Requirements

- Python 3.10 or later and [`uv`](https://docs.astral.sh/uv/).
- Alibaba Cloud credentials with permission to access the SLS resources you need.
- [Alibaba Cloud CLI](https://www.alibabacloud.com/help/en/cli/) if using a CLI profile.

## Quick start

Configure an Alibaba Cloud CLI profile, then add the following to your MCP
client configuration. Replace `default` with your profile name:

```json
{
  "mcpServers": {
    "alibabacloud-sls": {
      "command": "uvx",
      "args": [
        "alibabacloud-sls-mcp-proxy@latest",
        "--profile",
        "default"
      ]
    }
  }
}
```

This uses stdio mode: your MCP client starts the proxy automatically.
Configuration locations vary by client; follow your client's MCP setup guide.
If it cannot find `uvx` or `aliyun`, ensure both are available to the client,
or use the absolute path to `uvx` in the configuration.

### Use environment credentials instead

Omit `--profile` and its value from the configuration above, and set these
variables in the environment that starts the proxy:

- `ALIBABA_CLOUD_ACCESS_KEY_ID`
- `ALIBABA_CLOUD_ACCESS_KEY_SECRET`
- `ALIBABA_CLOUD_SECURITY_TOKEN` (required for temporary credentials)

Choose either a CLI profile or environment credentials. When using a profile,
remove the credential variables above; when using environment credentials,
also remove any `ALIBABA_CLOUD_PROFILE` setting.

### Connect over local HTTP

If your client requires an HTTP URL, run this command and keep it running:

```sh
uvx alibabacloud-sls-mcp-proxy@latest --profile default --transport http --port 8080
```

Configure your client to use Streamable HTTP at `http://127.0.0.1:8080/mcp`.
Only clients on the same machine can connect.

## Common options

| Option | Purpose | Default |
| --- | --- | --- |
| `--profile` | Alibaba Cloud CLI profile name | None |
| `--transport` | `stdio` or `http` | `stdio` |
| `--port` | Local HTTP port | `8080` |
| `--endpoint` | SLS MCP service endpoint | `sls.aliyuncs.com` |

For all options, run:

```sh
uvx alibabacloud-sls-mcp-proxy@latest --help
```

## Credential safety

- Use a CLI profile or your client's secure environment configuration. Do not
  put credentials in shared configuration, command lines, or source control.
- Grant only the permissions needed for your SLS resources.
- Use HTTPS when specifying a remote service endpoint.

## Troubleshooting

| Problem | Action |
| --- | --- |
| Command not found | Install `uv` and, for profile mode, Alibaba Cloud CLI. Ensure your MCP client can find them. |
| Profile missing or unreadable | Check the name with `aliyun configure list` and update the profile using Alibaba Cloud CLI. |
| Credential settings conflict or are incomplete | Choose one credential method. For environment credentials, provide both AccessKey variables and a token if using temporary credentials. |
| Authentication or permission error | Check credential validity, renew expired temporary credentials, and verify permissions for the requested SLS resources. |
| Cannot connect to the local HTTP URL | Keep the proxy running on the same machine and check that the client URL matches the configured port. |

When requesting help, include the error message and request ID if available.
Remove credentials and other sensitive information before sharing.
