Skip to content

Commit 6dc3bd7

Browse files
committed
communicate with MCP servers and tools via STDIO (#1)
1 parent ddfdb45 commit 6dc3bd7

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

mcphost.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
22
"mcpServers": {
33
"oci_compute": {
4-
"type": "remote",
5-
"transport": "sse",
6-
"url": "http://localhost:8000/sse"
4+
"type": "local",
5+
"command": [
6+
"uv",
7+
"run",
8+
"oci_compute.py"
9+
]
710
},
811
"oci_networking": {
9-
"type": "remote",
10-
"transport": "sse",
11-
"url": "http://localhost:8001/sse",
12+
"type": "local",
13+
"command": [
14+
"uv",
15+
"run",
16+
"oci_networking.py"
17+
],
1218
"excludedTools": [
1319
"terminate_instance"
1420
]

oci_compute.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import argparse
21
from logging import Logger
32

43
import oci
@@ -80,14 +79,9 @@ def instance_action(instance_id: str, action: str):
8079

8180

8281
if __name__ == "__main__":
83-
parser = argparse.ArgumentParser(
84-
description="Oracle Cloud Infrastructure Compute MCP server"
85-
)
86-
parser.add_argument("port", type=int, help="port number")
87-
88-
args = parser.parse_args()
8982

9083
# MCP spec: OpenAPI exposed at /openapi.json, native MCP at /mcp/v1
9184
# mcp.run(transport="http", host="127.0.0.1", port=8000, path="/mcp")
9285

93-
mcp.run(transport="sse", host="127.0.0.1", port=args.port)
86+
# mcp.run(transport="sse", host="127.0.0.1", port=args.port)
87+
mcp.run()

oci_networking.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import argparse
21
from logging import Logger
32

43
import oci
@@ -42,12 +41,7 @@ def delete_vcn(vcn_id: str):
4241

4342

4443
if __name__ == "__main__":
45-
parser = argparse.ArgumentParser(
46-
description="Oracle Cloud Infrastructure Networking MCP server"
47-
)
48-
parser.add_argument("port", type=int, help="port number")
49-
50-
args = parser.parse_args()
5144
# MCP spec: OpenAPI exposed at /openapi.json, native MCP at /mcp/v1
5245
# mcp.run(transport="http", host="127.0.0.1", port=8000, path="/mcp")
53-
mcp.run(transport="sse", host="127.0.0.1", port=args.port)
46+
# mcp.run(transport="sse", host="127.0.0.1", port=args.port)
47+
mcp.run()

0 commit comments

Comments
 (0)