Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions codemcp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
from starlette.routing import Mount

from .mcp import mcp
from .tools.chmod import chmod
from .tools.edit_file import edit_file
from .tools.glob import glob
from .tools.grep import grep
from .tools.init_project import init_project
from .tools.ls import ls
from .tools.mv import mv
from .tools.read_file import read_file
from .tools.rm import rm
from .tools.run_command import run_command
from .tools.think import think
from .tools.write_file import write_file
from .tools.chmod import chmod # noqa: F401
from .tools.edit_file import edit_file # noqa: F401
from .tools.glob import glob # noqa: F401
from .tools.grep import grep # noqa: F401
from .tools.init_project import init_project # noqa: F401
from .tools.ls import ls # noqa: F401
from .tools.mv import mv # noqa: F401
from .tools.read_file import read_file # noqa: F401
from .tools.rm import rm # noqa: F401
from .tools.run_command import run_command # noqa: F401
from .tools.think import think # noqa: F401
from .tools.write_file import write_file # noqa: F401


def get_files_respecting_gitignore(dir_path: Path, pattern: str = "**/*") -> List[Path]:
Expand Down
8 changes: 6 additions & 2 deletions codemcp/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ async def call_tool_assert_error(
"Session cannot be None when in_process=False"
)
# Convert subtool name to lowercase snake case (e.g., ReadFile -> read_file)
subtool_snake_case = ''.join(['_' + c.lower() if c.isupper() else c for c in subtool]).lstrip('_')
subtool_snake_case = "".join(
["_" + c.lower() if c.isupper() else c for c in subtool]
).lstrip("_")
# Call the subtool directly instead of calling the codemcp tool
result = await session.call_tool(subtool_snake_case, kwargs) # type: ignore
self.assertTrue(result.isError, result)
Expand Down Expand Up @@ -405,7 +407,9 @@ async def call_tool_assert_success(
else:
assert session is not None, "Session cannot be None when in_process=False"
# Convert subtool name to lowercase snake case (e.g., ReadFile -> read_file)
subtool_snake_case = ''.join(['_' + c.lower() if c.isupper() else c for c in subtool]).lstrip('_')
subtool_snake_case = "".join(
["_" + c.lower() if c.isupper() else c for c in subtool]
).lstrip("_")
# Call the subtool directly instead of calling the codemcp tool
result = await session.call_tool(subtool_snake_case, kwargs) # type: ignore
self.assertFalse(result.isError, result)
Expand Down
5 changes: 2 additions & 3 deletions codemcp/tools/init_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import tomli

from ..common import MAX_LINE_LENGTH, MAX_LINES_TO_READ, normalize_file_path
from ..common import normalize_file_path
from ..git import get_repository_root, is_git_repository
from ..mcp import mcp

Expand Down Expand Up @@ -219,7 +219,6 @@ async def init_project(
)

project_prompt = ""
command_help = ""
command_docs: Dict[str, str] = {}
rules_config: Dict[str, Any] = {}

Expand All @@ -239,7 +238,7 @@ async def init_project(

# Extract commands and their documentation
command_list = rules_config.get("commands", {})
command_help = ", ".join(command_list.keys())
", ".join(command_list.keys())

# Process command documentation
for cmd_name, cmd_config in command_list.items():
Expand Down
Loading