Add Python bindings crate, FFI, workflow, and examples for RMCP Rust SDK #172
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
This PR introduces Python bindings for the RMCP Rust SDK using PyO3, along with a GitHub Actions workflow, tests, and example usage. The bindings enable Python applications to interact with the Rust SDK via FFI, including an example SSE client.
What’s Included
New Rust crate for Python bindings under bindings/python
PyO3-based FFI for seamless Rust ↔ Python integration
Example Python SSE client (bindings/python/examples/clients/src/sse.py)
GitHub Actions workflow for building and testing Python bindings
Tests for Python bindings (bindings/python/tests/)
.gitignore files for Rust and Python artifacts
How Has This Been Tested?
An example working Python client and a few test cases have been added.
Breaking Changes
None
Types of changes
Checklist
Additional context
README: Python Bindings Setup & Example Usage
Rust (latest stable, with cargo)
Python 3.8+ (with pip)
maturin for building the Python extension (install via pip install maturin)
cd bindings/python
maturin develop # or: maturin build && pip install target/wheels/*.whl
This will compile the Rust FFI library and install the Python package in your environment.
In a separate terminal, start the Rust SDK server (example using the rmcp crate):
cd examples
cargo run --example servers_axum
With the server running, in another terminal:
cd bindings/python/examples/clients/src
python sse.py