Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
# 1) Change into the app dir
cd /app

# 2) Make sure we use the venvs Python
# 2) Make sure we use the venv's Python
PYTHON_BIN=/app/.venv/bin/python

# 3) Point Python at the src/ directory so it can import deepset_mcp
export PYTHONPATH=/app/src

# 4) Exec your MCP server
exec "$PYTHON_BIN" -m deepset_mcp.main \
--workspace "${DEEPSET_WORKSPACE}" \
--api-key "${DEEPSET_API_KEY}"
# If no command-line arguments are provided, use environment variables as defaults
if [ $# -eq 0 ]; then
exec "$PYTHON_BIN" -m deepset_mcp.main \
--workspace "${DEEPSET_WORKSPACE}" \
--api-key "${DEEPSET_API_KEY}"
else
# Pass through all command-line arguments
exec "$PYTHON_BIN" -m deepset_mcp.main "$@"
fi
19 changes: 19 additions & 0 deletions src/deepset_mcp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ def main(
"Can also be set via OBJECT_STORE_TTL environment variable.",
),
] = 600,
host: Annotated[
str,
typer.Option(
"--host",
help="Host address to bind the server to. Default: 0.0.0.0",
),
] = "0.0.0.0",
port: Annotated[
int | None,
typer.Option(
"--port",
help="Port number to bind the server to. If not specified, uses default port for the transport.",
),
] = None,
) -> None:
"""
Run the Deepset MCP server.
Expand All @@ -130,6 +144,8 @@ def main(
:param object_store_backend: Object store backend type ('memory' or 'redis')
:param object_store_redis_url: Redis connection URL (required if backend='redis')
:param object_store_ttl: TTL in seconds for stored objects
:param host: Host address to bind the server to
:param port: Port number to bind the server to
"""
# Handle --list-tools flag early
if list_tools:
Expand Down Expand Up @@ -187,6 +203,9 @@ def main(
object_store_redis_url=redis_url,
object_store_ttl=ttl,
)
mcp.settings.host = host
if port is not None:
mcp.settings.port = port

mcp.run(transport=transport.value)

Expand Down