|
6 | 6 | - [Manual Deployment](#manual-deployment) |
7 | 7 | - [**Set Required Environment Variables from Heroku CLI**](#set-required-environment-variables-from-heroku-cli) |
8 | 8 | - [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) |
11 | 11 | - [Local STDIO](#local-stdio) |
12 | 12 | - [1. Local STDIO - Example Python STDIO Client](#1-local-stdio---example-python-stdio-client) |
13 | 13 | - [2. Local STDIO - Direct Calls](#2-local-stdio---direct-calls) |
14 | 14 | - [Remote Testing](#remote-testing) |
15 | | - - [Remote SSE](#remote-sse) |
| 15 | + - [Remote Streamable HTTP, SSE](#remote-streamable-http-sse) |
16 | 16 | - [Remote STDIO](#remote-stdio) |
17 | 17 | - [1. Remote STDIO - Example Python STDIO Client, Running On-Server](#1-remote-stdio---example-python-stdio-client-running-on-server) |
18 | 18 | - [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 |
67 | 67 | ``` |
68 | 68 |
|
69 | 69 | ## Local Testing |
70 | | -### Local SSE |
71 | 70 | One-time packages installation: |
72 | 71 | ```bash |
73 | 72 | virtualenv venv |
74 | 73 | source venv/bin/activate |
75 | 74 | pip install -r requirements.txt |
76 | 75 | ``` |
77 | 76 |
|
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 |
80 | 80 | source venv/bin/activate |
81 | 81 | 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 |
83 | 84 | ``` |
84 | 85 | *Running with --reload is optional, but great for local development* |
85 | 86 |
|
86 | 87 | 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 |
88 | 89 | First run: |
89 | 90 | ```bash |
90 | 91 | export API_KEY=$(heroku config:get API_KEY -a $APP_NAME) |
91 | 92 | ``` |
92 | 93 |
|
| 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 | + |
93 | 96 | List tools: |
94 | 97 | ```bash |
95 | | -python example_clients/test_sse.py mcp list_tools | jq |
| 98 | +python example_clients/test_streamable_http.py mcp list_tools | jq |
96 | 99 | ``` |
97 | 100 |
|
98 | 101 | Example tool call request: |
99 | 102 | *NOTE: this will intentionally NOT work if you have set `STDIO_MODE_ONLY` to `true`.* |
100 | 103 | ```bash |
101 | | -python example_clients/test_sse.py mcp call_tool --args '{ |
| 104 | +python example_clients/test_streamable_http.py mcp call_tool --args '{ |
102 | 105 | "name": "code_exec_python", |
103 | 106 | "arguments": { |
104 | 107 | "code": "import numpy as np; print(np.random.rand(50).tolist())", |
@@ -143,21 +146,27 @@ EOF |
143 | 146 |
|
144 | 147 | ## Remote Testing |
145 | 148 |
|
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 |
149 | 152 | heroku ps:scale web=1 -a $APP_NAME |
150 | 153 | ``` |
151 | 154 | 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 | 155 |
|
| 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 | + |
153 | 162 | Next, run: |
154 | 163 |
|
155 | 164 | ```bash |
156 | 165 | export API_KEY=$(heroku config:get API_KEY -a $APP_NAME) |
157 | 166 | export MCP_SERVER_URL=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2) |
158 | 167 | ``` |
159 | 168 |
|
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. |
161 | 170 |
|
162 | 171 | ### Remote STDIO |
163 | 172 | There are two ways to test out your remote MCP server in STDIO mode: |
|
0 commit comments