Skip to content

Commit 9dc982a

Browse files
authored
Small changes to favor streamable HTTP over deprecated SSE (#1264)
1 parent effde47 commit 9dc982a

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

‎packages/markitdown-mcp/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![PyPI - Downloads](https://img.shields.io/pypi/dd/markitdown-mcp)
55
[![Built by AutoGen Team](https://img.shields.io/badge/Built%20by-AutoGen%20Team-blue)](https://github.com/microsoft/autogen)
66

7-
The `markitdown-mcp` package provides a lightweight STDIO, SSE and Streamable HTTP MCP server for calling MarkItDown.
7+
The `markitdown-mcp` package provides a lightweight STDIO, Streamable HTTP, and SSE MCP server for calling MarkItDown.
88

99
It exposes one tool: `convert_to_markdown(uri)`, where uri can be any `http:`, `https:`, `file:`, or `data:` URI.
1010

@@ -25,10 +25,10 @@ To run the MCP server, using STDIO (default) use the following command:
2525
markitdown-mcp
2626
```
2727

28-
To run the MCP server, using SSE or Streamable HTTP use the following command:
28+
To run the MCP server, using Streamable HTTP and SSE use the following command:
2929

3030
```bash
31-
markitdown-mcp --sse --host 127.0.0.1 --port 3001
31+
markitdown-mcp --http --host 127.0.0.1 --port 3001
3232
```
3333

3434
## Running in Docker
@@ -109,16 +109,16 @@ If using STDIO:
109109
* input `markitdown-mcp` as the command, and
110110
* click `Connect`
111111

112-
If using SSE:
113-
* select `SSE` as the transport type,
114-
* input `http://127.0.0.1:3001/sse` as the URL, and
115-
* click `Connect`
116-
117112
If using Streamable HTTP:
118113
* select `Streamable HTTP` as the transport type,
119114
* input `http://127.0.0.1:3001/mcp` as the URL, and
120115
* click `Connect`
121116

117+
If using SSE:
118+
* select `SSE` as the transport type,
119+
* input `http://127.0.0.1:3001/sse` as the URL, and
120+
* click `Connect`
121+
122122
Finally:
123123
* click the `Tools` tab,
124124
* click `List Tools`,

‎packages/markitdown-mcp/src/markitdown_mcp/__main__.py‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,17 @@ def main():
7575

7676
mcp_server = mcp._mcp_server
7777

78-
parser = argparse.ArgumentParser(description="Run MCP SSE-based MarkItDown server")
78+
parser = argparse.ArgumentParser(description="Run a MarkItDown MCP server")
7979

80+
parser.add_argument(
81+
"--http",
82+
action="store_true",
83+
help="Run the server with Streamable HTTP and SSE transport rather than STDIO (default: False)",
84+
)
8085
parser.add_argument(
8186
"--sse",
8287
action="store_true",
83-
help="Run the server with SSE transport rather than STDIO (default: False)",
88+
help="(Deprecated) An alias for --http (default: False)",
8489
)
8590
parser.add_argument(
8691
"--host", default=None, help="Host to bind to (default: 127.0.0.1)"
@@ -90,11 +95,15 @@ def main():
9095
)
9196
args = parser.parse_args()
9297

93-
if not args.sse and (args.host or args.port):
94-
parser.error("Host and port arguments are only valid when using SSE transport.")
98+
use_http = args.http or args.sse
99+
100+
if not use_http and (args.host or args.port):
101+
parser.error(
102+
"Host and port arguments are only valid when using streamable HTTP or SSE transport (see: --http)."
103+
)
95104
sys.exit(1)
96105

97-
if args.sse:
106+
if use_http:
98107
starlette_app = create_starlette_app(mcp_server, debug=True)
99108
uvicorn.run(
100109
starlette_app,

0 commit comments

Comments
 (0)