-
Notifications
You must be signed in to change notification settings - Fork 218
FEAT: Enable OPEA microservices to start as MCP servers #1635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5c208e8
enable OPEA microservices to start as MCP servers
Spycsh 1d557c7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4fe77f7
add tests
Spycsh 3d2efd8
fix conflict
Spycsh 7f76378
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1363fcc
fix copyright
Spycsh 27cce2d
Merge branch 'mcp' of https://github.com/Spycsh/GenAIComps into mcp
Spycsh 857c017
use native mcp client session instead of fastmap client
Spycsh 7ee2786
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8f9e34f
add mcp to core dep and fix mcp hang issue
Spycsh ba11600
Merge branch 'main' into mcp
Spycsh 18c594b
merge
Spycsh 1cb2493
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c35d6c7
add specific test case for asr
Spycsh 672356d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8209a5a
fix copyright
Spycsh d0fc76c
add client side mcp dep
Spycsh 0b88f39
Merge branch 'main' into mcp
Spycsh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #!/bin/bash | ||
| # Copyright (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| set -x | ||
|
|
||
| WORKPATH=$(dirname "$PWD") | ||
| ip_address=$(hostname -I | awk '{print $1}') | ||
| export TAG=comps | ||
| export WHISPER_PORT=10104 | ||
| export ASR_PORT=10105 | ||
| export ENABLE_MCP=True | ||
| cd $WORKPATH | ||
|
|
||
|
|
||
| function build_docker_images() { | ||
| echo $(pwd) | ||
| docker build --no-cache -t opea/whisper:$TAG --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/third_parties/whisper/src/Dockerfile . | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "opea/whisper built fail" | ||
| exit 1 | ||
| else | ||
| echo "opea/whisper built successful" | ||
| fi | ||
|
|
||
| docker build --no-cache -t opea/asr:$TAG --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/src/Dockerfile . | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "opea/asr built fail" | ||
| exit 1 | ||
| else | ||
| echo "opea/asr built successful" | ||
| fi | ||
| } | ||
|
|
||
| function start_service() { | ||
| unset http_proxy | ||
| export ASR_ENDPOINT=http://$ip_address:$WHISPER_PORT | ||
|
|
||
| docker compose -f comps/asr/deployment/docker_compose/compose.yaml up whisper-service asr -d | ||
| sleep 1m | ||
| } | ||
|
|
||
| function validate_microservice() { | ||
| pip install mcp | ||
| python3 ${WORKPATH}/tests/utils/validate_svc_with_mcp.py $ip_address $ASR_PORT "asr" | ||
| if [ $? -ne 0 ]; then | ||
| docker logs whisper-service | ||
| docker logs asr-service | ||
| exit 1 | ||
| fi | ||
|
|
||
| } | ||
|
|
||
| function stop_docker() { | ||
| docker ps -a --filter "name=whisper-service" --filter "name=asr-service" --format "{{.Names}}" | xargs -r docker stop | ||
| } | ||
|
|
||
| function main() { | ||
|
|
||
| stop_docker | ||
|
|
||
| build_docker_images | ||
| start_service | ||
|
|
||
| validate_microservice | ||
|
|
||
| stop_docker | ||
| echo y | docker system prune | ||
|
|
||
| } | ||
|
|
||
| main |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.