Skip to content
Open
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
12 changes: 12 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ ifeq ($(enable_pax), yes)
endif
$(MAKE) -C gpMgmt all
$(MAKE) -C gpcontrib all
ifeq ($(enable_mcp_server), yes)
$(MAKE) -C mcp-server all
endif
+@echo "All of Apache Cloudberry successfully made. Ready to install."

docs:
Expand Down Expand Up @@ -84,6 +87,9 @@ ifeq ($(with_openssl), yes)
endif
$(MAKE) -C gpMgmt $@
$(MAKE) -C gpcontrib $@
ifeq ($(enable_mcp_server), yes)
$(MAKE) -C mcp-server $@
endif
+@echo "Apache Cloudberry installation complete."

install-docs:
Expand Down Expand Up @@ -116,6 +122,9 @@ clean:
# gpAux/Makefile is the entry point for the enterprise build, which ends up
# calling top-level configure and this Makefile
$(MAKE) -C gpMgmt $@
ifeq ($(enable_mcp_server), yes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should set this feature in src/Makefile.global.in?

Copy link
Member Author

@tuhaihe tuhaihe Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I followed the same pattern as enable_pax which also uses ifeq directly in GNUmakefile.in.

Since mcp-server is a top-level optional component (not used by src/ subdirectories), keeping it in GNUmakefile.in seems appropriate. But I'm open to moving it to Makefile.global.in if you prefer consistency with other enable_* flags.

$(MAKE) -C mcp-server $@
endif

# Important: distclean `src' last, otherwise Makefile.global
# will be gone too soon.
Expand All @@ -125,6 +134,9 @@ distclean maintainer-clean:
$(MAKE) -C gpcontrib $@
$(MAKE) -C config $@
$(MAKE) -C gpMgmt $@
ifeq ($(enable_mcp_server), yes)
$(MAKE) -C mcp-server $@
endif
$(MAKE) -C src $@
rm -rf tmp_install/
# Garbage from autoconf:
Expand Down
149 changes: 148 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ with_gssapi
with_pythonsrc_ext
PIP3
CURL
PYTHON3
with_python
with_perl
with_tcl
Expand All @@ -759,6 +758,9 @@ ZSTD_LIBS
ZSTD_CFLAGS
PROTOBUF_LIBS
PROTOBUF_CFLAGS
UV
PYTHON3
enable_mcp_server
enable_preload_ic_module
enable_ic_proxy
enable_external_fts
Expand Down Expand Up @@ -911,6 +913,7 @@ enable_gpcloud
enable_external_fts
enable_ic_proxy
enable_preload_ic_module
enable_mcp_server
enable_pax
enable_thread_safety
with_icu
Expand Down Expand Up @@ -1633,6 +1636,7 @@ Optional Features:
library)
--disable-preload-ic-module
disable preload interconnect module
--enable-mcp-server enable MCP server support
--enable-pax enable PAX support
--disable-thread-safety disable thread-safety in client libraries
--enable-openssl-redirect
Expand Down Expand Up @@ -9245,6 +9249,149 @@ fi
$as_echo "checking whether to build with preload ic module ... $enable_preload_ic_module" >&6; }


#
# mcp-server
#


# Check whether --enable-mcp-server was given.
if test "${enable_mcp_server+set}" = set; then :
enableval=$enable_mcp_server;
case $enableval in
yes)

$as_echo "#define ENABLE_MCP_SERVER 1" >>confdefs.h

;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --enable-mcp-server option" "$LINENO" 5
;;
esac

else
enable_mcp_server=no

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: checking whether to build with MCP server... $enable_mcp_server" >&5
$as_echo "checking whether to build with MCP server... $enable_mcp_server" >&6; }


# Check for required dependencies when mcp-server is enabled
if test "$enable_mcp_server" = yes; then
# Search for Python 3.10+ in order of preference
for ac_prog in python3.13 python3.12 python3.11 python3.10 python3
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PYTHON3+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PYTHON3 in
[\\/]* | ?:[\\/]*)
ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON3="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
PYTHON3=$ac_cv_path_PYTHON3
if test -n "$PYTHON3"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5
$as_echo "$PYTHON3" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


test -n "$PYTHON3" && break
done

if test -z "$PYTHON3"; then
as_fn_error $? "python3 is required for --enable-mcp-server but was not found" "$LINENO" 5
fi

# Check Python version >= 3.10
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version for mcp-server" >&5
$as_echo_n "checking Python version for mcp-server... " >&6; }
PYTHON_VERSION=`$PYTHON3 -c "import sys; print('%d.%d' % (sys.version_info.major, sys.version_info.minor))"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_VERSION" >&5
$as_echo "$PYTHON_VERSION" >&6; }

PYTHON_VERSION_OK=`$PYTHON3 -c "import sys; print('yes' if sys.version_info >= (3, 10) else 'no')"`
if test "$PYTHON_VERSION_OK" != "yes"; then
as_fn_error $? "Python 3.10 or later is required for --enable-mcp-server, found $PYTHON_VERSION" "$LINENO" 5
fi

# Check for uv (Python package manager)
# Extract the first word of "uv", so it can be a program name with args.
set dummy uv; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_UV+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UV in
[\\/]* | ?:[\\/]*)
ac_cv_path_UV="$UV" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_UV="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
UV=$ac_cv_path_UV
if test -n "$UV"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UV" >&5
$as_echo "$UV" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


if test -z "$UV"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: uv not found. MCP server build will attempt to use pip as fallback." >&5
$as_echo "$as_me: WARNING: uv not found. MCP server build will attempt to use pip as fallback." >&2;}
fi
fi

#
# pax support
#
Expand Down
35 changes: 35 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,41 @@ PGAC_ARG_BOOL(enable, preload-ic-module, yes,
AC_MSG_RESULT([checking whether to build with preload ic module ... $enable_preload_ic_module])
AC_SUBST(enable_preload_ic_module)

#
# mcp-server
#
PGAC_ARG_BOOL(enable, mcp-server, no,
[enable MCP server support],
[AC_DEFINE(ENABLE_MCP_SERVER, 1,
[Define to 1 to build with MCP server support (--enable-mcp-server)])])
AC_MSG_RESULT([checking whether to build with MCP server... $enable_mcp_server])
AC_SUBST(enable_mcp_server)

# Check for required dependencies when mcp-server is enabled
if test "$enable_mcp_server" = yes; then
# Search for Python 3.10+ in order of preference
AC_PATH_PROGS([PYTHON3], [python3.13 python3.12 python3.11 python3.10 python3])
if test -z "$PYTHON3"; then
AC_MSG_ERROR([python3 is required for --enable-mcp-server but was not found])
fi

# Check Python version >= 3.10
AC_MSG_CHECKING([Python version for mcp-server])
PYTHON_VERSION=`$PYTHON3 -c "import sys; print('%d.%d' % (sys.version_info.major, sys.version_info.minor))"`
AC_MSG_RESULT([$PYTHON_VERSION])

PYTHON_VERSION_OK=`$PYTHON3 -c "import sys; print('yes' if sys.version_info >= (3, 10) else 'no')"`
if test "$PYTHON_VERSION_OK" != "yes"; then
AC_MSG_ERROR([Python 3.10 or later is required for --enable-mcp-server, found $PYTHON_VERSION])
fi

# Check for uv (Python package manager)
AC_PATH_PROG([UV], [uv])
if test -z "$UV"; then
AC_MSG_WARN([uv not found. MCP server build will attempt to use pip as fallback.])
fi
fi

#
# pax support
#
Expand Down
Loading
Loading