Skip to content

Commit 0c04c71

Browse files
Merge branch 'http_simple' into http_simple_tests
2 parents 0355764 + 517ff08 commit 0c04c71

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ heroku buildpacks:set heroku/python -a $APP_NAME
3535
# set a private API key that you create, for example:
3636
heroku config:set API_KEY=$(openssl rand -hex 32) -a $APP_NAME
3737
heroku config:set STDIO_MODE_ONLY=<true/false> -a $APP_NAME
38+
# set the remote server type (module) that your web process will use (only relevant for web deployments)
39+
heroku config:set REMOTE_SERVER_TYPE=<streamable_http_server/sse_server>
3840
```
3941
*Note: we recommend setting `STDIO_MODE_ONLY` to `true` for security and code execution isolation security in non-dev environments.*
4042

@@ -75,14 +77,14 @@ pip install -r requirements.txt
7577
```
7678

7779
### Local Streamable HTTP, SSE
78-
If you're testing Streamable HTTP OR SSE, in one terminal pane you'll need to start the server:
80+
If you're testing (stateless) Streamable HTTP OR SSE, in one terminal pane you'll need to start the server:
7981
```bash
8082
source venv/bin/activate
8183
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
8284
# Either run src.streamable_http_server or src.sse_server, here:
8385
uvicorn src.streamable_http_server:app --reload
8486
```
85-
*Running with --reload is optional, but great for local development*
87+
*Running with `--reload` is optional, but great for local development*
8688

8789
Next, in a new pane, you can try running some queries against your server:
8890
#### Local Streamable HTTP, SSE - Example Requests

app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"STDIO_MODE_ONLY": {
1616
"description": "Only allow tool requests via STDIO mode?",
1717
"value": "false"
18+
},
19+
"REMOTE_SERVER_TYPE": {
20+
"description": "Tranport module name used for deployed web app (applicable when web formation size is >0). `streamable_http_server` or `sse_server`.",
21+
"value": "streamable_http_server"
1822
}
1923
},
2024
"formation": [

example_clients/streamable_http_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ async def run(method_name: str, raw_args: str = None):
1919

2020
headers = {"Authorization": f"Bearer {API_KEY}"}
2121

22-
# Proper unpacking: don't treat the 3rd item as part of the session
2322
async with streamablehttp_client(MCP_SERVER_URL, headers=headers) as (read_stream, write_stream, get_session_id):
2423
async with ClientSession(read_stream, write_stream) as session:
2524
await session.initialize()

0 commit comments

Comments
 (0)