Skip to content

Conversation

@viksachdev
Copy link
Collaborator

No description provided.

Replaced std::string_view with std::string in trimView/trimString
lambda and tryDecodeArgumentsString. Removed unused string_view
and variant includes for C++14 compatibility.
Added missing #include <string> to mcp_c_raii.h and
#include "mcp/json/json_serialization.h" to mcp_client.cc.
…ization (#142)

Moved ListToolsResult definition before ResponseResult variant to
allow it as a variant type. Added serialization and deserialization
support for ListToolsResult in json_serialization.cc.
Added #include <unistd.h> for Linux/Unix and changed environ
reference to ::environ to avoid namespace issues.
Added missing #include <cstdio> to mcp_c_memory_impl.cc.
Added socklen_t typedef for Windows in address.h since Winsock
doesn't define it. Added winsock2.h and ws2tcpip.h includes to
address_impl.h to avoid header conflicts on Windows.
Added platform-specific SOCKET_ERROR_AGAIN, SOCKET_ERROR_INPROGRESS,
SOCKET_ERROR_WOULDBLOCK, SOCKET_ERROR_CONNREFUSED, SOCKET_ERROR_CONNRESET,
SOCKET_ERROR_NOTCONN, and getLastSocketError() to io_handle.h.
Removed duplicate definitions from io_socket_handle_impl.cc,
socket_interface_impl.cc, and tcp_server_listener_impl.cc.
Added SO_ERROR check in onWriteReady() to verify connection actually
succeeded for non-blocking connect. Used normalized SOCKET_ERROR_*
constants in doConnect() for cross-platform error handling. Added
debug logging for connection state transitions.
Added winsock2.h and ws2tcpip.h includes at top of mcp_c_bridge.h
to avoid header conflicts. Added #ifndef _WIN32 guard around Unix
domain socket handling since Windows doesn't support them.
Added Windows-specific includes (io.h, windows.h) and implementation
for stdin reading using GetStdHandle, WaitForSingleObject, and
ReadFile. Wrapped Unix poll/fcntl code in #ifndef _WIN32 guards.
Added Windows socket initialization (WSAStartup) to event_loop_example.
Added Windows includes to tcp_ssl_http_example. Wrapped SIGPIPE signal
handler in #ifndef _WIN32 guard in stdio_echo examples since SIGPIPE
doesn't exist on Windows. Simplified connection wait in mcp_example_client.
Changed tests/CMakeLists.txt to use ${NGHTTP2_LIBRARIES} variable
instead of hardcoded "nghttp2" for cross-platform compatibility.
Added Windows build section to README.md with Cygwin/MinGW-w64
prerequisites and build commands.
@github-actions
Copy link

❌ Code Formatting Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.

To fix this issue:

make format

Then commit and push the changes.

@gophergogo gophergogo changed the title Fix/mcp client fixes Fix/mcp client fixes with cross-compile for macOS, Linux and Windows Dec 31, 2025
@gophergogo gophergogo merged commit 3563080 into main Jan 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants