siddu_agentic_terminal 0.1.0__tar.gz
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.
- siddu_agentic_terminal-0.1.0/PKG-INFO +7 -0
- siddu_agentic_terminal-0.1.0/README.md +0 -0
- siddu_agentic_terminal-0.1.0/pyproject.toml +20 -0
- siddu_agentic_terminal-0.1.0/setup.cfg +4 -0
- siddu_agentic_terminal-0.1.0/src/agentic_terminal/__init__.py +0 -0
- siddu_agentic_terminal-0.1.0/src/agentic_terminal/main.py +7 -0
- siddu_agentic_terminal-0.1.0/src/agentic_terminal/tools.py +100 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/PKG-INFO +7 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/SOURCES.txt +11 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/dependency_links.txt +1 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/entry_points.txt +2 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/requires.txt +1 -0
- siddu_agentic_terminal-0.1.0/src/siddu_agentic_terminal.egg-info/top_level.txt +1 -0
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "siddu_agentic_terminal"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "An MCP which adds terminal capabilities to an agent"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"fastmcp>=3.4.2",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["setuptools>=42","wheel"]
|
|
13
|
+
build-backend = "setuptools.build_meta"
|
|
14
|
+
|
|
15
|
+
[tool.setuptools.packages.find]
|
|
16
|
+
where = ["src"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
siddu_agentic_terminal = "agentic_terminal.main:main"
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from fastmcp import FastMCP
|
|
2
|
+
|
|
3
|
+
mcp = FastMCP()
|
|
4
|
+
|
|
5
|
+
@mcp.tool()
|
|
6
|
+
def bash(command:str):
|
|
7
|
+
'''This function will execute a bash command and return the output. This function
|
|
8
|
+
is useful for executing bash commands including creating files, directories, and other bash commands.'''
|
|
9
|
+
import subprocess
|
|
10
|
+
try:
|
|
11
|
+
result = subprocess.run(command, shell=True, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
12
|
+
return result.stdout.decode('utf-8')
|
|
13
|
+
except subprocess.CalledProcessError as e:
|
|
14
|
+
return e.stderr.decode('utf-8')
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@mcp.tool()
|
|
18
|
+
def python_code(code:str):
|
|
19
|
+
'''This function will execute a python code and return the output.'''
|
|
20
|
+
import subprocess
|
|
21
|
+
try:
|
|
22
|
+
result = subprocess.run(['python', '-c', code], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
23
|
+
return result.stdout.decode('utf-8')
|
|
24
|
+
except subprocess.CalledProcessError as e:
|
|
25
|
+
return e.stderr.decode('utf-8')
|
|
26
|
+
|
|
27
|
+
@mcp.tool()
|
|
28
|
+
def python_file(file:str):
|
|
29
|
+
'''This function will execute a python file and return the output.'''
|
|
30
|
+
import subprocess
|
|
31
|
+
try:
|
|
32
|
+
result = subprocess.run(['python', file], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
33
|
+
return result.stdout.decode('utf-8')
|
|
34
|
+
except subprocess.CalledProcessError as e:
|
|
35
|
+
return e.stderr.decode('utf-8')
|
|
36
|
+
|
|
37
|
+
@mcp.tool()
|
|
38
|
+
def glob(pattern:str):
|
|
39
|
+
'''This function will return a list of files that match the given pattern. This function is useful for finding files in a directory.'''
|
|
40
|
+
import glob
|
|
41
|
+
return glob.glob(pattern)
|
|
42
|
+
|
|
43
|
+
@mcp.tool()
|
|
44
|
+
def grep(pattern:str, file:str):
|
|
45
|
+
'''This function will search for the given pattern in the specified file and return the matching lines.'''
|
|
46
|
+
import subprocess
|
|
47
|
+
|
|
48
|
+
result = subprocess.run(
|
|
49
|
+
['findstr', pattern, file],
|
|
50
|
+
stdout=subprocess.PIPE,
|
|
51
|
+
text=True
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
print(result.stdout)
|
|
55
|
+
|
|
56
|
+
@mcp.tool()
|
|
57
|
+
def read_file(file:str):
|
|
58
|
+
'''This function will read the contents of a file and return it as a string.'''
|
|
59
|
+
try:
|
|
60
|
+
with open(file, 'r') as f:
|
|
61
|
+
return f.read()
|
|
62
|
+
except Exception as e:
|
|
63
|
+
return str(e)
|
|
64
|
+
|
|
65
|
+
@mcp.tool()
|
|
66
|
+
def write_file(file:str, content:str):
|
|
67
|
+
'''This function will write the given content to a file. If the file does not exist, it will be created.'''
|
|
68
|
+
try:
|
|
69
|
+
with open(file, 'w') as f:
|
|
70
|
+
f.write(content)
|
|
71
|
+
return f"Content written to {file} successfully."
|
|
72
|
+
except Exception as e:
|
|
73
|
+
return str(e)
|
|
74
|
+
|
|
75
|
+
@mcp.tool()
|
|
76
|
+
def create_folder(folder:str):
|
|
77
|
+
'''This function will create a folder with the given name. If the folder already exists, it will return a message indicating that the folder already exists.'''
|
|
78
|
+
import os
|
|
79
|
+
try:
|
|
80
|
+
os.makedirs(folder)
|
|
81
|
+
return f"Folder '{folder}' created successfully."
|
|
82
|
+
except FileExistsError:
|
|
83
|
+
return f"Folder '{folder}' already exists."
|
|
84
|
+
except Exception as e:
|
|
85
|
+
return str(e)
|
|
86
|
+
|
|
87
|
+
@mcp.tool()
|
|
88
|
+
def delete_folder(folder:str):
|
|
89
|
+
'''This function will delete a folder with the given name. If the folder does not exist, it will return a message indicating that the folder does not exist.'''
|
|
90
|
+
import shutil
|
|
91
|
+
import os
|
|
92
|
+
try:
|
|
93
|
+
if os.path.exists(folder):
|
|
94
|
+
shutil.rmtree(folder)
|
|
95
|
+
return f"Folder '{folder}' deleted successfully."
|
|
96
|
+
else:
|
|
97
|
+
return f"Folder '{folder}' does not exist."
|
|
98
|
+
except Exception as e:
|
|
99
|
+
return str(e)
|
|
100
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/agentic_terminal/__init__.py
|
|
4
|
+
src/agentic_terminal/main.py
|
|
5
|
+
src/agentic_terminal/tools.py
|
|
6
|
+
src/siddu_agentic_terminal.egg-info/PKG-INFO
|
|
7
|
+
src/siddu_agentic_terminal.egg-info/SOURCES.txt
|
|
8
|
+
src/siddu_agentic_terminal.egg-info/dependency_links.txt
|
|
9
|
+
src/siddu_agentic_terminal.egg-info/entry_points.txt
|
|
10
|
+
src/siddu_agentic_terminal.egg-info/requires.txt
|
|
11
|
+
src/siddu_agentic_terminal.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fastmcp>=3.4.2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
agentic_terminal
|