-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcp_server.py
More file actions
33 lines (28 loc) · 1.04 KB
/
Copy pathmcp_server.py
File metadata and controls
33 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from mcp.server.fastmcp import FastMCP
import os
mcp = FastMCP()
@mcp.tool()
def concatenate_smalltalk_files(folder_path):
smalltalk_content = ""
for filename in os.listdir(folder_path):
filename = os.path.join(folder_path, filename)
if os.path.isfile(filename) and filename.endswith(".st") and 'test' not in filename.lower():
with open(filename, 'r') as f:
smalltalk_content += f.read()
return smalltalk_content
@mcp.tool()
def concatenate_smalltalk_files_test(folder_path):
smalltalk_content = ""
for filename in os.listdir(folder_path):
filename = os.path.join(folder_path, filename)
if os.path.isfile(filename) and filename.endswith(".st") and 'test' in filename.lower():
with open(filename, 'r') as f:
smalltalk_content += f.read()
return smalltalk_content
@mcp.tool()
def load_file(folder_path):
with open(folder_path, 'r') as f:
read = f.read()
return read
if __name__ == "__main__":
mcp.run(transport= "sse")