Skip to content

Commit c505d5f

Browse files
committed
update miku mcp server
1 parent c950193 commit c505d5f

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

src/mcp_server/core/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .media_processing import load as load_media_processing
44
from .cdn import load as load_cdn
55
from .version import load as load_version
6-
from .miku import load as load_miku
6+
from .live_streaming import load as load_live_streaming
77

88

99
def load():
@@ -19,5 +19,5 @@ def load():
1919
# 智能多媒体
2020
load_media_processing(cfg)
2121
# Miku
22-
load_miku(cfg)
22+
load_live_streaming(cfg)
2323

src/mcp_server/core/miku/__init__.py renamed to src/mcp_server/core/live_streaming/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from .miku import MikuService
1+
from .live_streaming import LiveStreamingService
22
from .tools import register_tools
33
from ...config import config
44

55

66
def load(cfg: config.Config):
7-
miku = MikuService(cfg)
7+
miku = LiveStreamingService(cfg)
88
register_tools(miku)
99

1010

src/mcp_server/core/miku/miku.py renamed to src/mcp_server/core/live_streaming/live_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logger = logging.getLogger(consts.LOGGER_NAME)
99

1010

11-
class MikuService:
11+
class LiveStreamingService:
1212
def __init__(self, cfg: config.Config = None):
1313
self.config = cfg
1414
self.api_key = cfg.api_key if cfg else None

src/mcp_server/core/miku/tools.py renamed to src/mcp_server/core/live_streaming/tools.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
from mcp import types
44

5-
from .miku import MikuService
5+
from .live_streaming import LiveStreamingService
66
from ...consts import consts
77
from ...tools import tools
88

99
logger = logging.getLogger(consts.LOGGER_NAME)
1010

11-
_BUCKET_DESC = "Miku bucket name"
12-
_STREAM_DESC = "Miku stream name"
11+
_BUCKET_DESC = "LiveStreaming bucket name"
12+
_STREAM_DESC = "LiveStreaming stream name"
1313

1414

1515
class _ToolImpl:
16-
def __init__(self, miku: MikuService):
17-
self.miku = miku
16+
def __init__(self, live_streaming: LiveStreamingService):
17+
self.live_streaming = live_streaming
1818

