Skip to content

Commit b390343

Browse files
committed
feat: add command-line options for transport and port in MCP server
1 parent 0dee6f6 commit b390343

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "An MCP server that enables MCP clients like Claude Desktop to int
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8+
"click>=8.2.1",
89
"fastmcp>=2.11.1",
910
"hatchling>=1.27.0",
1011
"httpx>=0.28.1",

src/protocols_io_mcp/__main__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import click
12
from protocols_io_mcp.server import mcp
23

3-
def main():
4+
@click.command()
5+
@click.option("--transport", default="stdio", type=click.Choice(['stdio', 'http', 'sse']), help="Transport protocol to use [default: stdio]")
6+
@click.option("--port", default=8000, help="Port to bind to when using http and sse transport [default: 8000]")
7+
def main(transport: str, port: int):
48
"""Run the protocols.io MCP server."""
59
print("Starting protocols.io MCP server...")
6-
mcp.run()
10+
if transport == "stdio":
11+
mcp.run(transport=transport)
12+
else:
13+
mcp.run(transport=transport, port=port)
714

815
if __name__ == "__main__":
916
main()

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)