sunholo 0.143.14__py3-none-any.whl → 0.143.16__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.
- sunholo/mcp/cli.py +18 -6
- sunholo/mcp/stdio_http_bridge.py +7 -7
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/METADATA +1 -1
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/RECORD +8 -8
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/WHEEL +0 -0
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/entry_points.txt +0 -0
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/licenses/LICENSE.txt +0 -0
- {sunholo-0.143.14.dist-info → sunholo-0.143.16.dist-info}/top_level.txt +0 -0
sunholo/mcp/cli.py
CHANGED
@@ -312,15 +312,27 @@ def setup_mcp_subparser(subparsers):
|
|
312
312
|
```
|
313
313
|
"""
|
314
314
|
mcp_parser = subparsers.add_parser('mcp',
|
315
|
-
help='
|
315
|
+
help='MCP (Model Context Protocol) commands')
|
316
316
|
|
317
|
-
|
317
|
+
# Create subcommands for mcp
|
318
|
+
mcp_subparsers = mcp_parser.add_subparsers(title='mcp commands',
|
319
|
+
description='MCP subcommands',
|
320
|
+
help='MCP subcommands',
|
321
|
+
dest='mcp_command')
|
322
|
+
|
323
|
+
# mcp server command (default)
|
324
|
+
server_parser = mcp_subparsers.add_parser('server',
|
325
|
+
help='Start an Anthropic MCP server that wraps sunholo functionality')
|
326
|
+
server_parser.set_defaults(func=cli_mcp)
|
318
327
|
|
319
|
-
#
|
320
|
-
|
328
|
+
# mcp bridge command
|
329
|
+
bridge_parser = mcp_subparsers.add_parser('bridge',
|
321
330
|
help='Start a stdio-to-HTTP bridge for MCP servers')
|
322
|
-
|
331
|
+
bridge_parser.add_argument('url',
|
323
332
|
nargs='?',
|
324
333
|
default='http://127.0.0.1:1956/mcp',
|
325
334
|
help='HTTP URL of the MCP server (default: http://127.0.0.1:1956/mcp)')
|
326
|
-
|
335
|
+
bridge_parser.set_defaults(func=cli_mcp_bridge)
|
336
|
+
|
337
|
+
# Set default behavior when no subcommand is provided
|
338
|
+
mcp_parser.set_defaults(func=cli_mcp)
|
sunholo/mcp/stdio_http_bridge.py
CHANGED
@@ -11,7 +11,7 @@ import aiohttp
|
|
11
11
|
from typing import Optional
|
12
12
|
|
13
13
|
from ..custom_logging import setup_logging
|
14
|
-
|
14
|
+
log = setup_logging("mcp-bridge")
|
15
15
|
|
16
16
|
class MCPStdioHttpBridge:
|
17
17
|
def __init__(self, http_url: str):
|
@@ -23,7 +23,7 @@ class MCPStdioHttpBridge:
|
|
23
23
|
self.session = aiohttp.ClientSession()
|
24
24
|
|
25
25
|
# Send initialization success to stderr for debugging
|
26
|
-
|
26
|
+
log.info(f"MCP stdio-to-HTTP bridge started, forwarding to: {self.http_url}")
|
27
27
|
|
28
28
|
try:
|
29
29
|
await self.process_messages()
|
@@ -51,9 +51,9 @@ class MCPStdioHttpBridge:
|
|
51
51
|
# Parse JSON-RPC message
|
52
52
|
try:
|
53
53
|
message = json.loads(line)
|
54
|
-
|
54
|
+
log.debug(f"Received from stdin: {message}")
|
55
55
|
except json.JSONDecodeError as e:
|
56
|
-
|
56
|
+
log.error(f"Invalid JSON: {e}")
|
57
57
|
continue
|
58
58
|
|
59
59
|
# Forward to HTTP server
|
@@ -64,14 +64,14 @@ class MCPStdioHttpBridge:
|
|
64
64
|
headers={"Content-Type": "application/json"}
|
65
65
|
) as response:
|
66
66
|
result = await response.json()
|
67
|
-
|
67
|
+
log.debug(f"Received from HTTP: {result}")
|
68
68
|
|
69
69
|
# Send response back to stdout
|
70
70
|
print(json.dumps(result))
|
71
71
|
sys.stdout.flush()
|
72
72
|
|
73
73
|
except aiohttp.ClientError as e:
|
74
|
-
|
74
|
+
log.error(f"HTTP error: {e}")
|
75
75
|
error_response = {
|
76
76
|
"jsonrpc": "2.0",
|
77
77
|
"error": {
|
@@ -84,7 +84,7 @@ class MCPStdioHttpBridge:
|
|
84
84
|
sys.stdout.flush()
|
85
85
|
|
86
86
|
except Exception as e:
|
87
|
-
|
87
|
+
log.error(f"Bridge error: {e}")
|
88
88
|
continue
|
89
89
|
|
90
90
|
async def run_bridge(http_url: str):
|
@@ -115,9 +115,9 @@ sunholo/llamaindex/user_history.py,sha256=ZtkecWuF9ORduyGB8kF8gP66bm9DdvCI-ZiK6K
|
|
115
115
|
sunholo/lookup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
116
|
sunholo/lookup/model_lookup.yaml,sha256=O7o-jP53MLA06C8pI-ILwERShO-xf6z_258wtpZBv6A,739
|
117
117
|
sunholo/mcp/__init__.py,sha256=Bi0ZYMvWuf1AL_QSrMAREVVdTZFiIokGwrytBXKBJyc,1028
|
118
|
-
sunholo/mcp/cli.py,sha256=
|
118
|
+
sunholo/mcp/cli.py,sha256=zVbUDrOS1kvSMYJvq7PqzYnEwwzP1sGE0YWwhpVd_VM,12255
|
119
119
|
sunholo/mcp/mcp_manager.py,sha256=g75vv6XvM24U7uz366slE-p76Qs4AvVcsarHSF9qIvE,5061
|
120
|
-
sunholo/mcp/stdio_http_bridge.py,sha256=
|
120
|
+
sunholo/mcp/stdio_http_bridge.py,sha256=IunHOtnjKAkRWef3SJnqnAL2r2qBRpCH2k_Q_y0Tdf8,3237
|
121
121
|
sunholo/mcp/vac_mcp_server.py,sha256=WcFOgN2_lyp1vfn-KcW4GewrBidkRYDx9gzEORV6rV8,10611
|
122
122
|
sunholo/ollama/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
123
|
sunholo/ollama/ollama_images.py,sha256=H2cpcNu88R4TwyfL_nnqkQhdvBQ2FPCAy4Ok__0yQmo,2351
|
@@ -176,9 +176,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
176
176
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
177
177
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
178
178
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
179
|
-
sunholo-0.143.
|
180
|
-
sunholo-0.143.
|
181
|
-
sunholo-0.143.
|
182
|
-
sunholo-0.143.
|
183
|
-
sunholo-0.143.
|
184
|
-
sunholo-0.143.
|
179
|
+
sunholo-0.143.16.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
180
|
+
sunholo-0.143.16.dist-info/METADATA,sha256=U3OPOEIEC-Dvnjni6sM10RgsnYk5sczbbQD2cP252Yc,18502
|
181
|
+
sunholo-0.143.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
182
|
+
sunholo-0.143.16.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
183
|
+
sunholo-0.143.16.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
184
|
+
sunholo-0.143.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|