Skip to content

Commit 14ca6c3

Browse files
committed
init
0 parents commit 14ca6c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+815
-0
lines changed

.gitignore

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# General
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
6+
# Icon must end with two \r
7+
Icon
8+
9+
10+
# Thumbnails
11+
._*
12+
13+
# Files that might appear in the root of a volume
14+
.DocumentRevisions-V100
15+
.fseventsd
16+
.Spotlight-V100
17+
.TemporaryItems
18+
.Trashes
19+
.VolumeIcon.icns
20+
.com.apple.timemachine.donotpresent
21+
22+
# Directories potentially created on remote AFP share
23+
.AppleDB
24+
.AppleDesktop
25+
Network Trash Folder
26+
Temporary Items
27+
.apdisk
28+
29+
# Byte-compiled / optimized / DLL files
30+
__pycache__/
31+
*.py[cod]
32+
*$py.class
33+
34+
# C extensions
35+
*.so
36+
37+
# Distribution / packaging
38+
.Python
39+
build/
40+
develop-eggs/
41+
dist/
42+
downloads/
43+
eggs/
44+
.eggs/
45+
lib/
46+
lib64/
47+
parts/
48+
sdist/
49+
var/
50+
wheels/
51+
share/python-wheels/
52+
*.egg-info/
53+
.installed.cfg
54+
*.egg
55+
MANIFEST
56+
57+
# PyInstaller
58+
# Usually these files are written by a python script from a template
59+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
60+
*.manifest
61+
*.spec
62+
63+
# Installer logs
64+
pip-log.txt
65+
pip-delete-this-directory.txt
66+
67+
# Unit test / coverage reports
68+
htmlcov/
69+
.tox/
70+
.nox/
71+
.coverage
72+
.coverage.*
73+
.*cache
74+
nosetests.xml
75+
coverage.xml
76+
*.cover
77+
*.py,cover
78+
.hypothesis/
79+
.pytest_cache/
80+
cover/
81+
82+
# Translations
83+
*.mo
84+
*.pot
85+
86+
# Django stuff:
87+
*.log
88+
local_settings.py
89+
db.sqlite3
90+
db.sqlite3-journal
91+
92+
# Flask stuff:
93+
instance/
94+
.webassets-cache
95+
96+
# Scrapy stuff:
97+
.scrapy
98+
99+
# Sphinx documentation
100+
docs/_build/
101+
102+
# PyBuilder
103+
.pybuilder/
104+
target/
105+
106+
# Jupyter Notebook
107+
.ipynb_checkpoints
108+
109+
# IPython
110+
profile_default/
111+
ipython_config.py
112+
113+
# pyenv
114+
# For a library or package, you might want to ignore these files since the code is
115+
# intended to run in multiple environments; otherwise, check them in:
116+
# .python-version
117+
118+
# pipenv
119+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
120+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
121+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
122+
# install all needed dependencies.
123+
#Pipfile.lock
124+
125+
# poetry
126+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
127+
# This is especially recommended for binary packages to ensure reproducibility, and is more
128+
# commonly ignored for libraries.
129+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
130+
#poetry.lock
131+
132+
# pdm
133+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
134+
#pdm.lock
135+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
136+
# in version control.
137+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
138+
.pdm.toml
139+
.pdm-python
140+
.pdm-build/
141+
142+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
143+
__pypackages__/
144+
145+
# Celery stuff
146+
celerybeat-schedule
147+
celerybeat.pid
148+
149+
# SageMath parsed files
150+
*.sage.py
151+
152+
# Environments
153+
.env
154+
.venv
155+
env/
156+
venv/
157+
ENV/
158+
env.bak/
159+
venv.bak/
160+
.uv
161+
162+
# Spyder project settings
163+
.spyderproject
164+
.spyproject
165+
166+
# Rope project settings
167+
.ropeproject
168+
169+
# mkdocs documentation
170+
/site
171+
172+
# mypy
173+
.mypy_cache/
174+
.dmypy.json
175+
dmypy.json
176+
177+
# Pyre type checker
178+
.pyre/
179+
180+
# pytype static type analyzer
181+
.pytype/
182+
183+
# Cython debug symbols
184+
cython_debug/
185+
186+
# PyCharm
187+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189+
# and can be added to the global gitignore or merged into this file. For a more nuclear
190+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
191+
#.idea/
192+
193+
##uv
194+
uv.lock

