Skip to content

Commit a95600a

Browse files
authoredMar 4, 2025
feat: Add switch for command and file_ops (#8)
* feat: Add switch for command and file_ops * Fix test issue
1 parent c7e3db3 commit a95600a

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed
 

Diff for: ‎mcp_toolbox/app.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
from mcp.server.fastmcp import FastMCP
22

3+
from mcp_toolbox.config import Config
4+
35
mcp = FastMCP("email")
6+
config = Config()
7+
48

59
# Import tools to register them with the MCP server
6-
import mcp_toolbox.command_line.tools # noqa: E402
7-
import mcp_toolbox.figma.tools # noqa: E402
8-
import mcp_toolbox.file_ops.tools # noqa: E402, F401
10+
if config.enable_commond_tools:
11+
import mcp_toolbox.command_line.tools
12+
if config.enable_file_ops_tools:
13+
import mcp_toolbox.file_ops.tools
14+
import mcp_toolbox.figma.tools # noqa: E402, F401
915

1016

1117
# TODO: Add prompt for toolbox's tools

Diff for: ‎mcp_toolbox/config.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
from pydantic_settings import BaseSettings
44

5-
HOME = Path("~/.zerolab/mcp-toolbox").expanduser()
6-
75

86
class Config(BaseSettings):
97
figma_api_key: str | None = None
108

11-
cache_dir: str = (HOME / "cache").expanduser().resolve().absolute().as_posix()
9+
enable_commond_tools: bool = True
10+
enable_file_ops_tools: bool = True
11+
tool_home: str = Path("~/.zerolab/mcp-toolbox").expanduser().as_posix()
12+
13+
@property
14+
def cache_dir(self) -> str:
15+
return (Path(self.tool_home) / "cache").expanduser().resolve().absolute().as_posix()
1216

1317

1418
if __name__ == "__main__":

Diff for: ‎pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,10 @@ skip_empty = true
120120
[tool.coverage.run]
121121
branch = true
122122
source = ["mcp_toolbox"]
123+
124+
125+
[tool.deptry]
126+
exclude = ["mcp_toolbox/app.py", ".venv", "tests"]
127+
128+
[tool.deptry.per_rule_ignores]
129+
DEP002 = ["mcp"]

0 commit comments

Comments
 (0)