* feat: better http server support
1. allow user get extensions in tool call.
2. allow user serve sse service without initialization.
* fix: fix document test
* feat(client): cleanup of zombie processes in child process client
Using process wrap library, Process Group for Unix and Job Object for Windows
* fix: install extra dep based on feature, update examples take owned command
Install process-wrap if transport-child-process feature is enabled. Update examples to take ownership
of the command instead of mutable reference
* fix: update other examples, comments and readme to take ownership of command
Updated more examples, comments and readme to take command instead of mutable ref.
Also small fix in cargo toml of example to use local path.
* refactor: add configure command ext
Added configure command ext to tokio process command so that
you can use .configure() to use inline commands for mcp stdio client.
Added warning if start kill process fails
* refactor: a transport trait and streamable http client
* test: test with js streamable http server
* refactor: separate sse stream connection
* fix(test): streamable http client test with js
* fix(test): wait longer time for js server startup
* feat(model): add json schema generation support for all model types
This commit adds JSON Schema support for all model types by implementing
`schemars::JsonSchema` trait. The feature is gated behind the new
`schemars` feature flag. This enables automatic schema generation for
API documentation and validation purposes. Added tests to verify schema
generation for client and server JSON-RPC messages.
* fix(model): add manual json schema implementation for `NumberOrString`
This commit adds a manual implementation of `JsonSchema` trait for the
`NumberOrString` enum to properly represent its union type nature in
JSON Schema. The schema now correctly specifies that the type can be
either a number or a string using the `oneOf` validation keyword.
* fix(model): skip extensions field in json schema generation
The `Extensions` type was incorrectly included in JSON schema
generation, which could lead to confusing API documentation. This commit
adds `#[schemars(skip)]` attribute to all `extensions` fields in request
and notification structs, and removes the manual `JsonSchema`
implementation for the `Extensions` type since it's an internal
implementation detail that shouldn't be exposed in the schema.
* feat(transport): support streamable http server
* refactor(transport): add common module for shared transport utilities
* perf(tracing): add more log for streamable http session
* fix(test): fix port conflict in test with js
* fix(transport): fix id generating and session management
1. cancel when deleting
2. use `wrapping` and `saturating` correctly
* chore(naming): rename sse server to streamable http server
* fix(test): skip serialize tool's annotation if empty
1. skip serialize tool's annotation if empty
2. close js server and client when close
* fix(test): fix test with js, don't close too early
When a running service is dropped, its connections should be closed and its resources should be
cleaned up.
This changes the default from leaving services running to closing them. Library users who want
their services to remain running should call `waiting` on their running service, in a new task
where necessary.
Co-authored-by: Paul Ellenbogen <pe5@cs.princeton.edu>
The example in the README uses "sum" for both `sum` and `sub`. I changed it to "difference". For consistency, I also updated the example code to use the same term.
1.Check whether the parameters include aggregated parameters and individual parameters
2.Check if the toolbox attribute is default
Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>