README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# MCP Server using Amazon Q Business Cross App index
2+
3+
This is an MCP (Model Context Provider) server for Acme Company that uses Amazon Q Business' cross-app index.
4+
5+
## Prerequisites
6+
7+
### Upload Data to S3
8+
9+
Upload the files present in `synthetic_data` directory to S3 and use this as data source for Q Business APP you create as part of instructions in TVM Set up.
10+
11+
### (Token Vending Machine) TVM Set up
12+
13+
Set up the `amzn-q-auth-tvm` from repository https://github.com/aws-samples/custom-ui-tvm-amazon-q-business
14+
15+
Copy the contents of `cdk-outputs.json` generated after successful deployment of `amzn-q-auth-tvm` to `tvm_values.json` file of this repository. No need to configure QUI.
16+
17+
### Configuration
18+
19+
Create .env file in the root of this module.
20+
21+
```shell
22+
touch .env
23+
```
24+
25+
The application uses environment variables for configuration. You can modify these in the `.env` file:
26+
27+
```
28+
REGION=us-east-1
29+
Q_BUSINESS_APP_NAME=REPLACE_WITH_YOUR_Q_BUSINESS_APP_NAME
30+
```
31+
32+
### Setup and Running with UV
33+
34+
This project uses `uv` for dependency management instead of traditional Python venv.
35+
36+
For Mac, you **MUST** run `brew install uv` for smooth MCP experience. Otherwise you may run into [ENOENT challenges](https://github.com/orgs/modelcontextprotocol/discussions/20)
37+
38+
```shell
39+
brew install uv
40+
```
41+
42+
43+
## Running the Server
44+
45+
You can run the server using the provided script:
46+
47+
```bash
48+
./run_with_uv.sh
49+
```
50+
51+
This script will:
52+
1. Create a uv environment if it doesn't exist
53+
2. Install the required dependencies
54+
3. Run the MCP server
55+
56+
### Manual Setup
57+
58+
If you prefer to set up manually:
59+
60+
```bash
61+
# Create and activate uv environment
62+
uv venv .uv
63+
source .uv/bin/activate
64+
65+
# Install dependencies
66+
uv pip install boto3 "mcp[cli]" requests fastmcp httpx python-dotenv
67+
68+
# Run the server
69+
python mcp_server.py
70+
```
71+
72+
## Required Packages
73+
74+
- boto3
75+
- mcp[cli]
76+
- requests
77+
- fastmcp
78+
- httpx
79+
- python-dotenv
80+
81+
## Test Client
82+
83+
```shell
84+
python test_mcp_client.py
85+
```
86+
87+
## Questions to Ask based on tickets in `synthetic_data` directory
88+
89+
```text
90+
What are some of the reasons of keyboard failure?
91+
What are software installation issues caused by?
92+
What is the remediation of password not working?
93+
What do I do if I am unable to access my backup files?
94+
95+
What immediate action did AnyCompany take to improve the Voice receptionist service while discussing the upgrade?
96+
During which hours did Michael Chen notice the most significant delays?
97+
```
98+
99+
## Installing and Configuring Claude Desktop
100+
101+
Download and install [Claude Desktop](https://claude.ai/download) for your operating system.
102+
Complete the MCP Host setup by following the [For Claude Desktop Users](https://modelcontextprotocol.io/quickstart/user) guide.
103+
104+
Turn off Web Search for grounded responses to the data synced.
105+
106+
![alt text](assets/image1.png)
107+
108+
![alt text](assets/image2.png)
109+

assets/image1.png

507 KB
Loading

assets/image2.png

504 KB
Loading

mcp.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"mcpServers": {
3+
"AnyCompany": {
4+
"command": "uv",
5+
"args": [
6+
"--directory",
7+
"REPLACE WITH ABSOLUTE PATH TO THE DIRECTORY/mcp",
8+
"run",
9+
"mcp_server.py"
10+
]
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)