rust-sdk/examples/simple-chat-client
jokemanfire 5e4d447b32
chore: make cli command in simple-chat (#145)
add config,chat,help command
2025-04-27 09:10:51 +08:00
..
src chore: make cli command in simple-chat (#145) 2025-04-27 09:10:51 +08:00
Cargo.toml chore: make cli command in simple-chat (#145) 2025-04-27 09:10:51 +08:00
README.md chore: make cli command in simple-chat (#145) 2025-04-27 09:10:51 +08:00

Simple Chat Client

A simple chat client implementation using the Model Context Protocol (MCP) SDK. It just a example for developers to understand how to use the MCP SDK. This example use the easiest way to start a MCP server, and call the tool directly. No need embedding or complex third library or function call(because some models can't support function call).Just add tool in system prompt, and the client will call the tool automatically.

Usage

After configuring the config file, you can run the example:

./simple_chat --help                                                       # show help info
./simple_chat config > config.toml                                         # output default config to file
./simple_chat chat --config my_config.toml                                 # start chat with specified config
./simple_chat chat --config my_config.toml --model gpt-4o-mini             # start chat with specified model