Skip to content

Commit 4943cf3

Browse files
committed
feat: Add Python mcpdoc example that can be the base for a streamable HTTP example
1 parent 254672e commit 4943cf3

File tree

16 files changed

+237
-0
lines changed

16 files changed

+237
-0
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ updates:
5050
prefix: "chore(deps)"
5151
rebase-strategy: "disabled"
5252

53+
- package-ecosystem: pip
54+
directory: "/examples/servers/mcpdoc"
55+
schedule:
56+
interval: monthly
57+
open-pull-requests-limit: 10
58+
versioning-strategy: increase
59+
commit-message:
60+
prefix: "chore(deps)"
61+
rebase-strategy: "disabled"
62+
63+
- package-ecosystem: pip
64+
directory: "/examples/servers/mcpdoc/function"
65+
schedule:
66+
interval: monthly
67+
open-pull-requests-limit: 10
68+
versioning-strategy: increase
69+
commit-message:
70+
prefix: "chore(deps)"
71+
rebase-strategy: "disabled"
72+
5373
- package-ecosystem: npm
5474
directory: "/src/typescript"
5575
schedule:

.github/workflows/cdk-checks.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,42 @@ jobs:
4040
env:
4141
CDK_DEFAULT_ACCOUNT: "000000000000"
4242

43+
check_mcpdoc_server:
44+
name: Check Python-based MCP Doc Server
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
48+
timeout-minutes: 15
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: "Set up Typescript"
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 20
56+
57+
- name: "Set up Python"
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version-file: "src/python/.python-version"
61+
62+
- name: Install CDK CLI
63+
run: npm install -g aws-cdk
64+
65+
- name: Install dependencies
66+
run: pip install -r requirements.txt
67+
working-directory: ./examples/servers/mcpdoc
68+
69+
- uses: pypa/gh-action-pip-audit@v1.1.0
70+
with:
71+
inputs: ./examples/servers/mcpdoc/requirements.txt
72+
73+
- name: Synthesize CDK stack
74+
run: cdk synth --app 'python3 cdk_stack.py'
75+
working-directory: ./examples/servers/mcpdoc
76+
env:
77+
CDK_DEFAULT_ACCOUNT: "000000000000"
78+
4379
check_weather_alerts_server:
4480
name: Check Typescript-based Weather Alerts Server
4581
runs-on: ubuntu-latest

.mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ queue_rules:
1515
- status-success=Check Python library
1616
- status-success=Check Typescript library
1717
- status-success=Check Python-based Time Server
18+
- status-success=Check Python-based MCP Doc Server
1819
- status-success=Check Typescript-based Weather Alerts Server
1920
- status-success=Check Typescript chatbot
2021
merge_method: squash

e2e_tests/clean_up_integ_test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ export INTEG_TEST_ID=$(cat e2e_tests/integ-test-id)
1515
cd examples/servers/time
1616
cdk destroy --force --app 'python3 cdk_stack.py'
1717

18+
cd ../mcpdoc
19+
cdk destroy --force --app 'python3 cdk_stack.py'
20+
1821
cd ../weather-alerts/
1922
cdk destroy --force --app 'node lib/weather-alerts-mcp-server.js'

e2e_tests/python/main.py

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

e2e_tests/run_integ_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ cd ../../examples/servers/time
1717
uv pip install -r requirements.txt
1818
cdk deploy --app 'python3 cdk_stack.py'
1919

20+
# Deploy Python-based mcpdoc MCP server
21+
cd ../mcpdoc
22+
uv pip install -r requirements.txt
23+
cdk deploy --app 'python3 cdk_stack.py'
24+
2025
# Deploy Typescript-based example MCP server
2126
cd ../../../src/typescript/
2227
npm ci

e2e_tests/servers_config.integ.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"weatherAlerts": {
1414
"functionName": "mcp-server-weather-alerts-INTEG_TEST_ID",
1515
"region": "us-east-2"
16+
},
17+
"mcpdoc": {
18+
"functionName": "mcp-server-mcpdoc-INTEG_TEST_ID",
19+
"region": "us-east-2"
1620
}
1721
}
1822
}

e2e_tests/typescript/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ async function main(): Promise<void> {
3333
"Hello!",
3434
"What is the current time in Seattle?",
3535
"Are there any weather alerts right now?",
36+
"What documentation sources can you use to answer questions?",
3637
"Who is Tom Cruise?",
3738
];
3839

examples/chatbots/python/servers_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"weatherAlerts": {
1414
"functionName": "mcp-server-weather-alerts",
1515
"region": "us-east-2"
16+
},
17+
"mcpdoc": {
18+
"functionName": "mcp-server-mcpdoc",
19+
"region": "us-east-2"
1620
}
1721
}
1822
}

examples/chatbots/typescript/servers_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"weatherAlerts": {
1414
"functionName": "mcp-server-weather-alerts",
1515
"region": "us-east-2"
16+
},
17+
"mcpdoc": {
18+
"functionName": "mcp-server-mcpdoc",
19+
"region": "us-east-2"
1620
}
1721
}
1822
}

0 commit comments

Comments
 (0)