pia-mcp-server-git 0.1.0__py3-none-any.whl
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.
- mcp_server_git/__init__.py +74 -0
- mcp_server_git/__main__.py +5 -0
- mcp_server_git/py.typed +0 -0
- mcp_server_git/server.py +1190 -0
- pia_mcp_server_git-0.1.0.dist-info/METADATA +194 -0
- pia_mcp_server_git-0.1.0.dist-info/RECORD +9 -0
- pia_mcp_server_git-0.1.0.dist-info/WHEEL +4 -0
- pia_mcp_server_git-0.1.0.dist-info/entry_points.txt +2 -0
- pia_mcp_server_git-0.1.0.dist-info/licenses/LICENSE +7 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import click
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import logging
|
|
4
|
+
import sys
|
|
5
|
+
from .server import serve
|
|
6
|
+
|
|
7
|
+
@click.command()
|
|
8
|
+
@click.option(
|
|
9
|
+
"--repository",
|
|
10
|
+
"-r",
|
|
11
|
+
type=Path,
|
|
12
|
+
help="Single Git repository boundary; cannot be combined with --workspace-root",
|
|
13
|
+
)
|
|
14
|
+
@click.option(
|
|
15
|
+
"--workspace-root",
|
|
16
|
+
type=click.Path(path_type=Path, file_okay=False),
|
|
17
|
+
help=(
|
|
18
|
+
"Directory boundary for repository access and clone destinations; cannot be "
|
|
19
|
+
"combined with --repository"
|
|
20
|
+
),
|
|
21
|
+
)
|
|
22
|
+
@click.option(
|
|
23
|
+
"--allowed-git-host",
|
|
24
|
+
"allowed_git_hosts",
|
|
25
|
+
multiple=True,
|
|
26
|
+
help="Git host allowed for clone, fetch, pull, and push; repeat as needed",
|
|
27
|
+
)
|
|
28
|
+
@click.option("-v", "--verbose", count=True)
|
|
29
|
+
@click.option(
|
|
30
|
+
"--transport",
|
|
31
|
+
type=click.Choice(["stdio", "streamable-http"]),
|
|
32
|
+
default="stdio",
|
|
33
|
+
show_default=True,
|
|
34
|
+
)
|
|
35
|
+
@click.option("--host", envvar="HOST", default="127.0.0.1", show_default=True)
|
|
36
|
+
@click.option(
|
|
37
|
+
"--port",
|
|
38
|
+
envvar="PORT",
|
|
39
|
+
type=click.IntRange(1, 65535),
|
|
40
|
+
default=8000,
|
|
41
|
+
show_default=True,
|
|
42
|
+
)
|
|
43
|
+
def main(
|
|
44
|
+
repository: Path | None,
|
|
45
|
+
workspace_root: Path | None,
|
|
46
|
+
allowed_git_hosts: tuple[str, ...],
|
|
47
|
+
verbose: bool,
|
|
48
|
+
transport: str,
|
|
49
|
+
host: str,
|
|
50
|
+
port: int,
|
|
51
|
+
) -> None:
|
|
52
|
+
"""MCP Git Server - Git functionality for MCP"""
|
|
53
|
+
import asyncio
|
|
54
|
+
|
|
55
|
+
logging_level = logging.WARN
|
|
56
|
+
if verbose == 1:
|
|
57
|
+
logging_level = logging.INFO
|
|
58
|
+
elif verbose >= 2:
|
|
59
|
+
logging_level = logging.DEBUG
|
|
60
|
+
|
|
61
|
+
logging.basicConfig(level=logging_level, stream=sys.stderr)
|
|
62
|
+
asyncio.run(
|
|
63
|
+
serve(
|
|
64
|
+
repository,
|
|
65
|
+
transport=transport,
|
|
66
|
+
host=host,
|
|
67
|
+
port=port,
|
|
68
|
+
workspace_root=workspace_root,
|
|
69
|
+
allowed_git_hosts=allowed_git_hosts,
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
if __name__ == "__main__":
|
|
74
|
+
main()
|
mcp_server_git/py.typed
ADDED
|
File without changes
|