Skip to content

Commit 5c13231

Browse files
committed
Cleanup mcpgateway-wrapper and add __version__
Signed-off-by: Mihai Criveti <[email protected]>
1 parent 4d26b75 commit 5c13231

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,9 @@ uvicorn mcpgateway.main:app --host 0.0.0.0 --port 4444 --workers 4
682682
683683
```bash
684684
# Generate a JWT token using JWT_SECRET_KEY and export it as MCPGATEWAY_BEARER_TOKEN
685-
export MCPGATEWAY_BEARER_TOKEN=$(JWT_SECRET_KEY=my-test-key python3 mcpgateway/utils/create_jwt_token.py)
685+
# Note that the module needs to be installed. If running locally use:
686+
# python3 mcpgateway/utils/create_jwt_token.py
687+
export MCPGATEWAY_BEARER_TOKEN=$(JWT_SECRET_KEY=my-test-key python3 -m mcpgateway.utils.create_jwt_token)
686688
687689
# Use the JWT token in an API call
688690
curl -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" http://localhost:4444/tools

mcpgateway/wrapper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
- MCP_WRAPPER_LOG_LEVEL: Python log level name or OFF/NONE to disable logging (default INFO)
2626
2727
Example:
28-
$ export MCP_SERVER_CATALOG_URLS='https://api.example.com/catalog'
29-
$ export MCP_AUTH_TOKEN='my-secret-token'
30-
$ python3 mcpgateway.wrapper
28+
$ export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token --username admin --exp 10080 --secret my-test-key)
29+
$ export MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN}
30+
$ export MCP_SERVER_CATALOG_URLS='http://localhost:4444/servers/1'
31+
$ export MCP_TOOL_CALL_TIMEOUT=120
32+
$ export MCP_WRAPPER_LOG_LEVEL=DEBUG # OFF to disable logging
33+
$ python3 -m mcpgateway.wrapper
3134
"""
3235

3336
import asyncio
@@ -108,7 +111,7 @@ def _extract_base_url(url: str) -> str:
108111
)
109112

110113
logger = logging.getLogger("mcpgateway.wrapper")
111-
logger.info(f"Starting MCP wrapper: base_url={BASE_URL}, timeout={TOOL_CALL_TIMEOUT}")
114+
logger.info(f"Starting MCP wrapper {__version__}: base_url={BASE_URL}, timeout={TOOL_CALL_TIMEOUT}")
112115

113116

114117
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)