agentic-terminal-tools-mcp 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.
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-terminal-tools-mcp
3
+ Version: 0.1.0
4
+ Summary: An MCP which adds terminal capabilities to an agent
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: fastmcp>=3.2.4
File without changes
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "agentic-terminal-tools-mcp"
3
+ version = "0.1.0"
4
+ description = "An MCP which adds terminal capabilities to an agent"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+ dependencies = [
8
+ "fastmcp>=3.2.4",
9
+ ]
10
+
11
+ [project.scripts]
12
+ mcp-pypi = "mcp_pypi.main:main"
13
+
14
+ [build-system]
15
+ requires = ["setuptools>=42", "wheel"]
16
+ build-backend = "setuptools.build_meta"
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-terminal-tools-mcp
3
+ Version: 0.1.0
4
+ Summary: An MCP which adds terminal capabilities to an agent
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: fastmcp>=3.2.4
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/agentic_terminal_tools_mcp.egg-info/PKG-INFO
4
+ src/agentic_terminal_tools_mcp.egg-info/SOURCES.txt
5
+ src/agentic_terminal_tools_mcp.egg-info/dependency_links.txt
6
+ src/agentic_terminal_tools_mcp.egg-info/entry_points.txt
7
+ src/agentic_terminal_tools_mcp.egg-info/requires.txt
8
+ src/agentic_terminal_tools_mcp.egg-info/top_level.txt
9
+ src/mcp_pypi/__init__.py
10
+ src/mcp_pypi/main.py
11
+ src/mcp_pypi/tools.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mcp-pypi = mcp_pypi.main:main
@@ -0,0 +1,2 @@
1
+ def main() -> None:
2
+ print("Hello from mcp-pypi!")
@@ -0,0 +1,8 @@
1
+ from .tools import mcp
2
+
3
+ def main():
4
+ mcp.run(transport="stdio")
5
+
6
+
7
+ if __name__ == "__main__":
8
+ main()
@@ -0,0 +1,128 @@
1
+ from fastmcp import FastMCP
2
+
3
+ mcp=FastMCP()
4
+
5
+ @mcp.tool()
6
+ def bash(command:str):
7
+ """use this tool to execute bash commands
8
+
9
+ #Simulate executing bash commands
10
+ You can execute any bash command here.
11
+ This function is useful for executing bash commands including creating files, directories
12
+
13
+ """
14
+
15
+ import subprocess
16
+ try:
17
+ result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
18
+ return result.stdout.decode('utf-8')
19
+ except subprocess.CalledProcessError as e:
20
+ return e.stderr.decode('utf-8')
21
+
22
+
23
+
24
+ @mcp.tool()
25
+ def python_code(code:str):
26
+ """This function will execute a python code and return the output."""
27
+
28
+ import subprocess
29
+ try:
30
+ result = subprocess.run(['python','-c',code],check=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
31
+ return result.stdout.decode('utf-8')
32
+ except subprocess.CalledProcessError as e:
33
+ return e.stderr.decode('utf-8')
34
+
35
+
36
+ @mcp.tool()
37
+ def python_file(file:str):
38
+ """This function executes a python file and returns the output."""
39
+ import subprocess
40
+ try:
41
+ result = subprocess.run(['python',file],check=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
42
+ return result.stdout.decode('utf-8')
43
+ except subprocess.CalledProcessError as e:
44
+ return e.stderr.decode('utf-8')
45
+
46
+ @mcp.tool()
47
+ def glob(pattern:str):
48
+ """This function will return list of files that match the given pattern."""
49
+ import glob
50
+ return glob.glob(pattern)
51
+
52
+ @mcp.tool()
53
+ def grep(pattern:str, file:str):
54
+ """Search for a specific pattern or text in the given file.
55
+
56
+ This function reads the specified file line by line and
57
+ identifies all lines that contain the given pattern.
58
+ """
59
+ import subprocess
60
+ result = subprocess.run(
61
+ ['findstr',pattern,file],
62
+ stdout=subprocess.PIPE,
63
+ text=True
64
+ )
65
+ print(result.stdout)
66
+
67
+ @mcp.tool()
68
+ def read_file(file:str):
69
+ """This function will read the contents of the file and return them as a string."""
70
+ try:
71
+ with open(file,'r') as f:
72
+ return f.read()
73
+ except Exception as e:
74
+ return str(e)
75
+
76
+
77
+ @mcp.tool()
78
+ def write_file(file:str,content:str):
79
+ """This function will write the given content to a file and save it.
80
+
81
+ If the file does not exist. just return the exception.
82
+ If the file already exists, it will overwrite the existing content.
83
+ It takes the file path and content as input and returns a success message
84
+ after successfully writing the content to the file.
85
+ """
86
+ try:
87
+ with open(file,'w') as f:
88
+ f.write(content)
89
+ return f"content written to {file} successfully"
90
+ except Exception as e:
91
+ return str(e)
92
+
93
+ @mcp.tool()
94
+ def create_folder(folder:str):
95
+ """This function will create a new folder at the specified path.
96
+
97
+ It takes the folder path as input and creates the folder using the os module.
98
+ If the folder is created successfully, it returns a success message.
99
+ If the folder already exists, it returns a message indicating that the folder exists.
100
+ If any other error occurs during folder creation, it returns the error message.
101
+ """
102
+ import os
103
+ try:
104
+ os.makedirs(folder)
105
+ return f"folder '{folder}' created successfully"
106
+ except FileExistsError:
107
+ return f"folder '{folder}' already exists"
108
+ except Exception as e:
109
+ return str(e)
110
+
111
+
112
+ @mcp.tool()
113
+ def delete_folder(folder:str):
114
+ """"""
115
+ import shutil
116
+ import os
117
+ try:
118
+ if os.path.exists(folder):
119
+ shutil.rmtree(folder)
120
+ return f"folder '{folder}' deleted successfully!"
121
+ else:
122
+ return f"folder '{folder}' does not exists"
123
+ except Exception as e:
124
+ return str(e)
125
+
126
+
127
+
128
+