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/typescript
build.rs
Motivation and Context
How Has This Been Tested?
Breaking Changes
None
Types of changes
Checklist
Additional context
Example Client
bindings/typescript/examples/clients
Integration
Cargo.toml
to include TypeScript bindingsDocumentation
TypeScript Bindings Setup & Example Usage
Prerequisites
npm install -g typescript
)Build the TypeScript Bindings
cd bindings/typescript
Note on Cargo.toml
If you encounter an error indicating that the
Cargo.toml
ofbindings/python
is not present in the rootCargo.toml
, and you don't want to build Python and TypeScript together, you can edit the rootCargo.toml
to 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_axum
Link the Module Locally
If the
rmcp-typescript
module is not published to npm, you can link it locally:cd bindings/typescript
cd examples/clients npm link rmcp-typescript
Run the TypeScript SSE Client Example
With the server running, in another terminal:
cd bindings/typescript/examples/clients/src npx tsx sse.ts
This will connect to the running Rust server and demonstrate the SSE client functionality.