Add Typescript bindings crate, FFI, workflow, and examples for RMCP Rust SDK #183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
TypeScript Bindings for RMCP
This PR adds TypeScript bindings for the Rust Model Context Protocol (RMCP) SDK, providing a native TypeScript/JavaScript interface for interacting with RMCP services.
Changes
Core TypeScript Bindings
bindings/typescriptbuild.rsMotivation and Context
How Has This Been Tested?
Breaking Changes
None
Types of changes
Checklist
Additional context
Example Client
bindings/typescript/examples/clientsIntegration
Cargo.tomlto include TypeScript bindingsDocumentation
TypeScript Bindings Setup & Example Usage
Prerequisites
npm install -g typescript)Build the TypeScript Bindings
cd bindings/typescriptNote on Cargo.toml
If you encounter an error indicating that the
Cargo.tomlofbindings/pythonis not present in the rootCargo.toml, and you don't want to build Python and TypeScript together, you can edit the rootCargo.tomlto remove the Python bindings (bindings/python) entry.Run the Rust Server
In a separate terminal, start the Rust SDK server (example using the rmcp crate):
cd examples/servers cargo run --example servers_axumLink the Module Locally
If the
rmcp-typescriptmodule is not published to npm, you can link it locally:cd bindings/typescriptcd examples/clients npm link rmcp-typescriptRun the TypeScript SSE Client Example
With the server running, in another terminal:
cd bindings/typescript/examples/clients/src npx tsx sse.tsThis will connect to the running Rust server and demonstrate the SSE client functionality.