# esa-sdk **Repository Path**: mirrors_aliyun/esa-sdk ## Basic Information - **Project Name**: esa-sdk - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-21 - **Last Updated**: 2025-11-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ESA SDK **Deploy stateless MCP Servers on ESA Edge Routine (ER).** ## Features - **Enables deployment of stateless MCP Servers on ESA Edge Routine.** - **Simplifies integration with Model Context Protocol (MCP) for edge computing.** - **Supports streamlined request handling for tools and server operations.** ## Installation **Install the npm:** ``` npm install esa-sdk ``` ## Usage Example **Below is an example of a simple MCP Server implementing a basic addition calculator:** ```javascript import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; import { StreamableHTTPEdgeServerTransport } from "esa-sdk/mcp.js"; const server = new Server( { name: "example-server", version: "1.0.0", }, { capabilities: { tools: {}, }, } ); // Define available tools server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "calculate_sum", description: "Add two numbers together", inputSchema: { type: "object", properties: { a: { type: "number" }, b: { type: "number" }, }, required: ["a", "b"], }, }, ], }; }); // Handle tool execution server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name === "calculate_sum") { const { a, b } = request.params.arguments; return { content: [ { type: "text", text: String(a + b), }, ], }; } throw new Error("Tool not found"); }); export default { async fetch(request, ctx) { const url = new URL(request.url); const path = url.pathname; if (path === "/mcp") { const transport = new StreamableHTTPEdgeServerTransport(); await server.connect(transport); return transport.handleRequest(request, ctx); } else { return new Response("Error pathname", { status: 404 }); } }, }; ``` ## Contributing **We welcome contributions from the community! Here’s how you can help:** - **Examples** - **Feature Suggestions** - **Bug Fixes** **To contribute, please fork the repository, make your changes, and submit a pull request. For major changes, open an issue first to discuss your ideas.** ## License MIT License.