1919
@tools.tool_meta(
2020
types.Tool(
21-
name="miku_create_bucket",
22-
description="Create a new bucket in Miku using S3-style API. The bucket will be created at https://<bucket>.<endpoint_url>",
21+
name="live_streaming_create_bucket",
22+
description="Create a new bucket in LiveStreaming using S3-style API. The bucket will be created at https://<bucket>.<endpoint_url>",
2323
inputSchema={
2424
"type": "object",
2525
"properties": {
@@ -33,13 +33,13 @@ def __init__(self, miku: MikuService):
3333
)
3434
)
3535
async def create_bucket(self, **kwargs) -> list[types.TextContent]:
36-
result = await self.miku.create_bucket(**kwargs)
36+
result = await self.live_streaming.create_bucket(**kwargs)
3737
return [types.TextContent(type="text", text=str(result))]
3838

3939
@tools.tool_meta(
4040
types.Tool(
41-
name="miku_create_stream",
42-
description="Create a new stream in Miku using S3-style API. The stream will be created at https://<bucket>.<endpoint_url>/<stream>",
41+
name="live_streaming_create_stream",
42+
description="Create a new stream in LiveStreaming using S3-style API. The stream will be created at https://<bucket>.<endpoint_url>/<stream>",
4343
inputSchema={
4444
"type": "object",
4545
"properties": {
@@ -57,13 +57,13 @@ async def create_bucket(self, **kwargs) -> list[types.TextContent]:
5757
)
5858
)
5959
async def create_stream(self, **kwargs) -> list[types.TextContent]:
60-
result = await self.miku.create_stream(**kwargs)
60+
result = await self.live_streaming.create_stream(**kwargs)
6161
return [types.TextContent(type="text", text=str(result))]
6262

6363
@tools.tool_meta(
6464
types.Tool(
65-
name="miku_bind_push_domain",
66-
description="Bind a push domain to a Miku bucket for live streaming. This allows you to configure the domain for pushing RTMP/WHIP streams.",
65+
name="live_streaming_bind_push_domain",
66+
description="Bind a push domain to a LiveStreaming bucket for live streaming. This allows you to configure the domain for pushing RTMP/WHIP streams.",
6767
inputSchema={
6868
"type": "object",
6969
"properties": {
@@ -86,13 +86,13 @@ async def create_stream(self, **kwargs) -> list[types.TextContent]:
8686
)
8787
)
8888
async def bind_push_domain(self, **kwargs) -> list[types.TextContent]:
89-
result = await self.miku.bind_push_domain(**kwargs)
89+
result = await self.live_streaming.bind_push_domain(**kwargs)
9090
return [types.TextContent(type="text", text=str(result))]
9191

9292
@tools.tool_meta(
9393
types.Tool(
94-
name="miku_bind_play_domain",
95-
description="Bind a playback domain to a Miku bucket for live streaming. This allows you to configure the domain for playing back streams via FLV/M3U8/WHEP.",
94+
name="live_streaming_bind_play_domain",
95+
description="Bind a playback domain to a LiveStreaming bucket for live streaming. This allows you to configure the domain for playing back streams via FLV/M3U8/WHEP.",
9696
inputSchema={
9797
"type": "object",
9898
"properties": {
@@ -115,12 +115,12 @@ async def bind_push_domain(self, **kwargs) -> list[types.TextContent]:
115115
)
116116
)
117117
async def bind_play_domain(self, **kwargs) -> list[types.TextContent]:
118-
result = await self.miku.bind_play_domain(**kwargs)
118+
result = await self.live_streaming.bind_play_domain(**kwargs)
119119
return [types.TextContent(type="text", text=str(result))]
120120

121121
@tools.tool_meta(
122122
types.Tool(
123-
name="miku_get_push_urls",
123+
name="live_streaming_get_push_urls",
124124
description="Get push URLs for a stream. Returns RTMP and WHIP push URLs that can be used to push live streams.",
125125
inputSchema={
126126
"type": "object",
@@ -143,12 +143,12 @@ async def bind_play_domain(self, **kwargs) -> list[types.TextContent]:
143143
)
144144
)
145145
async def get_push_urls(self, **kwargs) -> list[types.TextContent]:
146-
result = self.miku.get_push_urls(**kwargs)
146+
result = self.live_streaming.get_push_urls(**kwargs)
147147
return [types.TextContent(type="text", text=str(result))]
148148

149149
@tools.tool_meta(
150150
types.Tool(
151-
name="miku_get_play_urls",
151+
name="live_streaming_get_play_urls",
152152
description="Get playback URLs for a stream. Returns FLV, M3U8, and WHEP playback URLs that can be used to play live streams.",
153153
inputSchema={
154154
"type": "object",
@@ -171,12 +171,12 @@ async def get_push_urls(self, **kwargs) -> list[types.TextContent]:
171171
)
172172
)
173173
async def get_play_urls(self, **kwargs) -> list[types.TextContent]:
174-
result = self.miku.get_play_urls(**kwargs)
174+
result = self.live_streaming.get_play_urls(**kwargs)
175175
return [types.TextContent(type="text", text=str(result))]
176176

177177
@tools.tool_meta(
178178
types.Tool(
179-
name="miku_query_live_traffic_stats",
179+
name="live_streaming_query_live_traffic_stats",
180180
description="Query live streaming traffic statistics for a time range. Returns bandwidth and traffic usage data.",
181181
inputSchema={
182182
"type": "object",
@@ -195,12 +195,12 @@ async def get_play_urls(self, **kwargs) -> list[types.TextContent]:
195195
)
196196
)
197197
async def query_live_traffic_stats(self, **kwargs) -> list[types.TextContent]:
198-
result = await self.miku.query_live_traffic_stats(**kwargs)
198+
result = await self.live_streaming.query_live_traffic_stats(**kwargs)
199199
return [types.TextContent(type="text", text=str(result))]
200200

201201

202-
def register_tools(miku: MikuService):
203-
tool_impl = _ToolImpl(miku)
202+
def register_tools(live_streaming: LiveStreamingService):
203+
tool_impl = _ToolImpl(live_streaming)
204204
tools.auto_register_tools(
205205
[
206206
tool_impl.create_bucket,

0 commit comments

Comments
 (0)