diff --git a/Dockerfile b/Dockerfile index 85f23f2..2ce7a66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,11 @@ RUN pip install --no-cache-dir -e . # Set environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONPATH=/app/src +ENV PORT=8080 + +# Expose port for HTTP server +EXPOSE $PORT # The command will be provided by smithery.yaml # Default command for local testing -CMD ["fastmcp", "run", "pragweb/mcp_server.py"] +CMD ["sh", "-c", "fastmcp -t streamable-http --host 0.0.0.0 --port $PORT pragweb/mcp_server.py"] \ No newline at end of file diff --git a/smithery.yaml b/smithery.yaml index 269597b..b805fbd 100644 --- a/smithery.yaml +++ b/smithery.yaml @@ -24,13 +24,14 @@ startCommand: description: "Google OAuth refresh token for automated authentication" commandFunction: | (config) => ({ - command: 'python', - args: ['-m', 'pragweb.mcp_server'], + command: 'sh', + args: ['-c', `fastmcp -t streamable-http --host 0.0.0.0 --port \${PORT:-8080} pragweb/mcp_server.py`], env: { OPENAI_API_KEY: config.OPENAI_API_KEY, GOOGLE_OAUTH_CLIENT_ID: config.GOOGLE_OAUTH_CLIENT_ID || '', GOOGLE_OAUTH_CLIENT_SECRET: config.GOOGLE_OAUTH_CLIENT_SECRET || '', GOOGLE_OAUTH_REFRESH_TOKEN: config.GOOGLE_OAUTH_REFRESH_TOKEN || '', - PYTHONUNBUFFERED: '1' + PYTHONUNBUFFERED: '1', + PORT: process.env.PORT || '8080' } }) \ No newline at end of file