I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

MCP-WASM
Une implémentation de preuve de concept d'un serveur de protocole de contexte de modèle (MCP) qui s'exécute dans WebAssembly (WASM) dans un navigateur Web. Ce projet démontre l'intégration des outils et des ressources MCP dans un environnement de navigateur.
3 years
Works with Finder
1
Github Watches
5
Github Forks
15
Github Stars
WASM MCP Server
A proof-of-concept implementation of a Model Context Protocol (MCP) server that runs in WebAssembly (WASM) within a web browser. This project demonstrates the integration of MCP tools and resources in a browser environment.
Features
Calculator Tool
- Performs basic arithmetic operations (addition, subtraction, multiplication, division)
- Input validation and error handling
- Real-time calculation results
Storage System
- Key-value storage functionality
- Set and retrieve values using string keys
- Persistent storage within the browser session
- Template-based resource handling
Technical Implementation
Server Components
-
server.ts
: Core MCP server implementation with tool and resource definitions -
main.ts
: Client-side integration and UI interaction handling -
browser-transport.ts
: Custom transport layer for browser communication
Architecture
- Uses the Model Context Protocol SDK for server implementation
- Implements a custom browser transport layer
- Tools are registered with callback functions
- Resources use template paths with parameter substitution
Key Concepts
-
Tools
- Registered using
server.tool()
- Execute via callback functions
- Schema validation using Zod
- Registered using
-
Resources
- Template-based paths (e.g.,
storage://{key}
) - Accessed via
readCallback
- Parameterized resource handling
- Template-based paths (e.g.,
Usage
Calculator
- Select an operation (add, subtract, multiply, divide)
- Enter two numbers
- Click "Calculate" to see the result
- Error handling for invalid inputs and division by zero
Storage
- Enter a key and value in the respective fields
- Click "Set Storage" to store the value
- Enter a key and click "Get Storage" to retrieve a value
- Feedback provided for successful operations and errors
Dependencies
- @modelcontextprotocol/sdk
- Zod (for schema validation)
- TypeScript
- Vite (for development and building)
Project Structure
mcp-wasm-poc/
├── src/
│ └── web/
│ ├── server.ts # MCP server implementation
│ ├── main.ts # Client-side logic
│ └── browser-transport.ts # Browser transport layer
├── index.html # Web interface
└── package.json # Project dependencies
Error Handling
- Server initialization errors
- Tool execution errors
- Resource access errors
- Input validation
- Transport layer errors
Future Enhancements
- Additional calculator operations
- Persistent storage across sessions
- Enhanced UI/UX
- Additional MCP tools and resources
- WASM optimization
Development
This is a proof-of-concept implementation demonstrating the feasibility of running an MCP server in a web browser using WebAssembly. The implementation focuses on demonstrating core MCP concepts while maintaining simplicity and clarity.
相关推荐
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.
Advanced software engineer GPT that excels through nailing the basics.
Therapist adept at identifying core issues and offering practical advice with images.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.
Miroir dehttps: //github.com/bitrefill/bitrefill-mcp-server
Reviews

user_SrMYtLeO
As a loyal MCP App user, I highly recommend checking out the mcp-wasm by beekmarks! This product offers an impressive solution that integrates seamlessly into my workflow. The documentation and support provided by the author made it easy to get started and utilize its full potential. If you're looking for a reliable and efficient WASM tool, don't miss out on mcp-wasm! You can find more details at their GitHub page.