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