Skip to content

Commit b4b49af

Browse files
authored
chore: update version to 3.2.2 and configure dynamic port in Dockerfile (#118)
1 parent b77d507 commit b4b49af

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ LABEL org.opencontainers.image.documentation="https://github.com/saidsef/mcp-git
66
LABEL org.opencontainers.image.source="https://github.com/saidsef/mcp-github-pr-issue-analyser.git"
77
LABEL org.opencontainers.image.licenses="Apache License, Version 2.0"
88

9+
ARG PORT=8081
10+
911
ENV MCP_ENABLE_REMOTE="true"
12+
ENV PORT=${PORT}
1013

1114
WORKDIR /app
1215
COPY pyproject.toml requirements.txt /app/
@@ -16,6 +19,6 @@ RUN pip install -r requirements.txt
1619

1720
RUN uv sync
1821

19-
EXPOSE 8000
22+
EXPOSE ${PORT}/tcp
2023

2124
CMD ["uv", "run", "mcp-github-pr-issue-analyser"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp-github-pr-issue-analyser"
3-
version = "3.2.1"
3+
version = "3.2.2"
44
description = "MCP GitHub Issues Create/Update and PR Analyse"
55
readme = "README.md"
66
requires-python = ">=3.12"

src/mcp_github/issues_pr_analyser.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
logging.getLogger(__name__)
3232
logging.basicConfig(level=logging.WARNING)
3333

34+
PORT = int(getenv("PORT", 8081))
35+
HOST = getenv("HOST", "localhost")
36+
3437
class PRIssueAnalyser:
3538
"""
3639
PRIssueAnalyser is a class that provides an interface for analyzing GitHub Pull Requests (PRs) and managing GitHub Issues, Tags, and Releases, as well as retrieving IP information. It integrates with GitHub and an MCP (Multi-Component Platform) server to expose a set of tools for PR and issue management, and can be run as an MCP server using either SSE or stdio transport.
@@ -92,6 +95,8 @@ def __init__(self):
9295
- Use get_ipv4_info and get_ipv6_info for IP information
9396
- Always maintain a professional, clear and concise tone
9497
""",
98+
host=HOST,
99+
port=PORT,
95100
)
96101
logging.info("MCP Server initialized")
97102

@@ -109,19 +114,13 @@ def register_tools(self, methods: Any = None) -> None:
109114
def run(self):
110115
"""
111116
Runs the MCP server for GitHub PR analysis.
112-
This method checks the 'MCP_ENABLE_REMOTE' environment variable to determine the transport mechanism for
113-
the MCP server. If 'MCP_ENABLE_REMOTE' is set, it uses Server-Sent Events (SSE) transport; otherwise, it defaults to standard input/output (stdio) transport
114-
Returns:
115-
None
116-
Error Handling:
117-
Logs any exceptions that occur during server execution and prints the traceback
118-
to standard error for debugging purposes.
117+
Uses HTTP transport if MCP_ENABLE_REMOTE is set, otherwise uses stdio.
119118
"""
120-
MCP_ENABLE_REMOTE = getenv("MCP_ENABLE_REMOTE", None)
119+
MCP_ENABLE_REMOTE = getenv("MCP_ENABLE_REMOTE", False)
121120
try:
122121
logging.info("Running MCP Server for GitHub PR Analysis.")
123122
if MCP_ENABLE_REMOTE:
124-
self.mcp.run(transport='sse')
123+
self.mcp.run(transport='streamable-http')
125124
else:
126125
self.mcp.run(transport='stdio')
127126
except Exception as e:

0 commit comments

Comments
 (0)