mcp-package-test 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""
|
|
2
|
+
mcp本质是一段 python 或 nodejs 程序
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from mcp.server import MCPServer
|
|
6
|
+
|
|
7
|
+
mcp = MCPServer("Demo")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@mcp.tool()
|
|
11
|
+
def add(a: int, b: int) -> int:
|
|
12
|
+
"""Add two numbers."""
|
|
13
|
+
return a + b
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@mcp.resource("greeting://{name}")
|
|
17
|
+
def greeting(name: str) -> str:
|
|
18
|
+
"""Greet someone by name."""
|
|
19
|
+
return f"Hello, {name}!"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
mcp.run(transport="stdio") # 在cherry studio上配置这个协议的mcp时,当前mcp server 不用启动运行!启动了反而在cherry studio上添加不成功!
|
|
24
|
+
# mcp.run(transport="sse") # 在cherry studio上配置这个协议的mcp时,当前mcp server 需要启动运行。
|
|
25
|
+
# mcp.run(transport="streamable-http") # 在cherry studio上配置这个协议的mcp时,当前mcp server 需要启动运行。
|
|
26
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
mcp_package_test/__init__.py,sha256=zGJWKPYvFSqB9ZzxsNgpbT85Y7XK-5ZDE6WdWER7mPQ,795
|
|
2
|
+
mcp_package_test-0.1.0.dist-info/WHEEL,sha256=xTCBFIZIIyRSxyowOv5Wqg_jFU6KsdIffuulBB09Ph8,80
|
|
3
|
+
mcp_package_test-0.1.0.dist-info/entry_points.txt,sha256=oLpxhKrUnZGc5otlG9XQx_g9spEVaguck2op8SWbDxU,60
|
|
4
|
+
mcp_package_test-0.1.0.dist-info/METADATA,sha256=g5zVlyxM9-5AbARBxoYhmOQxMqZ6St_zs0ImcVx-AI4,160
|
|
5
|
+
mcp_package_test-0.1.0.dist-info/RECORD,,
|