Skip to content

Commit 774b4aa

Browse files
authored
chore: bump version
1 parent 2980a50 commit 774b4aa

File tree

5 files changed

+268
-263
lines changed

5 files changed

+268
-263
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ services:
256256
## Command line arguments
257257

258258
```bash
259-
usage: mcp-proxy [-h] [-H KEY VALUE] [-e KEY VALUE] [--pass-environment | --no-pass-environment] [--sse-port SSE_PORT] [--sse-host SSE_HOST]
259+
usage: mcp-proxy [-h] [-H KEY VALUE] [-e KEY VALUE] [--cwd CWD] [--pass-environment | --no-pass-environment] [--debug | --no-debug] [--port PORT]
260+
[--host HOST] [--stateless | --no-stateless] [--sse-port SSE_PORT] [--sse-host SSE_HOST]
260261
[--allow-origin ALLOW_ORIGIN [ALLOW_ORIGIN ...]]
261262
[command_or_url] [args ...]
262263
@@ -269,20 +270,24 @@ options:
269270
-h, --help show this help message and exit
270271
271272
SSE client options:
272-
-H KEY VALUE, --headers KEY VALUE
273+
-H, --headers KEY VALUE
273274
Headers to pass to the SSE server. Can be used multiple times.
274275
275276
stdio client options:
276277
args Any extra arguments to the command to spawn the server
277-
-e KEY VALUE, --env KEY VALUE
278-
Environment variables used when spawning the server. Can be used multiple times.
278+
-e, --env KEY VALUE Environment variables used when spawning the server. Can be used multiple times.
279+
--cwd CWD The working directory to use when spawning the process.
279280
--pass-environment, --no-pass-environment
280281
Pass through all environment variables when spawning the server.
281282
--debug, --no-debug Enable debug mode with detailed logging output.
282283
283284
SSE server options:
284-
--port MCP_PORT Port to expose an MCP server on. Default is a random port
285-
--host MCP_HOST Host to expose an MCP server on. Default is 127.0.0.1
285+
--port PORT Port to expose an SSE server on. Default is a random port
286+
--host HOST Host to expose an SSE server on. Default is 127.0.0.1
287+
--stateless, --no-stateless
288+
Enable stateless mode for streamable http transports. Default is False
289+
--sse-port SSE_PORT (deprecated) Same as --port
290+
--sse-host SSE_HOST (deprecated) Same as --host
286291
--allow-origin ALLOW_ORIGIN [ALLOW_ORIGIN ...]
287292
Allowed origins for the SSE server. Can be used multiple times. Default is no CORS allowed.
288293

pyproject.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ classifiers = [
2525
"Topic :: Utilities",
2626
"Typing :: Typed",
2727
]
28-
version = "0.5.1"
28+
version = "0.6.0"
2929
requires-python = ">=3.10"
30-
dependencies = [
31-
"mcp>=1.8.0,<2.0.0",
32-
"uvicorn>=0.34.0"
33-
]
30+
dependencies = ["mcp>=1.8.0,<2.0.0", "uvicorn>=0.34.0"]
3431

3532
[build-system]
3633
requires = ["setuptools"]

src/mcp_proxy/__main__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .mcp_server import MCPServerSettings, run_mcp_server
1919
from .sse_client import run_sse_client
2020

21+
# Deprecated env var. Here for backwards compatibility.
2122
SSE_URL: t.Final[str | None] = os.getenv(
2223
"SSE_URL",
2324
None,
@@ -117,12 +118,12 @@ def main() -> None:
117118
"--sse-port",
118119
type=int,
119120
default=0,
120-
help="Port to expose an SSE server on. Default is a random port",
121+
help="(deprecated) Same as --port",
121122
)
122123
mcp_server_group.add_argument(
123124
"--sse-host",
124125
default="127.0.0.1",
125-
help="Host to expose an SSE server on. Default is 127.0.0.1",
126+
help="(deprecated) Same as --host",
126127
)
127128
mcp_server_group.add_argument(
128129
"--allow-origin",

src/mcp_proxy/mcp_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def create_starlette_app(
4545
debug: bool = False,
4646
) -> Starlette:
4747
"""Create a Starlette application that can serve the mcp server with SSE or Streamable http."""
48+
logger.debug("Creating Starlette app with stateless: %s and debug: %s", stateless, debug)
4849
# record the last activity of api
4950
status = {
5051
"api_last_activity": datetime.now(timezone.utc).isoformat(),
@@ -147,6 +148,7 @@ async def run_mcp_server(
147148
# Bind request handling to MCP server
148149
starlette_app = create_starlette_app(
149150
mcp_server,
151+
stateless=mcp_settings.stateless,
150152
allow_origins=mcp_settings.allow_origins,
151153
debug=(mcp_settings.log_level == "DEBUG"),
152154
)

0 commit comments

Comments
 (0)