/
pickling
/
mcp-sourcecontrol-python
Обзор
Документация
Войти
/
pickling
/
mcp-sourcecontrol-python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/mcp_sourcecontrol/tools/get_file_content.py
30 строк
908 B
pickling-21
Python-порт mcp-sourcecontrol: 20 инструментов, stdio и Streamable HTTP
29 июл 2026, 02:18
29 июл 2026, 02:18
bc8bde4
Код
Авторство
О чём код?
"""MCP-инструмент git_get_file_content.""" from typing import Annotated from pydantic import Field from ..runtime import current_client from .annotations import READ_ONLY from .define import ToolDefinition from .schemas import ParamProjectKey, ParamRepositorySlug async def _handler( project: ParamProjectKey, repository: ParamRepositorySlug, path: Annotated[str, Field(min_length=1, description="Path to file within the repository (e.g. src/index.ts).")], at: Annotated[ str | None, Field(description="Branch name, tag, or commit SHA. Defaults to the default branch.") ] = None, ) -> str: return await current_client().get_file_content(project, repository, path, at) TOOL = ToolDefinition( name="git_get_file_content", group="read", description="Get the content of a file from the repository.", annotations=READ_ONLY, handler=_handler, )