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
Fix#12: Update Prerequisites and Installation Instructions in README.md (#25)
- Updated Prerequisites section with clearer SSL certificate options
- Added detailed security group configuration for different deployment scenarios
- Replaced manual Docker commands with build_and_run.sh script usage
- Added Docker Compose architecture explanation with separate containers
- Updated environment configuration steps using .env.template
- Enhanced authentication section with Cognito vs username/password options
- Updated HTTPS configuration for production deployments
- Made instructions more accessible for entry-level developers
Addresses all tasks in issue #12:
✅ Prerequisites section explains SSL options and security group requirements
✅ Installation steps use build_and_run.sh instead of manual Docker commands
✅ Environment configuration is clearly explained
✅ Instructions are accessible to entry-level developers
* An Amazon EC2 machine (`ml.t3.2xlarge`) with a standard Ubuntu AMI for running this solution.
187
-
* An SSL cert for securing the communication to the Gateway. _This Gateway uses a self-signed cert by default and is also available over HTTP_.
188
-
* One of the example MCP servers packaged in this repo uses the [`Polygon`](https://polygon.io/stocks) API for stock ticker data. Get an API key from [here](https://polygon.io/dashboard/signup?redirect=%2Fdashboard%2Fkeys). The server will still start without the API key but you will get a 401 Unauthorized error when using the tools provided by this server.
189
-
* Setup authentication using Amazon Cognito as per instructions [here](docs/auth.md).
186
+
***Amazon EC2 Instance:** An Amazon EC2 machine (`ml.t3.2xlarge`) with a standard Ubuntu AMI for running this solution.
190
187
191
-
## Installation
188
+
***SSL Certificate Options:**
189
+
-**Production Deployments:** SSL certificate is preferred for secure communication to the Gateway
190
+
-**Testing/Development:** Can use localhost when running on EC2, or EC2 domain name for testing
191
+
-**Default Configuration:** Gateway is available over HTTP for development
192
192
193
-
### Installation on EC2
193
+
***Security Group Configuration:** Configure your EC2 security group based on your deployment scenario:
194
+
-**HTTPS with SSL certificate:** Only port **443** needs to be opened
195
+
-**HTTP with EC2 domain name:** Only port **80** needs to be opened
196
+
-**HTTP with localhost (port forwarding):** Ports **80**, **7860**, and **8888** need to be opened
194
197
195
-
The Gateway and the Registry are available as a Docker container. The package includes a couple of test MCP servers as well.
198
+
***External API Keys (Optional):** One of the example MCP servers uses the [`Polygon`](https://polygon.io/stocks) API for stock ticker data. Get an API key from [here](https://polygon.io/dashboard/signup?redirect=%2Fdashboard%2Fkeys). The server will still start without the API key but you will get a 401 Unauthorized error when using the tools provided by this server.
***Authentication Setup:** Setup authentication using Amazon Cognito as per instructions [here](docs/auth.md).
202
201
203
-
1. **Create local directories for saving MCP server logs and run-time data:**
204
-
```bash
205
-
sudo mkdir -p /opt/mcp-gateway/servers
206
-
sudo cp -r registry/servers /opt/mcp-gateway/
207
-
sudo mkdir /var/log/mcp-gateway
208
-
```
202
+
## Installation
209
203
210
-
1. **Build the Docker container to run the Gateway and Registry:**
204
+
### Installation on EC2
211
205
212
-
```bash
213
-
docker build -t mcp-gateway .
206
+
The Gateway and Registry are deployed using Docker Compose with separate containers for each service, providing a scalable and maintainable architecture.
214
207
215
-
```
208
+
#### Docker Compose Architecture
216
209
217
-
1. **Run the container:**
210
+
The deployment includes these containers:
211
+
-**Nginx Reverse Proxy**: Routes requests to appropriate services and handles SSL termination
212
+
-**Auth Server**: Handles authentication with Amazon Cognito and GitHub OAuth
213
+
-**Registry MCP Server**: Provides service discovery, management, and the web UI
1. **Navigate to [`http://localhost:7860`](http://localhost:7860) access the Registry**
261
-
262
-

263
-
264
-
1. **View logs from the Registry and the built-in MCP servers:**
265
-
Logs are available on the local machine in the `/var/log/mcp-gateway` directory.
228
+
2. **Configure environment variables:**
229
+
```bash
230
+
# Copy the template and edit with your values
231
+
cp .env.template .env
232
+
nano .env # or use your preferred editor
266
233
```
267
-
tail -f /var/log/mcp-gateway/*
234
+
235
+
**Required configuration in`.env`:**
236
+
- `ADMIN_PASSWORD`: Set to a secure password (replace "your-secure-password-here")
237
+
- `COGNITO_USER_POOL_ID`: Your AWS Cognito User Pool ID
238
+
- `COGNITO_CLIENT_ID`: Your Cognito App Client ID
239
+
- `COGNITO_CLIENT_SECRET`: Your Cognito App Client Secret
240
+
- `AWS_REGION`: AWS region where your Cognito User Pool is located
241
+
242
+
**Optional configuration:**
243
+
- `POLYGON_API_KEY`: For financial data tools (get from [Polygon.io](https://polygon.io/dashboard/signup))
244
+
- `SECRET_KEY`: Auto-generated by build script if not provided
245
+
246
+
3. **Deploy with the build and run script:**
247
+
```bash
248
+
./build_and_run.sh
249
+
```
250
+
251
+
The script will:
252
+
- Validate your `.env` configuration
253
+
- Generate `SECRET_KEY`if not provided
254
+
- Build all Docker images using Docker Compose
255
+
- Start all services in the correct order
256
+
- Verify service health and display status
257
+
258
+
4. **Access the Registry:**
259
+
Navigate to `http://localhost:7860` and you will have two authentication options:
260
+
261
+
**Option 1 - Amazon Cognito (Recommended for Production):**
262
+
- Click "Login with Cognito" to authenticate via your configured Cognito User Pool
263
+
- Access permissions will be based on the Cognito group you are a member of
264
+
- Provides fine-grained access control based on your organizational roles
265
+
266
+
**Option 2 - Username/Password (Testing Only):**
267
+
- Use the traditional login with:
268
+
- **Username:** Value of `ADMIN_USER` (default: admin)
269
+
- **Password:** Value of `ADMIN_PASSWORD` from your `.env` file
270
+
- Provides admin access by default
271
+
- **Note:** This approach should only be used fortesting and will soon require setting `ENABLE_DEV_MODE=true`in your `.env` file
272
+
273
+

274
+
275
+
#### Post-Installation
276
+
277
+
1. **View logs from all services:**
278
+
```bash
279
+
# View logs from all services
280
+
docker-compose logs -f
281
+
282
+
# View logs from a specific service
283
+
docker-compose logs -f registry
284
+
docker-compose logs -f auth-server
268
285
```
269
286
270
-
1. **View MCP server metadata:**
271
-
Metadata about all MCP servers connected to the Registry is available in `/opt/mcp-gateway/servers` directory. The metadata includes information gathered from `ListTools` as well as information provided while registering the server.
287
+
2. **View MCP server metadata:**
288
+
Metadata about all MCP servers is available in`/opt/mcp-gateway/servers` directory. The metadata includes information gathered from `ListTools` as well as information provided during server registration.
272
289
273
-
1. **Test the Gateway and Registry with the sample Agent and test suite:**
274
-
The repo includes a test agent that can connect to the Registry to discover tools and invoke them to do interesting tasks. This functionality can be invoked either standalone or as part of a test suite.
290
+
3. **Test the Gateway and Registry:**
291
+
The repo includes a test agent that can connect to the Registry to discover tools and invoke them:
275
292
276
-
```{.python}
293
+
```bash
277
294
python agents/agent.py --mcp-registry-url http://localhost/mcpgw/sse --message "what is the current time in clarksburg, md"
278
295
279
296
# With Strands agent
280
297
# python agents/strands_agent.py --mcp-registry-url http://localhost/mcpgw/sse --message "what is the current time in clarksburg, md"
281
298
```
282
299
283
-
You can also run the full test suite and get a handy agent evaluation report. This test suite exercises the Registry functionality as well as tests the multiple built-in MCP servers provided by the Gateway.
The result of the tests suites are available in the agents/test_results folder. It contains an accuracy.json, a summary.json, a logs folder and a raw_data folder that contains the verbose output from the agent. The test suite uses an LLM as a judge to evaluate the results for accuracy and tool usage quality.
308
+
Test results are available in the `agents/test_results` folder with accuracy metrics and detailed logs.
292
309
293
310
#### Running the Gateway over HTTPS
294
311
295
-
1. Enable access to TCP port 443 from the IP address of your MCP client (your laptop, or anywhere) in the inbound rules in the security group associated with your EC2 instance.
312
+
For production deployments with SSL certificates:
296
313
297
-
1.You would need to have an HTTPS certificate and private key to proceed. Let's say you use `your-mcp-gateway.com` as the domain for your MCP server then you will need an SSL cert for `your-mcp-gateway.com` and MCP servers behind the Gateway will be accessible to MCP clients as `https://your-mcp-gateway.com/mcp-server-name/sse`.
314
+
1. **Configure Security Group:** Enable access to TCP port 443 from the IP addresses of yourMCP clients in the inbound rules of your EC2 instance's security group.
298
315
299
-
1. Rebuild the container using the same command line as before.
316
+
2. **Prepare SSL Certificates:** You need an HTTPS certificate and private key for your domain. For example, if you use `your-mcp-gateway.com` as the domain, you'll need an SSL certificate for`your-mcp-gateway.com`. MCP servers behind the Gateway will be accessible as `https://your-mcp-gateway.com/mcp-server-name/sse`.
300
317
301
-
1. Run the container with the `-v` switch to map the local folder containing the cert and the private key to the container. Replace `/path/to/certs/` and `/path/private` as appropriate in the command provided below.
318
+
3. **Place SSL Certificates:** Copy your SSL certificates to `/home/ubuntu/ssl_data/` on your EC2 instance:
319
+
```bash
320
+
sudo mkdir -p /home/ubuntu/ssl_data/certs
321
+
sudo mkdir -p /home/ubuntu/ssl_data/private
322
+
# Copy your certificate and private key files to these directories
0 commit comments