-
Notifications
You must be signed in to change notification settings - Fork 167
Add Typescript bindings crate, FFI, workflow, and examples for RMCP Rust SDK #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Typescript bindings crate, FFI, workflow, and examples for RMCP Rust SDK #183
Conversation
For #172 and this #183, I am sorry that I don't think I can maintain those bindings in the future. So how about this, you create a repository and maintain those yourself, we add a link to your repository in readme. cc @jokemanfire |
Wow, amazing work @tarunanand-dev! 🚀 |
I think it is better to use a separate repository for maintenance.That way, the existing rust-sdk target will not be modified and the maintenance effort will not increase. |
Thanks @reneleonhardt Appreciate the feedback. |
Ok @jokemanfire thanks for the feedback. I will keep this PR open around for some more time as I gather feedback from other contributors and will then move it out. |
Feel free to open this pr, and I will try to use it and check it after the rust-sdk publish the first stable. |
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.