Skip to content
Merged
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
28 changes: 28 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,31 @@ uv = "0.7"

[env]
_.python.venv = ".venv"

[tasks."format:check"]
alias = "formatcheck"
raw = true
run = ["uv run ruff check --select I", "uv run ruff format --check --diff"]
description = "Check code format and imports sorting"

[tasks."format:fix"]
alias = "format"
raw = true
run = ["uv run ruff check --select I --fix", "uv run ruff format"]
description = "Format code and sort imports"

[tasks."lint:check"]
run = "uv run ruff check"
description = "Lint code using Flake8 rules via ruff"

[tasks."lint:fix"]
run = ["uv run ruff check --fix"]

[tasks."type:check"]
alias = "typecheck"
run = "uv run mypy packages/"
description = "Check type hints with mypy"

[tasks.check]
depends = ["format:check", "lint:check", "type:check"]
description = "Run all checks (format, lint, type)"
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from fastmcp import FastMCP
from gg_api_core.mcp_server import AbstractGitGuardianFastMCP
from gg_api_core.tools.find_current_source_id import find_current_source_id
from gg_api_core.tools.generate_honey_token import generate_honeytoken
from gg_api_core.tools.list_honey_tokens import list_honeytokens
from gg_api_core.tools.list_repo_incidents import list_repo_incidents
from gg_api_core.tools.list_repo_occurrences import list_repo_occurrences
from gg_api_core.tools.list_users import list_users
from gg_api_core.tools.remediate_secret_incidents import remediate_secret_incidents
Expand Down Expand Up @@ -43,7 +44,7 @@
"""


def register_developer_tools(mcp: FastMCP):
def register_developer_tools(mcp: AbstractGitGuardianFastMCP):
mcp.tool(
remediate_secret_incidents,
description="Find and fix secrets in the current repository using exact match locations (file paths, line numbers, character indices). "
Expand All @@ -65,13 +66,13 @@ def register_developer_tools(mcp: FastMCP):
required_scopes=["scan"],
)

# mcp.tool(
# list_repo_incidents,
# description="List secret incidents or occurrences related to a specific repository, and assigned to the current user."
# "By default, this tool only shows incidents assigned to the current user. "
# "Only pass mine=False to get all incidents related to this repo if the user explicitly asks for all incidents even the ones not assigned to him.",
# required_scopes=["incidents:read", "sources:read"],
# )
mcp.tool(
list_repo_incidents,
description="List secret incidents or occurrences related to a specific repository, and assigned to the current user."
"By default, this tool only shows incidents assigned to the current user. "
"Only pass mine=False to get all incidents related to this repo if the user explicitly asks for all incidents even the ones not assigned to him.",
required_scopes=["incidents:read", "sources:read"],
)

mcp.tool(
list_repo_occurrences,
Expand All @@ -83,10 +84,9 @@ def register_developer_tools(mcp: FastMCP):

mcp.tool(
find_current_source_id,
description="Find the GitGuardian source_id for a repository. "
"This tool attempts to detect the repository name from git remote URL, or falls back to using the directory name. "
"By default it uses the current directory ('.'), but you can specify a custom repository_path parameter "
"to analyze a different repository. Useful when you need to reference the repository in other API calls.",
description="Find the GitGuardian source_id for the current repository. "
"This tool automatically detects the current git repository and searches for its source_id in GitGuardian. "
"Useful when you need to reference the repository in other API calls.",
required_scopes=["sources:read"],
)

Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ Homepage = "https://github.com/GitGuardian/ggmcp"

[dependency-groups]
dev = [
"mypy>=1.0.0",
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-mock>=3.12.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"ruff>=0.8.0",
]

Expand Down Expand Up @@ -111,6 +112,19 @@ markers = [
"asyncio" # mark a test as an asynchronous test
]

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = false # Start lenient, can be enabled later
check_untyped_defs = true
no_implicit_optional = true
strict_optional = true
ignore_missing_imports = true # For packages without type stubs
show_error_codes = true
pretty = true

[tool.commitizen]
name = "cz_conventional_commits"
Expand Down
Loading
Loading