Skip to content

Commit 282de59

Browse files
committed
Fix issue #13: Restructure README and reorganize agent files
- Moved agent.py, test_suite.py, strands_agent.py to agents/parking_lot/ - Added README.md in parking_lot explaining work-in-progress status - Renamed agent_w_auth.py to agent.py - Restructured README.md post-installation section: - Moved steps 3+ to new 'Using the Gateway and Registry with AI Agents' section - Added 'Run Agent with User Identity' subsection with .env.user setup - Added 'Run Agent with Its Own Agentic Identity' subsection with .env.agent setup - Documented JWT token flow and Cognito group authorization
1 parent 15634f4 commit 282de59

File tree

7 files changed

+776
-750
lines changed

7 files changed

+776
-750
lines changed

README.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -287,26 +287,6 @@ The deployment includes these containers:
287287
2. **View MCP server metadata:**
288288
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.
289289

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:
292-
293-
```bash
294-
python agents/agent.py --mcp-registry-url http://localhost/mcpgw/sse --message "what is the current time in clarksburg, md"
295-
296-
# With Strands agent
297-
# python agents/strands_agent.py --mcp-registry-url http://localhost/mcpgw/sse --message "what is the current time in clarksburg, md"
298-
```
299-
300-
You can also run the full test suite:
301-
302-
```bash
303-
python agents/test_suite.py --mcp-registry-url http://localhost/mcpgw/sse
304-
# With Strands agent
305-
# python agents/test_suite.py --mcp-registry-url http://localhost/mcpgw/sse --use-strands
306-
```
307-
308-
Test results are available in the `agents/test_results` folder with accuracy metrics and detailed logs.
309-
310290
#### Running the Gateway over HTTPS
311291

312292
For production deployments with SSL certificates:
@@ -334,6 +314,49 @@ For production deployments with SSL certificates:
334314
- Registry API: `https://your-domain.com:7860` (if port 7860 is opened in security group)
335315
- MCP servers: `https://your-domain.com/server-name/sse`
336316

317+
## Using the Gateway and Registry with AI Agents
318+
319+
### Run Agent with User Identity
320+
321+
1. **Configure environment for user authentication:**
322+
Copy the template and configure the environment variables:
323+
324+
```bash
325+
cp agents/.env.template agents/.env.user
326+
# Edit agents/.env.user with your Cognito configuration
327+
```
328+
329+
2. **Authenticate with user identity:**
330+
Run the CLI user authentication script which will prompt you to open a browser window to authenticate with Cognito:
331+
332+
```bash
333+
python agents/cli_user_auth.py
334+
```
335+
336+
This will save a cookie locally in `/home/ubuntu/.mcp` and this cookie will be used when you run the agent.
337+
338+
3. **Run the agent with session cookie:**
339+
```bash
340+
python agents/agent.py --use-session-cookie --mcp-registry-url your_registry_url --message "what is the current time in clarksburg, md"
341+
```
342+
343+
### Run Agent with Its Own Agentic Identity
344+
345+
1. **Configure environment for agent authentication:**
346+
Copy the template and configure the environment variables:
347+
348+
```bash
349+
cp agents/.env.template agents/.env.agent
350+
# Edit agents/.env.agent with your Cognito configuration
351+
```
352+
353+
2. **Run the agent with agentic identity:**
354+
The agent will communicate with Cognito to obtain a JWT token which will include information about the groups it is part of. This information is then used by the Auth server for authorization decisions.
355+
356+
```bash
357+
python agents/agent.py --mcp-registry-url your_registry_url --message "what is the current time in clarksburg, md"
358+
```
359+
337360
### Installation on EKS
338361

339362
For production deployments you might want to run this solution on EKS, the [Distributed Training and Inference on EKS](https://github.com/aws-samples/amazon-eks-machine-learning-with-terraform-and-kubeflow) repo contains the helm chart for running the gateway and registry on an EKS cluster. Refer to [Serve MCP Gateway Registry](https://github.com/aws-samples/amazon-eks-machine-learning-with-terraform-and-kubeflow/tree/master/examples/agentic/mcp-gateway-registry) README for step by step instructions.

0 commit comments

Comments
 (0)