Skip to content

Add pypi release. #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/alibabacloud-rds-openapi-mcp-server # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand Down Expand Up @@ -93,27 +93,27 @@ jobs:
gh release upload
"$GITHUB_REF_NAME" dist/**
--repo "$GITHUB_REPOSITORY"

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/alibabacloud-rds-openapi-mcp-server

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
#
# publish-to-testpypi:
# name: Publish Python 🐍 distribution 📦 to TestPyPI
# needs:
# - build
# runs-on: ubuntu-latest
#
# environment:
# name: testpypi
# url: https://test.pypi.org/p/alibabacloud-rds-openapi-mcp-server
#
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
#
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add the following configuration to the MCP client configuration file:
"command": "uv",
"args": [
"--directory",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
"run",
"server.py"
],
Expand All @@ -44,7 +44,7 @@ export ALIBABA_CLOUD_ACCESS_KEY_ID=$you_access_id;
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$you_access_key;

# run mcp server
uv --directory alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server run server.py
uv --directory alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server run server.py
```
After run mcp server, you will see the following output:
```shell
Expand All @@ -67,7 +67,7 @@ Add the following configuration to the MCP client configuration file:
"command": "uv",
"args": [
"--directory",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
"run",
"server.py"
],
Expand Down
6 changes: 3 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
"command": "uv",
"args": [
"--directory",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
"run",
"server.py"
],
Expand All @@ -43,7 +43,7 @@ export ALIBABA_CLOUD_ACCESS_KEY_ID=$your_access_id; # 替换为你的access_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$your_access_key; # 替换为你的access_key

# 启动MCP服务
uv --directory alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server run server.py
uv --directory alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server run server.py
```
成功启动后会看到以下输出:
```shell
Expand All @@ -65,7 +65,7 @@ remote_server = "http://127.0.0.1:8000/sse";
"command": "uv",
"args": [
"--directory",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
"run",
"server.py"
],
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "alibabacloud-rds-openapi-mcp-server"
version = "0.1.0"
version = "1.2.1"
description = "MCP server for RDS Services via OPENAPI."
readme = "README.md"
requires-python = ">=3.12"
Expand All @@ -24,6 +24,8 @@ Documentation = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server/"
Source = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server.git"
"Bug Tracker" = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server/issues"

[tool.hatch.build.targets.wheel]
packages = ["src/alibabacloud_rds_openapi_mcp_server"]

[project.scripts]
alibabacloud-rds-openapi-mcp-server = "rds_openapi_mcp_server.server:main"
alibabacloud-rds-openapi-mcp-server = "alibabacloud_rds_openapi_mcp_server.server:main"
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import json
import logging
import os
from datetime import datetime
from typing import Dict, Any, List
import sys

from typing import Dict, Any, List
from alibabacloud_rds20140815 import models as rds_20140815_models
from alibabacloud_rds20140815.client import Client as RdsClient
from alibabacloud_tea_openapi.models import Config
from alibabacloud_vpc20160428 import models as vpc_20160428_models
from alibabacloud_vpc20160428.client import Client as VpcClient
from mcp.server.fastmcp import FastMCP

current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_dir)
from utils import transform_to_iso_8601, transform_to_datetime, transform_perf_key

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -99,8 +100,8 @@ async def describe_db_instance_performance(region_id: str, db_instance_id: str,
Args:
region_id: db instance region(e.g. cn-hangzhou)
db_instance_id: db instance id(e.g. rm-xxx)
db_type: the db instance database type(e.g. mysql\pgsql\sqlserver)
perf_key: Performance Key(e.g. MemCpuUsage\QPSTPS\Sessions\COMDML\RowDML)
db_type: the db instance database type(e.g. mysql,pgsql,sqlserver)
perf_key: Performance Key(e.g. MemCpuUsage,QPSTPS,Sessions,COMDML,RowDML)
start_time: start time(e.g. 2023-01-01 00:00)
end_time: end time(e.g. 2023-01-01 00:00)
"""
Expand Down Expand Up @@ -311,7 +312,7 @@ async def describe_available_classes(
instance_charge_type (str): Instance payment type. Values: Prepaid, Postpaid, Serverless.
engine (str): Database engine type. Values: MySQL, SQLServer, PostgreSQL, MariaDB.
engine_version (str): Database version.
dbinstance_storage_type (str): Storage type. Values: local_ssd\general_essd\cloud_essd\cloud_essd2\cloud_essd3
dbinstance_storage_type (str): Storage type. Values: local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3
category (str): Instance category. Values: Basic, HighAvailability, cluster, AlwaysOn, Finance, serverless_basic, serverless_standard, serverless_ha.
dbinstance_id (str, optional): The ID of the RDS instance.
order_type (str, optional): Order type. Currently only supports "BUY".
Expand Down Expand Up @@ -394,7 +395,7 @@ async def create_db_instance(
system_db_charset (str, optional): Character set.
dbinstance_net_type (str, optional): Network connection type (Internet, Intranet). Default: Internet.
category (str, optional): Instance category. Default: Basic.
dbinstance_storage_type (str, optional): Storage type. (e.g. local_ssd\general_essd\cloud_essd\cloud_essd2\cloud_essd3)
dbinstance_storage_type (str, optional): Storage type. (e.g. local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3)
vpc_id (str): VPC ID.
vswitch_id (str): VSwitch ID.
private_ip_address (str, optional): Private IP address.
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.