Skip to content

Commit 6cec6c8

Browse files
authored
Merge pull request #4 from aliyun/feature/pypi
Add pypi release.
2 parents d24d876 + ecca02a commit 6cec6c8

File tree

8 files changed

+44
-41
lines changed

8 files changed

+44
-41
lines changed

.github/workflows/publish-to-test-pypi.yml renamed to .github/workflows/publish-to-pypi.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
environment:
4040
name: pypi
41-
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
41+
url: https://pypi.org/p/alibabacloud-rds-openapi-mcp-server # Replace <package-name> with your PyPI project name
4242
permissions:
4343
id-token: write # IMPORTANT: mandatory for trusted publishing
4444

@@ -93,27 +93,27 @@ jobs:
9393
gh release upload
9494
"$GITHUB_REF_NAME" dist/**
9595
--repo "$GITHUB_REPOSITORY"
96-
97-
publish-to-testpypi:
98-
name: Publish Python 🐍 distribution 📦 to TestPyPI
99-
needs:
100-
- build
101-
runs-on: ubuntu-latest
102-
103-
environment:
104-
name: testpypi
105-
url: https://test.pypi.org/p/alibabacloud-rds-openapi-mcp-server
106-
107-
permissions:
108-
id-token: write # IMPORTANT: mandatory for trusted publishing
109-
110-
steps:
111-
- name: Download all the dists
112-
uses: actions/download-artifact@v4
113-
with:
114-
name: python-package-distributions
115-
path: dist/
116-
- name: Publish distribution 📦 to TestPyPI
117-
uses: pypa/gh-action-pypi-publish@release/v1
118-
with:
119-
repository-url: https://test.pypi.org/legacy/
96+
#
97+
# publish-to-testpypi:
98+
# name: Publish Python 🐍 distribution 📦 to TestPyPI
99+
# needs:
100+
# - build
101+
# runs-on: ubuntu-latest
102+
#
103+
# environment:
104+
# name: testpypi
105+
# url: https://test.pypi.org/p/alibabacloud-rds-openapi-mcp-server
106+
#
107+
# permissions:
108+
# id-token: write # IMPORTANT: mandatory for trusted publishing
109+
#
110+
# steps:
111+
# - name: Download all the dists
112+
# uses: actions/download-artifact@v4
113+
# with:
114+
# name: python-package-distributions
115+
# path: dist/
116+
# - name: Publish distribution 📦 to TestPyPI
117+
# uses: pypa/gh-action-pypi-publish@release/v1
118+
# with:
119+
# repository-url: https://test.pypi.org/legacy/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add the following configuration to the MCP client configuration file:
2323
"command": "uv",
2424
"args": [
2525
"--directory",
26-
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
26+
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
2727
"run",
2828
"server.py"
2929
],
@@ -44,7 +44,7 @@ export ALIBABA_CLOUD_ACCESS_KEY_ID=$you_access_id;
4444
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$you_access_key;
4545

4646
# run mcp server
47-
uv --directory alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server run server.py
47+
uv --directory alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server run server.py
4848
```
4949
After run mcp server, you will see the following output:
5050
```shell
@@ -67,7 +67,7 @@ Add the following configuration to the MCP client configuration file:
6767
"command": "uv",
6868
"args": [
6969
"--directory",
70-
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
70+
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
7171
"run",
7272
"server.py"
7373
],

README_CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
2222
"command": "uv",
2323
"args": [
2424
"--directory",
25-
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
25+
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
2626
"run",
2727
"server.py"
2828
],
@@ -43,7 +43,7 @@ export ALIBABA_CLOUD_ACCESS_KEY_ID=$your_access_id; # 替换为你的access_id
4343
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$your_access_key; # 替换为你的access_key
4444

4545
# 启动MCP服务
46-
uv --directory alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server run server.py
46+
uv --directory alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server run server.py
4747
```
4848
成功启动后会看到以下输出:
4949
```shell
@@ -65,7 +65,7 @@ remote_server = "http://127.0.0.1:8000/sse";
6565
"command": "uv",
6666
"args": [
6767
"--directory",
68-
"/path/to/alibabacloud-rds-openapi-mcp-server/src/rds_openapi_mcp_server",
68+
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
6969
"run",
7070
"server.py"
7171
],

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alibabacloud-rds-openapi-mcp-server"
3-
version = "0.1.0"
3+
version = "1.2.1"
44
description = "MCP server for RDS Services via OPENAPI."
55
readme = "README.md"
66
requires-python = ">=3.12"
@@ -24,6 +24,8 @@ Documentation = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server/"
2424
Source = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server.git"
2525
"Bug Tracker" = "https://github.com/aliyun/alibaba-cloud-ops-mcp-server/issues"
2626

27+
[tool.hatch.build.targets.wheel]
28+
packages = ["src/alibabacloud_rds_openapi_mcp_server"]
2729

2830
[project.scripts]
29-
alibabacloud-rds-openapi-mcp-server = "rds_openapi_mcp_server.server:main"
31+
alibabacloud-rds-openapi-mcp-server = "alibabacloud_rds_openapi_mcp_server.server:main"

src/rds_openapi_mcp_server/server.py renamed to src/alibabacloud_rds_openapi_mcp_server/server.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import json
22
import logging
33
import os
4-
from datetime import datetime
5-
from typing import Dict, Any, List
4+
import sys
65

6+
from typing import Dict, Any, List
77
from alibabacloud_rds20140815 import models as rds_20140815_models
88
from alibabacloud_rds20140815.client import Client as RdsClient
99
from alibabacloud_tea_openapi.models import Config
1010
from alibabacloud_vpc20160428 import models as vpc_20160428_models
1111
from alibabacloud_vpc20160428.client import Client as VpcClient
1212
from mcp.server.fastmcp import FastMCP
13-
13+
current_dir = os.path.dirname(os.path.abspath(__file__))
14+
sys.path.append(current_dir)
1415
from utils import transform_to_iso_8601, transform_to_datetime, transform_perf_key
1516

1617
logger = logging.getLogger(__name__)
@@ -99,8 +100,8 @@ async def describe_db_instance_performance(region_id: str, db_instance_id: str,
99100
Args:
100101
region_id: db instance region(e.g. cn-hangzhou)
101102
db_instance_id: db instance id(e.g. rm-xxx)
102-
db_type: the db instance database type(e.g. mysql\pgsql\sqlserver)
103-
perf_key: Performance Key(e.g. MemCpuUsage\QPSTPS\Sessions\COMDML\RowDML)
103+
db_type: the db instance database type(e.g. mysql,pgsql,sqlserver)
104+
perf_key: Performance Key(e.g. MemCpuUsage,QPSTPS,Sessions,COMDML,RowDML)
104105
start_time: start time(e.g. 2023-01-01 00:00)
105106
end_time: end time(e.g. 2023-01-01 00:00)
106107
"""
@@ -311,7 +312,7 @@ async def describe_available_classes(
311312
instance_charge_type (str): Instance payment type. Values: Prepaid, Postpaid, Serverless.
312313
engine (str): Database engine type. Values: MySQL, SQLServer, PostgreSQL, MariaDB.
313314
engine_version (str): Database version.
314-
dbinstance_storage_type (str): Storage type. Values: local_ssd\general_essd\cloud_essd\cloud_essd2\cloud_essd3
315+
dbinstance_storage_type (str): Storage type. Values: local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3
315316
category (str): Instance category. Values: Basic, HighAvailability, cluster, AlwaysOn, Finance, serverless_basic, serverless_standard, serverless_ha.
316317
dbinstance_id (str, optional): The ID of the RDS instance.
317318
order_type (str, optional): Order type. Currently only supports "BUY".
@@ -394,7 +395,7 @@ async def create_db_instance(
394395
system_db_charset (str, optional): Character set.
395396
dbinstance_net_type (str, optional): Network connection type (Internet, Intranet). Default: Internet.
396397
category (str, optional): Instance category. Default: Basic.
397-
dbinstance_storage_type (str, optional): Storage type. (e.g. local_ssd\general_essd\cloud_essd\cloud_essd2\cloud_essd3)
398+
dbinstance_storage_type (str, optional): Storage type. (e.g. local_ssd,general_essd,cloud_essd,cloud_essd2,cloud_essd3)
398399
vpc_id (str): VPC ID.
399400
vswitch_id (str): VSwitch ID.
400401
private_ip_address (str, optional): Private IP address.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)