@@ -27,22 +27,23 @@ docker run --rm --name mcp-cpp-demo --mount type=bind,src=$(pwd),dst=/work mcp-c
2727
2828- Windows (PowerShell via WSL2 Ubuntu):
2929``` powershell
30- wsl -d Ubuntu -- bash -lc "cd /mnt/c/Work /mcp-cpp && docker buildx build -f Dockerfile.demo --target test --progress=plain --pull --load -t mcp-cpp-test ."
31- wsl -d Ubuntu -- bash -lc "cd /mnt/c/Work /mcp-cpp && docker buildx build -f Dockerfile.demo --target demo --progress=plain --pull --load -t mcp-cpp-demo ."
32- wsl -d Ubuntu -- bash -lc "docker run --rm --name mcp-cpp-demo --mount type=bind,src=/mnt/c/Work /mcp-cpp,dst=/work mcp-cpp-demo"
30+ wsl -d Ubuntu -- bash -lc "cd /mnt/c/<path-to-repo> /mcp-cpp && docker buildx build -f Dockerfile.demo --target test --progress=plain --pull --load -t mcp-cpp-test ."
31+ wsl -d Ubuntu -- bash -lc "cd /mnt/c/<path-to-repo> /mcp-cpp && docker buildx build -f Dockerfile.demo --target demo --progress=plain --pull --load -t mcp-cpp-demo ."
32+ wsl -d Ubuntu -- bash -lc "docker run --rm --name mcp-cpp-demo --mount type=bind,src=/mnt/c/<path-to-repo> /mcp-cpp,dst=/work mcp-cpp-demo"
3333```
3434
3535## API Reference
3636
3737This section summarizes the primary SDK interfaces and feature-specific APIs.
3838
39- - Client API header: [ include/mcp/Client.h] ( c:/Work/mcp-cpp/include/mcp/Client.h )
40- - Server API header: [ include/mcp/Server.h] ( c:/Work/mcp-cpp/include/mcp/Server.h )
41- - Transport headers: [ include/mcp/Transport.h] ( c:/Work/mcp-cpp/include/mcp/Transport.h ) ,
42- [ include/mcp/InMemoryTransport.hpp] ( c:/Work/mcp-cpp/include/mcp/InMemoryTransport.hpp ) ,
43- [ include/mcp/StdioTransport.hpp] ( c:/Work/mcp-cpp/include/mcp/StdioTransport.hpp ) ,
44- [ include/mcp/SharedMemoryTransport.hpp] ( c:/Work/mcp-cpp/include/mcp/SharedMemoryTransport.hpp ) ,
45- [ include/mcp/HTTPTransport.hpp] ( c:/Work/mcp-cpp/include/mcp/HTTPTransport.hpp )
39+ - Client API header: [ include/mcp/Client.h] ( ./include/mcp/Client.h )
40+ - Server API header: [ include/mcp/Server.h] ( ./include/mcp/Server.h )
41+ - Transport headers: [ include/mcp/Transport.h] ( ./include/mcp/Transport.h ) ,
42+ [ include/mcp/InMemoryTransport.hpp] ( ./include/mcp/InMemoryTransport.hpp ) ,
43+ [ include/mcp/StdioTransport.hpp] ( ./include/mcp/StdioTransport.hpp ) ,
44+ [ include/mcp/SharedMemoryTransport.hpp] ( ./include/mcp/SharedMemoryTransport.hpp ) ,
45+ [ include/mcp/HTTPTransport.hpp] ( ./include/mcp/HTTPTransport.hpp ) ,
46+ [ include/mcp/HTTPServer.hpp] ( ./include/mcp/HTTPServer.hpp )
4647
4748### Client API (IClient / Client)
4849
@@ -54,6 +55,8 @@ This section summarizes the primary SDK interfaces and feature-specific APIs.
5455- Subscriptions: ` SubscribeResources() ` , ` SubscribeResources(optional<string> uri) ` ,
5556 ` UnsubscribeResources() ` , ` UnsubscribeResources(optional<string> uri) `
5657- Prompts: ` ListPrompts() ` , ` ListPromptsPaged(cursor, limit) ` , ` GetPrompt(name, args) `
58+ - Utilities: ` Complete(params) ` , ` Ping() `
59+ - Roots and elicitation: ` SetRootsListHandler(handler) ` , ` NotifyRootsListChanged() ` , ` SetElicitationHandler(handler) `
5760- Sampling (server → client): ` SetSamplingHandler(handler) `
5861- Notifications & progress: ` SetNotificationHandler(method, handler) ` , ` RemoveNotificationHandler(method) ` ,
5962 ` SetProgressHandler(handler) ` , ` SetErrorHandler(handler) `
@@ -74,7 +77,8 @@ ClientCapabilities caps; auto serverCaps = client->Initialize(info, caps).get();
7477- Resources: `RegisterResource(uri, handler)`, `UnregisterResource(uri)`, `ListResources()`, `ReadResource(uri)`
7578- Resource templates: `RegisterResourceTemplate(t)`, `UnregisterResourceTemplate(template)`, `ListResourceTemplates()`
7679- Prompts: `RegisterPrompt(name, handler)`, `UnregisterPrompt(name)`, `ListPrompts()`, `GetPrompt(name, args)`
77- - Sampling: `SetSamplingHandler(handler)`, `RequestCreateMessage(params)`
80+ - Utilities: `SetCompletionHandler(handler)`, `RequestCreateMessage(params)`, `RequestElicitation(request)`, `RequestRootsList()`, `Ping()`
81+ - Sampling: `SetSamplingHandler(handler)`
7882- Keepalive: `SetKeepaliveIntervalMs(intervalMs)`
7983- Logging: `LogToClient(level, message, data)`
8084- Notifications: `NotifyResourcesListChanged()`, `NotifyResourceUpdated(uri)`, `NotifyToolsListChanged()`, `NotifyPromptsListChanged()`
@@ -87,10 +91,11 @@ ClientCapabilities caps; auto serverCaps = client->Initialize(info, caps).get();
8791- Messaging: `SendRequest(req)`, `SendNotification(note)`
8892- Handlers: `SetNotificationHandler(h)`, `SetErrorHandler(h)`, `SetRequestHandler(h)`
8993- Implementations:
90- - In-memory: [include/mcp/InMemoryTransport.hpp](c:/Work/mcp-cpp/include/mcp/InMemoryTransport.hpp)
91- - Stdio: [include/mcp/StdioTransport.hpp](c:/Work/mcp-cpp/include/mcp/StdioTransport.hpp)
92- - Shared Memory: [include/mcp/SharedMemoryTransport.hpp](c:/Work/mcp-cpp/include/mcp/SharedMemoryTransport.hpp)
93- - HTTP client: [include/mcp/HTTPTransport.hpp](c:/Work/mcp-cpp/include/mcp/HTTPTransport.hpp)
94+ - In-memory: [include/mcp/InMemoryTransport.hpp](./include/mcp/InMemoryTransport.hpp)
95+ - Stdio: [include/mcp/StdioTransport.hpp](./include/mcp/StdioTransport.hpp)
96+ - Shared Memory: [include/mcp/SharedMemoryTransport.hpp](./include/mcp/SharedMemoryTransport.hpp)
97+ - HTTP client: [include/mcp/HTTPTransport.hpp](./include/mcp/HTTPTransport.hpp)
98+ - HTTP server/acceptor: [include/mcp/HTTPServer.hpp](./include/mcp/HTTPServer.hpp)
9499
95100#### HTTP Authentication (Bearer/OAuth2)
96101
@@ -207,8 +212,8 @@ Tests use GoogleTest via CMake FetchContent (build-time only). See [BUILD+TEST.M
207212
208213Build and run the client/server demo using stdio transport (WSL2 PowerShell example below):
209214``` powershell
210- wsl -d Ubuntu -- bash -lc "cd /mnt/c/Work /mcp-cpp && docker buildx build -f Dockerfile.demo --target demo --progress=plain --pull --load -t mcp-cpp-demo ."
211- wsl -d Ubuntu -- bash -lc "docker run --rm --name mcp-cpp-demo --mount type=bind,src=/mnt/c/Work /mcp-cpp,dst=/work mcp-cpp-demo"
215+ wsl -d Ubuntu -- bash -lc "cd /mnt/c/<path-to-repo> /mcp-cpp && docker buildx build -f Dockerfile.demo --target demo --progress=plain --pull --load -t mcp-cpp-demo ."
216+ wsl -d Ubuntu -- bash -lc "docker run --rm --name mcp-cpp-demo --mount type=bind,src=/mnt/c/<path-to-repo> /mcp-cpp,dst=/work mcp-cpp-demo"
212217```
213218
214219## Examples
0 commit comments