Skip to content
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

Server wasm compatibility #15

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

4t145
Copy link
Contributor

@4t145 4t145 commented Mar 3, 2025

This pr is based on pr #12
This pr makes two key changes:

  1. Removes the main.rs file and make it a example
  2. Add a wasi_std_io example

Motivation and Context

Support wasi compile target for mcp-server

How Has This Been Tested?

Tested by mcpinspector

Breaking Changes

No breaking changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

build: cargo build -p mcp-server --example wasi_std_io --target wasm32-wasip1
run: npx @modelcontextprotocol/inspector wasmedge --dir logs:. run target/wasm32-wasip1/debug/examples/wasi_std_io.wasm

4t145 added 5 commits March 2, 2025 14:34
This commit adds supporting modules for the Axum Server-Sent Events (SSE) example:
- Added `counter.rs` with a simple counter router implementation
- Added `jsonrpc_frame_codec.rs` for decoding JSON-RPC frames
- Created a `mod.rs` to expose these modules
- Removed the previous SSE example configuration from Cargo.toml
This commit makes two key changes:
1. Removes the main.rs file and make it a example
2. Add a wasi_std_io example
Merged AsyncInputStream and AsyncOutputStream into a single WasiFd struct with std_in() and std_out() methods, reducing code duplication and improving clarity of the WASI standard I/O example.
@4t145 4t145 mentioned this pull request Mar 3, 2025
@kalvinnchau
Copy link
Contributor

Hi! Thank you for the contribution!! We recently overhauled the examples in #10, can you please update this PR to follow that one?

@4t145
Copy link
Contributor Author

4t145 commented Mar 4, 2025

Examples are moved, we can continue this PR after #12 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants