You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Note: we recommend setting `STDIO_MODE_ONLY` to `true` for security and code execution isolation security in non-dev environments.*
40
42
@@ -67,38 +69,41 @@ heroku logs --tail -a $APP_NAME
67
69
```
68
70
69
71
## Local Testing
70
-
### Local SSE
71
72
One-time packages installation:
72
73
```bash
73
74
virtualenv venv
74
75
source venv/bin/activate
75
76
pip install -r requirements.txt
76
77
```
77
78
78
-
If you're testing SSE, in one terminal pane you'll need to start the server:
79
-
```
79
+
### Local Streamable HTTP, SSE
80
+
If you're testing (stateless) Streamable HTTP OR SSE, in one terminal pane you'll need to start the server:
81
+
```bash
80
82
source venv/bin/activate
81
83
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
82
-
uvicorn src.sse_server:app --reload
84
+
# Either run src.streamable_http_server or src.sse_server, here:
85
+
uvicorn src.streamable_http_server:app --reload
83
86
```
84
-
*Running with --reload is optional, but great for local development*
87
+
*Running with `--reload` is optional, but great for local development*
85
88
86
89
Next, in a new pane, you can try running some queries against your server:
87
-
#### Local SSE - Example Requests
90
+
#### Local Streamable HTTP, SSE - Example Requests
88
91
First run:
89
92
```bash
90
93
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
91
94
```
92
95
96
+
In the following commands, use either `example_clients/streamable_http_client.py` if you ran the streamable HTTP server above, or `example_clients/sse_client.py` if you're running the SSE server.
"code": "import numpy as np; print(np.random.rand(50).tolist())",
@@ -143,34 +148,40 @@ EOF
143
148
144
149
## Remote Testing
145
150
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
-
```
151
+
### Remote Streamable HTTP, SSE
152
+
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:
153
+
```bash
149
154
heroku ps:scale web=1 -a $APP_NAME
150
155
```
151
156
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`.
152
157
158
+
By default, this app deploys a Streamable HTTP MCP server - if you want to deploy an SSE server, run:
Which will affect which server is run in the Procfile.
163
+
153
164
Next, run:
154
165
155
166
```bash
156
167
export API_KEY=$(heroku config:get API_KEY -a $APP_NAME)
157
168
export MCP_SERVER_URL=$(heroku info -s -a $APP_NAME| grep web_url | cut -d= -f2)
158
169
```
159
170
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.
171
+
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.
161
172
162
173
### Remote STDIO
163
174
There are two ways to test out your remote MCP server in STDIO mode:
0 commit comments