3 Commits

Author SHA1 Message Date
Alexandre Perez
6ed18d8525
[lldb][mcp] Get the running MCP server connection information (#162752)
Currently AFAICT we don't have a way to get the MCP server socket after
it started. So this change introduces a new `protocol-server` subcommand
that allows us to query the location of a running server:

```
(lldb) protocol-server start MCP listen://localhost:0
MCP server started with connection listeners: connection://[::1]:36051, connection://[127.0.0.1]:36051
(lldb) protocol-server get MCP
MCP server connection listeners: connection://[::1]:36051, connection://[127.0.0.1]:36051
(lldb) protocol-server stop MCP
(lldb) protocol-server get MCP
error: MCP server is not running
```
2025-10-10 09:55:09 -07:00
Alexandre Perez
da6c7e6dd2
[lldb][mcp] Skip MCPUnixSocketCommandTestCase if remote (#146807)
It looks like #146603 broke the
[lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197)
build bot because `MCPUnixSocketCommandTestCase` is trying to start a
protocol-server via unix domain sockets on windows.
This change makes it so the test is skipped if it is remote.
2025-07-03 03:17:42 -07:00
Alexandre Perez
a068ed288a
[lldb][mcp] Fix unix domain socket protocol server addresses (#146603)
When starting an MCP protocol server that uses unix sockets as the
transport, a local `'[0.0.0.0]:0'` file is used instead of the supplied
socket path, e.g:
```
(lldb) protocol-server start MCP accept:///tmp/some/path.sock
MCP server started with connection listeners: unix-connect://[0.0.0.0]:0
(lldb) shell ls '[*'
[0.0.0.0]:0
```

This change makes it so that the URI path is used if the socket protocol
is `ProtocolUnixDomain`:
```
(lldb) protocol-server start MCP accept:///tmp/some/path.sock
MCP server started with connection listeners: unix-connect:///tmp/some/path.sock
```
2025-07-02 17:03:05 -07:00