Skip to content

Commit 16a1357

Browse files
committed
v.0.2.25
1 parent 9a31ea3 commit 16a1357

File tree

2 files changed

+3
-87
lines changed

2 files changed

+3
-87
lines changed

apps/mcp_server.py

Lines changed: 2 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,9 @@
3030
client = helix.Client(local=True, port=6969)
3131

3232
@mcp.tool()
33-
def init() -> str: return client.query(helix.init())[0]
33+
def call_tool() -> str:
3434

35-
@mcp.tool()
36-
def next(connection_id: str) -> str:
37-
return client.query(helix.next(connection_id))[0]
38-
39-
@mcp.tool()
40-
def collect(connection_id: str) -> str:
41-
return client.query(helix.collect(connection_id))[0]
42-
43-
@mcp.tool()
44-
def call_tool(tool: str, args: dict={}) -> str:
45-
response = client.query(tool, args)
35+
response = client.query("call_tool", {})
4636
return response[0]
4737

4838
@mcp.resource("config://{connection_id}/schema")
@@ -78,80 +68,6 @@ def out_e_step(connection_id: str, edge_label: str) -> str:
7868
print(f"res {response}", file=sys.stderr)
7969
return response[0]
8070

81-
@mcp.tool()
82-
def in_step(connection_id: str, edge_label: str, edge_type: str) -> str:
83-
tool = "in_step"
84-
args = {
85-
"edge_label": edge_label,
86-
"edge_type": edge_type,
87-
}
88-
89-
payload = {
90-
"connection_id": connection_id,
91-
"data": args,
92-
}
93-
response = client.query(helix.call_tool(tool, payload))
94-
print(f"res {response}", file=sys.stderr)
95-
return response[0]
96-
97-
@mcp.tool()
98-
def in_e_step(connection_id: str, edge_label: str) -> str:
99-
tool = "in_e_step"
100-
args = { "edge_label": edge_label }
101-
102-
payload = {
103-
"connection_id": connection_id,
104-
"data": args,
105-
}
106-
response = client.query(helix.call_tool(tool, payload))
107-
print(f"res {response}", file=sys.stderr)
108-
return response[0]
109-
110-
@mcp.tool()
111-
def n_from_type(connection_id: str, node_type: str) -> str:
112-
tool = "n_from_type"
113-
args = { "node_type": node_type }
114-
115-
payload = {
116-
"connection_id": connection_id,
117-
"data": args,
118-
}
119-
response = client.query(helix.call_tool(tool, payload))
120-
print(f"res {response}", file=sys.stderr)
121-
return response[0]
122-
123-
@mcp.tool()
124-
def e_from_type(connection_id: str, edge_type: str) -> str:
125-
tool = "e_from_type"
126-
args = { "edge_type": edge_type }
127-
128-
payload = {
129-
"connection_id": connection_id,
130-
"data": args,
131-
}
132-
response = client.query(helix.call_tool(tool, payload))
133-
print(f"res {response}", file=sys.stderr)
134-
return response[0]
135-
136-
@mcp.tool()
137-
def filter_items(
138-
connection_id: str,
139-
properties: Optional[List[Tuple[str, str]]]=None,
140-
filter_traversals: Optional[List[dict]]=None
141-
) -> str:
142-
tool = "filter_items"
143-
args = {}
144-
if properties: args["properties"] = properties
145-
if filter_traversals: args["filter_traversals"] = filter_traversals
146-
147-
payload = {
148-
"connection_id": connection_id,
149-
"data": args,
150-
}
151-
response = client.query(helix.call_tool(tool, payload))
152-
print(f"res {response}", file=sys.stderr)
153-
return response[0]
154-
15571
if __name__ == "__main__":
15672
mcp.run(transport="http", host="127.0.0.1", port=8000)
15773

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ members = [
1515

1616
[project]
1717
name = "helix-py"
18-
version = "0.2.24"
18+
version = "0.2.25"
1919
authors = [{ name = "HelixDB Team", email = "lukasnitzsche@yahoo.com"}]
2020
maintainers = [{ name = "Lukas Nitzsche", email = "lukasnitzsche@yahoo.com" }]
2121
description = "helix-db python lib + workflows"

0 commit comments

Comments
 (0)