agentic-terminal-dk 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,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-terminal-dk
3
+ Version: 0.1.0
4
+ Summary: An MCP server that adds terminal capabilities to an agent.
5
+ Author-email: Dhananjay Kumar <dhkumar560@gmail.com>
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: fastmcp>=4.0.9
File without changes
@@ -0,0 +1,22 @@
1
+ [project]
2
+ name = "agentic-terminal-dk"
3
+ version = "0.1.0"
4
+ description = "An MCP server that adds terminal capabilities to an agent."
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ authors = [
8
+ { name = "Dhananjay Kumar", email = "dhkumar560@gmail.com" }
9
+ ]
10
+ dependencies = [
11
+ "fastmcp>=4.0.9",
12
+ ]
13
+
14
+ [project.scripts]
15
+ agentic-terminal = "agentic_terminal.main:main"
16
+
17
+ [build-system]
18
+ requires = ["setuptools>=42", "wheel"]
19
+ build-backend = "setuptools.build_meta"
20
+
21
+ [tool.setuptools.packages.find]
22
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,2 @@
1
+ def main() -> None:
2
+ print("Hello from mcp-pypi!")
@@ -0,0 +1,10 @@
1
+
2
+ from agentic_terminal.tools import mcp
3
+
4
+
5
+ def main():
6
+ mcp.run(transport="stdio")
7
+
8
+
9
+ if __name__ == "__main__":
10
+ main()
@@ -0,0 +1,148 @@
1
+ from fastmcp import FastMCP
2
+ import glob as glob_module
3
+ import os
4
+ import shutil
5
+ import subprocess
6
+ import sys
7
+
8
+
9
+ mcp = FastMCP("Agentic Terminal")
10
+
11
+
12
+ @mcp.tool()
13
+ def bash(command: str) -> str:
14
+ """Execute a shell command and return the output."""
15
+ try:
16
+ result = subprocess.run(
17
+ command,
18
+ shell=True,
19
+ check=True,
20
+ stdout=subprocess.PIPE,
21
+ stderr=subprocess.PIPE,
22
+ text=True,
23
+ )
24
+ return result.stdout or result.stderr
25
+
26
+ except subprocess.CalledProcessError as e:
27
+ return e.stderr or str(e)
28
+
29
+
30
+ @mcp.tool()
31
+ def python_code(code: str) -> str:
32
+ """Execute Python code and return the output."""
33
+ try:
34
+ result = subprocess.run(
35
+ [sys.executable, "-c", code],
36
+ check=True,
37
+ stdout=subprocess.PIPE,
38
+ stderr=subprocess.PIPE,
39
+ text=True,
40
+ )
41
+ return result.stdout or result.stderr
42
+
43
+ except subprocess.CalledProcessError as e:
44
+ return e.stderr or str(e)
45
+
46
+
47
+ @mcp.tool()
48
+ def python_file(file: str) -> str:
49
+ """Execute a Python file and return the output."""
50
+ try:
51
+ result = subprocess.run(
52
+ [sys.executable, file],
53
+ check=True,
54
+ stdout=subprocess.PIPE,
55
+ stderr=subprocess.PIPE,
56
+ text=True,
57
+ )
58
+ return result.stdout or result.stderr
59
+
60
+ except subprocess.CalledProcessError as e:
61
+ return e.stderr or str(e)
62
+
63
+
64
+ @mcp.tool()
65
+ def glob(pattern: str) -> list[str]:
66
+ """Find files matching the given pattern."""
67
+ return glob_module.glob(pattern, recursive=True)
68
+
69
+
70
+ @mcp.tool()
71
+ def grep(pattern: str, file: str) -> str:
72
+ """Search for a pattern in a file and return matching lines."""
73
+ try:
74
+ result = subprocess.run(
75
+ ["findstr", "/N", pattern, file],
76
+ stdout=subprocess.PIPE,
77
+ stderr=subprocess.PIPE,
78
+ text=True,
79
+ )
80
+
81
+ if result.returncode == 0:
82
+ return result.stdout
83
+
84
+ if result.returncode == 1:
85
+ return f"No matches found for '{pattern}' in '{file}'."
86
+
87
+ return result.stderr
88
+
89
+ except Exception as e:
90
+ return str(e)
91
+
92
+
93
+ @mcp.tool()
94
+ def read_file(file: str) -> str:
95
+ """Read the contents of a file."""
96
+ try:
97
+ with open(file, "r", encoding="utf-8") as f:
98
+ return f.read()
99
+
100
+ except Exception as e:
101
+ return str(e)
102
+
103
+
104
+ @mcp.tool()
105
+ def write_file(file: str, content: str) -> str:
106
+ """Write content to a file."""
107
+ try:
108
+ parent = os.path.dirname(os.path.abspath(file))
109
+
110
+ if parent:
111
+ os.makedirs(parent, exist_ok=True)
112
+
113
+ with open(file, "w", encoding="utf-8") as f:
114
+ f.write(content)
115
+
116
+ return f"Content written to '{file}' successfully."
117
+
118
+ except Exception as e:
119
+ return str(e)
120
+
121
+
122
+ @mcp.tool()
123
+ def create_folder(folder: str) -> str:
124
+ """Create a folder."""
125
+ try:
126
+ os.makedirs(folder)
127
+ return f"Folder '{folder}' created successfully."
128
+
129
+ except FileExistsError:
130
+ return f"Folder '{folder}' already exists."
131
+
132
+ except Exception as e:
133
+ return str(e)
134
+
135
+
136
+ @mcp.tool()
137
+ def delete_folder(folder: str) -> str:
138
+ """Delete a folder and its contents."""
139
+ try:
140
+ if not os.path.exists(folder):
141
+ return f"Folder '{folder}' does not exist."
142
+
143
+ shutil.rmtree(folder)
144
+
145
+ return f"Folder '{folder}' deleted successfully."
146
+
147
+ except Exception as e:
148
+ return str(e)
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-terminal-dk
3
+ Version: 0.1.0
4
+ Summary: An MCP server that adds terminal capabilities to an agent.
5
+ Author-email: Dhananjay Kumar <dhkumar560@gmail.com>
6
+ Requires-Python: >=3.14
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: fastmcp>=4.0.9
@@ -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/agentic_terminal_dk.egg-info/PKG-INFO
7
+ src/agentic_terminal_dk.egg-info/SOURCES.txt
8
+ src/agentic_terminal_dk.egg-info/dependency_links.txt
9
+ src/agentic_terminal_dk.egg-info/entry_points.txt
10
+ src/agentic_terminal_dk.egg-info/requires.txt
11
+ src/agentic_terminal_dk.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ agentic-terminal = agentic_terminal.main:main