Skip to content

Commit 4b0de89

Browse files
committed
feat: Add Typescript cat-facts example that can be the base for a streamable HTTP example
1 parent 4943cf3 commit 4b0de89

18 files changed

+2654
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ updates:
100100
prefix: "chore(deps)"
101101
rebase-strategy: "disabled"
102102

103+
- package-ecosystem: npm
104+
directory: "/examples/servers/cat-facts"
105+
schedule:
106+
interval: monthly
107+
open-pull-requests-limit: 10
108+
versioning-strategy: increase
109+
commit-message:
110+
prefix: "chore(deps)"
111+
rebase-strategy: "disabled"
112+
103113
- package-ecosystem: npm
104114
directory: "/e2e_tests/typescript"
105115
schedule:

.github/workflows/cdk-checks.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,45 @@ jobs:
117117
working-directory: ./examples/servers/weather-alerts
118118
env:
119119
CDK_DEFAULT_ACCOUNT: "000000000000"
120+
121+
check_cat_facts_server:
122+
name: Check Typescript-based Cat Facts Server
123+
runs-on: ubuntu-latest
124+
permissions:
125+
contents: read
126+
timeout-minutes: 15
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- name: "Set up Typescript"
131+
uses: actions/setup-node@v4
132+
with:
133+
node-version: 20
134+
135+
- name: Install CDK CLI
136+
run: npm install -g aws-cdk
137+
138+
- name: Build and link local package
139+
run: |
140+
npm ci
141+
npm audit --audit-level critical
142+
npm run build
143+
npm link
144+
working-directory: ./src/typescript
145+
146+
- name: Install dependencies
147+
run: |
148+
npm ci
149+
npm audit --audit-level critical
150+
npm link @aws/run-mcp-servers-with-aws-lambda
151+
working-directory: ./examples/servers/cat-facts
152+
153+
- name: Build
154+
run: npm run build
155+
working-directory: ./examples/servers/cat-facts
156+
157+
- name: Synthesize CDK stack
158+
run: cdk synth --app 'node lib/cat-facts-mcp-server.js'
159+
working-directory: ./examples/servers/cat-facts
160+
env:
161+
CDK_DEFAULT_ACCOUNT: "000000000000"

.mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ queue_rules:
1717
- status-success=Check Python-based Time Server
1818
- status-success=Check Python-based MCP Doc Server
1919
- status-success=Check Typescript-based Weather Alerts Server
20+
- status-success=Check Typescript-based Cat Facts Server
2021
- status-success=Check Typescript chatbot
2122
merge_method: squash
2223

e2e_tests/clean_up_integ_test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ cdk destroy --force --app 'python3 cdk_stack.py'
2020

2121
cd ../weather-alerts/
2222
cdk destroy --force --app 'node lib/weather-alerts-mcp-server.js'
23+
24+
cd ../cat-facts/
25+
cdk destroy --force --app 'node lib/cat-facts-mcp-server.js'

e2e_tests/python/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ async def main() -> None:
8080
"What is the current time in Seattle?",
8181
"Are there any weather alerts right now?",
8282
"What documentation sources can you use to answer questions?",
83+
"Tell me a cat fact.",
8384
"Who is Tom Cruise?",
8485
]
8586
chat_session = ChatSession(servers, llm_client, user_utterances)

e2e_tests/run_integ_test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ npm link @aws/run-mcp-servers-with-aws-lambda
3434
npm run build
3535
cdk deploy --app 'node lib/weather-alerts-mcp-server.js'
3636

37+
# Deploy Typescript-based cat-facts MCP server
38+
cd ../cat-facts/
39+
npm ci
40+
npm link @aws/run-mcp-servers-with-aws-lambda
41+
npm run build
42+
cdk deploy --app 'node lib/cat-facts-mcp-server.js'
43+
3744
# Configure integ tests
3845
cd ../../../e2e_tests/
3946
sed "s/INTEG_TEST_ID/$INTEG_TEST_ID/g" servers_config.integ.json > python/servers_config.json

e2e_tests/servers_config.integ.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"mcpdoc": {
1818
"functionName": "mcp-server-mcpdoc-INTEG_TEST_ID",
1919
"region": "us-east-2"
20+
},
21+
"catFacts": {
22+
"functionName": "mcp-server-cat-facts-INTEG_TEST_ID",
23+
"region": "us-east-2"
2024
}
2125
}
2226
}

e2e_tests/typescript/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ async function main(): Promise<void> {
3434
"What is the current time in Seattle?",
3535
"Are there any weather alerts right now?",
3636
"What documentation sources can you use to answer questions?",
37+
"Tell me a cat fact.",
3738
"Who is Tom Cruise?",
3839
];
3940

examples/chatbots/python/servers_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"mcpdoc": {
1818
"functionName": "mcp-server-mcpdoc",
1919
"region": "us-east-2"
20+
},
21+
"catFacts": {
22+
"functionName": "mcp-server-cat-facts",
23+
"region": "us-east-2"
2024
}
2125
}
2226
}

examples/chatbots/typescript/servers_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"mcpdoc": {
1818
"functionName": "mcp-server-mcpdoc",
1919
"region": "us-east-2"
20+
},
21+
"catFacts": {
22+
"functionName": "mcp-server-cat-facts",
23+
"region": "us-east-2"
2024
}
2125
}
2226
}

0 commit comments

Comments
 (0)