Skip to content

Commit 6c316fe

Browse files
README updates
1 parent bd5b42f commit 6c316fe

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
web: uvicorn src.sse_server:app --host=0.0.0.0 --port=${PORT:-8000} --workers=${WEB_CONCURRENCY:-1}
1+
web: uvicorn src.#{REMOTE_SERVER_TYPE:-streamable_http_server}:app --host=0.0.0.0 --port=${PORT:-8000} --workers=${WEB_CONCURRENCY:-1}
22
mcp-python: python -m src.stdio_server

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
- [Manual Deployment](#manual-deployment)
77
- [**Set Required Environment Variables from Heroku CLI**](#set-required-environment-variables-from-heroku-cli)
88
- [Local Testing](#local-testing)
9-
- [Local SSE](#local-sse)
10-
- [Local SSE - Example Requests](#local-sse---example-requests)
9+
- [Local Streamable HTTP, SSE](#local-streamable-http-sse)
10+
- [Local Streamable HTTP, SSE - Example Requests](#local-streamable-http-sse---example-requests)
1111
- [Local STDIO](#local-stdio)
1212
- [1. Local STDIO - Example Python STDIO Client](#1-local-stdio---example-python-stdio-client)
1313
- [2. Local STDIO - Direct Calls](#2-local-stdio---direct-calls)
1414
- [Remote Testing](#remote-testing)
15-
- [Remote SSE](#remote-sse)
15+
- [Remote Streamable HTTP, SSE](#remote-streamable-http-sse)
1616
- [Remote STDIO](#remote-stdio)
1717
- [1. Remote STDIO - Example Python STDIO Client, Running On-Server](#1-remote-stdio---example-python-stdio-client-running-on-server)
1818
- [2. Remote STDIO - Direct Calls to One-Off Dyno](#2-remote-stdio---direct-calls-to-one-off-dyno)
@@ -67,38 +67,41 @@ heroku logs --tail -a $APP_NAME
6767
```
6868

6969
## Local Testing
70-
### Local SSE
7170
One-time packages installation:
7271
```bash
7372
virtualenv venv
7473
source venv/bin/activate
7574
pip install -r requirements.txt
7675
```
7776

78-
If you're testing SSE, in one terminal pane you'll need to start the server:
79-
```
77+
### Local Streamable HTTP, SSE
78+
If you're testing Streamable HTTP OR SSE, in one terminal pane you'll need to start the server:
79+
```bash
8080
source venv/bin/activate
8181
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
82-
uvicorn src.sse_server:app --reload
82+
# Either run src.streamable_http_server or src.sse_server, here:
83+
uvicorn src.streamable_http_server:app --reload
8384
```
8485
*Running with --reload is optional, but great for local development*
8586

8687
Next, in a new pane, you can try running some queries against your server:
87-
#### Local SSE - Example Requests
88+
#### Local Streamable HTTP, SSE - Example Requests
8889
First run:
8990
```bash
9091
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
9192
```
9293

94+
In the following commands, use either `example_clients/test_streamable_http.py` if you ran the streamable HTTP server above, or `example_clients/test_sse.py` if you're running the SSE server.
95+
9396
List tools:
9497
```bash
95-
python example_clients/test_sse.py mcp list_tools | jq
98+
python example_clients/test_streamable_http.py mcp list_tools | jq
9699
```
97100

98101
Example tool call request:
99102
*NOTE: this will intentionally NOT work if you have set `STDIO_MODE_ONLY` to `true`.*
100103
```bash
101-
python example_clients/test_sse.py mcp call_tool --args '{
104+
python example_clients/test_streamable_http.py mcp call_tool --args '{
102105
"name": "code_exec_python",
103106
"arguments": {
104107
"code": "import numpy as np; print(np.random.rand(50).tolist())",
@@ -143,21 +146,27 @@ EOF
143146

144147
## Remote Testing
145148

146-
### Remote SSE
147-
To test your remote `SSE` server, you'll need to make sure a web process is actually spun up. To save on costs, by default this repository doesn't spin up web dynos on creation, as many folks only want to use `STDIO` mode (local and one-off dyno) requests:
148-
```
149+
### Remote Streamable HTTP, SSE
150+
To test your remote `Streamble HTTP` or `SSE` server, you'll need to make sure a web process is actually spun up. To save on costs, by default this repository doesn't spin up web dynos on creation, as many folks only want to use `STDIO` mode (local and one-off dyno) requests:
151+
```bash
149152
heroku ps:scale web=1 -a $APP_NAME
150153
```
151154
You only need to do this once, unless you spin back down to 0 web dynos to save on costs (`heroku ps:scale web=0 -a $APP_NAME`). To confirm currently running dynos, use `heroku ps -a $APP_NAME`.
152155

156+
By default, this app deploys a Streamable HTTP MCP server - if you want to deploy an SSE server, run:
157+
```bash
158+
heroku config:set REMOTE_SERVER_TYPE=sse_server
159+
```
160+
Which will affect which server is run in the Procfile.
161+
153162
Next, run:
154163

155164
```bash
156165
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
157166
export MCP_SERVER_URL=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2)
158167
```
159168

160-
Next, you can run the same queries as shown in the [Local SSE - Example Requests](#local-sse---example-requests) testing section - because you've set `MCP_SERVER_URL`, the client will call out to your deployed server.
169+
Next, you can run the same queries as shown in the [Local SSE - Example Requests](#local-streamable-http-sse---example-requests) testing section - because you've set `MCP_SERVER_URL`, the client will call out to your deployed server.
161170

162171
### Remote STDIO
163172
There are two ways to test out your remote MCP server in STDIO mode:

0 commit comments

Comments
 (0)