├── .gitignore ├── README.md ├── python-example ├── client │ ├── .env │ ├── __init__.py │ ├── client.py │ └── pyproject.toml └── server │ ├── __init__.py │ ├── pyproject.toml │ └── weather.py └── typescript-example ├── client ├── .env ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json └── server ├── package-lock.json ├── package.json ├── src ├── index.ts └── server.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | 3 | # Python-generated files 4 | __pycache__/ 5 | *.py[oc] 6 | dist/ 7 | wheels/ 8 | *.egg-info 9 | 10 | # Node-generated files 11 | node_modules/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MCP Streamable HTTP – Python and Typescript Examples 2 | 3 | This repository provides example implementations of MCP (Model Context Protocol) **Streamable HTTP client and server** in Python and Typescript, based on the specification: 📄 [MCP Streamable HTTP Spec](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http). 4 | 5 | You can set up a client + server stack entirely using either Python or TypeScript. This example also demonstrates cross-language compatibility, allowing a Python client to communicate with a TypeScript server, and vice-versa. 6 | 7 | ## 🚀 Getting Started 8 | 9 | ### 1. Clone the Repository 10 | 11 | ```bash 12 | git clone https://github.com/invariantlabs-ai/mcp-streamable-http.git 13 | cd python-example 14 | ``` 15 | 16 | ### 2. Python Example 17 | 18 | #### 1. Add Your Anthropic API Key 19 | 20 | Update the `.env` file inside the `python-example/client` directory with the following content: 21 | 22 | ```env 23 | ANTHROPIC_API_KEY=your_api_key_here 24 | ``` 25 | 26 | #### 2. Set Up the Server 27 | 28 | ```bash 29 | cd python-example/server 30 | pip install . 31 | python weather.py 32 | ``` 33 | 34 | By default, the server will start at `http://localhost:8123`. 35 | If you'd like to specify a different port, use the `--port` flag: 36 | 37 | ```bash 38 | python weather.py --port=9000 39 | ``` 40 | 41 | #### 3. Set Up the Client 42 | 43 | ```bash 44 | cd ../client 45 | pip install . 46 | ``` 47 | 48 | #### 4. Run the Client 49 | 50 | ```bash 51 | python client.py 52 | ``` 53 | 54 | This will start an **interactive chat loop** using the MCP Streamable HTTP protocol. 55 | If you started the MCP server on a different port, specify it using the `--mcp-localhost-port` flag: 56 | 57 | ```bash 58 | python client.py --mcp-localhost-port=9000 59 | ``` 60 | 61 | ### 3. Typescript Example 62 | 63 | #### 1. Add Your Anthropic API Key 64 | 65 | Update the `.env` file inside the `typescript-example/client` directory with the following content: 66 | 67 | ```env 68 | ANTHROPIC_API_KEY=your_api_key_here 69 | ``` 70 | 71 | #### 2. Set Up the Server 72 | 73 | ```bash 74 | cd typescript-example/server 75 | npm install && npm run build 76 | node build/index.js 77 | ``` 78 | 79 | By default, the server will start at `http://localhost:8123`. 80 | If you'd like to specify a different port, use the `--port` flag: 81 | 82 | ```bash 83 | node build/index.js --port=9000 84 | ``` 85 | 86 | #### 3. Set Up the Client 87 | 88 | ```bash 89 | cd ../client 90 | npm install && npm run build 91 | ``` 92 | 93 | #### 4. Run the Client 94 | 95 | ```bash 96 | node build/index.js 97 | ``` 98 | 99 | This will start an **interactive chat loop** using the MCP Streamable HTTP protocol. 100 | If you started the MCP server on a different port, specify it using the `--mcp-localhost-port` flag: 101 | 102 | ```bash 103 | node build/index.js --mcp-localhost-port=9000 104 | ``` 105 | 106 | --- 107 | 108 | ## 💬 Example Queries 109 | 110 | In the client chat interface, you can ask questions like: 111 | 112 | - “Are there any weather alerts in Sacramento?” 113 | - “What’s the weather like in New York City?” 114 | - “Tell me the forecast for Boston tomorrow.” 115 | 116 | The client will forward requests to the local MCP weather server and return the results using Anthropic’s Claude language model. The MCP transport layer used will be Streamable HTTP. 117 | -------------------------------------------------------------------------------- /python-example/client/.env: -------------------------------------------------------------------------------- 1 | ANTHROPIC_API_KEY=your_anthropic_api_key -------------------------------------------------------------------------------- /python-example/client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/invariantlabs-ai/mcp-streamable-http/bd4801a5c5fb53bdf4b83fbfa22b7c8f5b1c82a5/python-example/client/__init__.py -------------------------------------------------------------------------------- /python-example/client/client.py: -------------------------------------------------------------------------------- 1 | """MCP Streamable HTTP Client""" 2 | 3 | import argparse 4 | import asyncio 5 | from typing import Optional 6 | from contextlib import AsyncExitStack 7 | 8 | from mcp import ClientSession 9 | from mcp.client.streamable_http import streamablehttp_client 10 | 11 | from anthropic import Anthropic 12 | from dotenv import load_dotenv 13 | 14 | load_dotenv() 15 | 16 | 17 | class MCPClient: 18 | """MCP Client for interacting with an MCP Streamable HTTP server""" 19 | 20 | def __init__(self): 21 | # Initialize session and client objects 22 | self.session: Optional[ClientSession] = None 23 | self.exit_stack = AsyncExitStack() 24 | self.anthropic = Anthropic() 25 | 26 | async def connect_to_streamable_http_server( 27 | self, server_url: str, headers: Optional[dict] = None 28 | ): 29 | """Connect to an MCP server running with HTTP Streamable transport""" 30 | self._streams_context = streamablehttp_client( # pylint: disable=W0201 31 | url=server_url, 32 | headers=headers or {}, 33 | ) 34 | read_stream, write_stream, _ = await self._streams_context.__aenter__() # pylint: disable=E1101 35 | 36 | self._session_context = ClientSession(read_stream, write_stream) # pylint: disable=W0201 37 | self.session: ClientSession = await self._session_context.__aenter__() # pylint: disable=C2801 38 | 39 | await self.session.initialize() 40 | 41 | async def process_query(self, query: str) -> str: 42 | """Process a query using Claude and available tools""" 43 | messages = [{"role": "user", "content": query}] 44 | 45 | response = await self.session.list_tools() 46 | available_tools = [ 47 | { 48 | "name": tool.name, 49 | "description": tool.description, 50 | "input_schema": tool.inputSchema, 51 | } 52 | for tool in response.tools 53 | ] 54 | 55 | # Initial Claude API call 56 | response = self.anthropic.messages.create( 57 | model="claude-3-5-sonnet-20241022", 58 | max_tokens=1000, 59 | messages=messages, 60 | tools=available_tools, 61 | ) 62 | 63 | # Process response and handle tool calls 64 | final_text = [] 65 | 66 | for content in response.content: 67 | if content.type == "text": 68 | final_text.append(content.text) 69 | elif content.type == "tool_use": 70 | tool_name = content.name 71 | tool_args = content.input 72 | 73 | # Execute tool call 74 | result = await self.session.call_tool(tool_name, tool_args) 75 | final_text.append(f"[Calling tool {tool_name} with args {tool_args}]") 76 | 77 | # Continue conversation with tool results 78 | if hasattr(content, "text") and content.text: 79 | messages.append({"role": "assistant", "content": content.text}) 80 | messages.append({"role": "user", "content": result.content}) 81 | 82 | # Get next response from Claude 83 | response = self.anthropic.messages.create( 84 | model="claude-3-5-sonnet-20241022", 85 | max_tokens=1000, 86 | messages=messages, 87 | ) 88 | 89 | final_text.append(response.content[0].text) 90 | 91 | return "\n".join(final_text) 92 | 93 | async def chat_loop(self): 94 | """Run an interactive chat loop""" 95 | print("\nMCP Client Started!") 96 | print("Type your queries or 'quit' to exit.") 97 | 98 | while True: 99 | try: 100 | query = input("\nQuery: ").strip() 101 | 102 | if query.lower() == "quit": 103 | break 104 | 105 | response = await self.process_query(query) 106 | print("\n" + response) 107 | 108 | except Exception as e: 109 | print(f"\nError: {str(e)}") 110 | 111 | async def cleanup(self): 112 | """Properly clean up the session and streams""" 113 | if self._session_context: 114 | await self._session_context.__aexit__(None, None, None) 115 | if self._streams_context: # pylint: disable=W0125 116 | await self._streams_context.__aexit__(None, None, None) # pylint: disable=E1101 117 | 118 | 119 | async def main(): 120 | """Main function to run the MCP client""" 121 | parser = argparse.ArgumentParser(description="Run MCP Streamable http based Client") 122 | parser.add_argument( 123 | "--mcp-localhost-port", type=int, default=8123, help="Localhost port to bind to" 124 | ) 125 | args = parser.parse_args() 126 | 127 | client = MCPClient() 128 | 129 | try: 130 | await client.connect_to_streamable_http_server( 131 | f"http://localhost:{args.mcp_localhost_port}/mcp" 132 | ) 133 | await client.chat_loop() 134 | finally: 135 | await client.cleanup() 136 | 137 | 138 | if __name__ == "__main__": 139 | asyncio.run(main()) 140 | -------------------------------------------------------------------------------- /python-example/client/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "mcp-client" 3 | version = "0.1.0" 4 | description = "HTTP Streamable based example MCP Client" 5 | requires-python = ">=3.12" 6 | dependencies = [ 7 | "anthropic~=0.51.0", 8 | "mcp~=1.9.0", 9 | "python-dotenv~=1.1.0", 10 | ] -------------------------------------------------------------------------------- /python-example/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/invariantlabs-ai/mcp-streamable-http/bd4801a5c5fb53bdf4b83fbfa22b7c8f5b1c82a5/python-example/server/__init__.py -------------------------------------------------------------------------------- /python-example/server/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "mcp-streamable-http-server" 3 | version = "0.1.0" 4 | description = "HTTP Streamable based example MCP Server" 5 | requires-python = ">=3.12" 6 | dependencies = [ 7 | "httpx~=0.28.0", 8 | "mcp~=1.9.0", 9 | ] 10 | 11 | [build-system] 12 | requires = ["setuptools>=61.0"] 13 | build-backend = "setuptools.build_meta" 14 | -------------------------------------------------------------------------------- /python-example/server/weather.py: -------------------------------------------------------------------------------- 1 | """Weather tools for MCP Streamable HTTP server using NWS API.""" 2 | 3 | import argparse 4 | from typing import Any 5 | 6 | import httpx 7 | import uvicorn 8 | 9 | from mcp.server.fastmcp import FastMCP 10 | 11 | 12 | # Initialize FastMCP server for Weather tools. 13 | # If json_response is set to True, the server will use JSON responses instead of SSE streams 14 | # If stateless_http is set to True, the server uses true stateless mode (new transport per request) 15 | mcp = FastMCP(name="weather", json_response=False, stateless_http=False) 16 | 17 | # Constants 18 | NWS_API_BASE = "https://api.weather.gov" 19 | USER_AGENT = "weather-app/1.0" 20 | 21 | 22 | async def make_nws_request(url: str) -> dict[str, Any] | None: 23 | """Make a request to the NWS API with proper error handling.""" 24 | headers = {"User-Agent": USER_AGENT, "Accept": "application/geo+json"} 25 | async with httpx.AsyncClient() as client: 26 | try: 27 | response = await client.get(url, headers=headers, timeout=30.0) 28 | response.raise_for_status() 29 | return response.json() 30 | except Exception: 31 | return None 32 | 33 | 34 | def format_alert(feature: dict) -> str: 35 | """Format an alert feature into a readable string.""" 36 | props = feature["properties"] 37 | return f""" 38 | Event: {props.get('event', 'Unknown')} 39 | Area: {props.get('areaDesc', 'Unknown')} 40 | Severity: {props.get('severity', 'Unknown')} 41 | Description: {props.get('description', 'No description available')} 42 | Instructions: {props.get('instruction', 'No specific instructions provided')} 43 | """ 44 | 45 | 46 | @mcp.tool() 47 | async def get_alerts(state: str) -> str: 48 | """Get weather alerts for a US state. 49 | 50 | Args: 51 | state: Two-letter US state code (e.g. CA, NY) 52 | """ 53 | url = f"{NWS_API_BASE}/alerts/active/area/{state}" 54 | data = await make_nws_request(url) 55 | 56 | if not data or "features" not in data: 57 | return "Unable to fetch alerts or no alerts found." 58 | 59 | if not data["features"]: 60 | return "No active alerts for this state." 61 | 62 | alerts = [format_alert(feature) for feature in data["features"]] 63 | return "\n---\n".join(alerts) 64 | 65 | 66 | @mcp.tool() 67 | async def get_forecast(latitude: float, longitude: float) -> str: 68 | """Get weather forecast for a location. 69 | 70 | Args: 71 | latitude: Latitude of the location 72 | longitude: Longitude of the location 73 | """ 74 | # First get the forecast grid endpoint 75 | points_url = f"{NWS_API_BASE}/points/{latitude},{longitude}" 76 | points_data = await make_nws_request(points_url) 77 | 78 | if not points_data: 79 | return "Unable to fetch forecast data for this location." 80 | 81 | # Get the forecast URL from the points response 82 | forecast_url = points_data["properties"]["forecast"] 83 | forecast_data = await make_nws_request(forecast_url) 84 | 85 | if not forecast_data: 86 | return "Unable to fetch detailed forecast." 87 | 88 | # Format the periods into a readable forecast 89 | periods = forecast_data["properties"]["periods"] 90 | forecasts = [] 91 | for period in periods[:5]: # Only show next 5 periods 92 | forecast = f""" 93 | {period['name']}: 94 | Temperature: {period['temperature']}°{period['temperatureUnit']} 95 | Wind: {period['windSpeed']} {period['windDirection']} 96 | Forecast: {period['detailedForecast']} 97 | """ 98 | forecasts.append(forecast) 99 | 100 | return "\n---\n".join(forecasts) 101 | 102 | 103 | if __name__ == "__main__": 104 | parser = argparse.ArgumentParser(description="Run MCP Streamable HTTP based server") 105 | parser.add_argument("--port", type=int, default=8123, help="Localhost port to listen on") 106 | args = parser.parse_args() 107 | 108 | # Start the server with Streamable HTTP transport 109 | uvicorn.run(mcp.streamable_http_app, host="localhost", port=args.port) 110 | -------------------------------------------------------------------------------- /typescript-example/client/.env: -------------------------------------------------------------------------------- 1 | ANTHROPIC_API_KEY=your_anthropic_api_key -------------------------------------------------------------------------------- /typescript-example/client/index.ts: -------------------------------------------------------------------------------- 1 | import { Anthropic } from "@anthropic-ai/sdk"; 2 | import { 3 | MessageParam, 4 | Tool, 5 | } from "@anthropic-ai/sdk/resources/messages/messages.mjs"; 6 | 7 | import { Client } from "@modelcontextprotocol/sdk/client/index.js"; 8 | import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; 9 | import readline from "readline/promises"; 10 | 11 | import dotenv from "dotenv"; 12 | 13 | dotenv.config(); // load environment variables from .env 14 | 15 | const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY; 16 | if (!ANTHROPIC_API_KEY) { 17 | throw new Error("ANTHROPIC_API_KEY is not set"); 18 | } 19 | 20 | class MCPClient { 21 | private mcp: Client; 22 | private anthropic: Anthropic; 23 | private transport: StreamableHTTPClientTransport | null = null; 24 | private tools: Tool[] = []; 25 | 26 | constructor() { 27 | // Initialize Anthropic client and MCP client 28 | this.anthropic = new Anthropic({ 29 | apiKey: ANTHROPIC_API_KEY, 30 | }); 31 | this.mcp = new Client({ name: "mcp-client", version: "1.0.0" }); 32 | } 33 | 34 | async connectToServer(serverUrl: string) { 35 | /** 36 | * Connect to an MCP server 37 | * 38 | * @param serverUrl - The MCP server URL 39 | */ 40 | try { 41 | // Initialize transport and connect to server 42 | const url = new URL(serverUrl); 43 | this.transport = new StreamableHTTPClientTransport(url); 44 | await this.mcp.connect(this.transport); 45 | this.setUpTransport(); 46 | 47 | // List available tools 48 | const toolsResult = await this.mcp.listTools(); 49 | this.tools = toolsResult.tools.map((tool) => { 50 | return { 51 | name: tool.name, 52 | description: tool.description, 53 | input_schema: tool.inputSchema, 54 | }; 55 | }); 56 | console.log( 57 | "Connected to server with tools:", 58 | this.tools.map(({ name }) => name) 59 | ); 60 | } catch (e) { 61 | console.log("Failed to connect to MCP server: ", e); 62 | throw e; 63 | } 64 | } 65 | 66 | private setUpTransport() { 67 | if (this.transport === null) { 68 | return; 69 | } 70 | this.transport.onclose = async () => { 71 | console.log("SSE transport closed."); 72 | await this.cleanup(); 73 | }; 74 | 75 | this.transport.onerror = async (error) => { 76 | console.log("SSE transport error: ", error); 77 | await this.cleanup(); 78 | }; 79 | } 80 | 81 | async processQuery(query: string) { 82 | /** 83 | * Process a query using Claude and available tools 84 | * 85 | * @param query - The user's input query 86 | * @returns Processed response as a string 87 | */ 88 | const messages: MessageParam[] = [ 89 | { 90 | role: "user", 91 | content: query, 92 | }, 93 | ]; 94 | 95 | // Initial Claude API call 96 | const response = await this.anthropic.messages.create({ 97 | model: "claude-3-5-sonnet-20241022", 98 | max_tokens: 1000, 99 | messages, 100 | tools: this.tools, 101 | }); 102 | 103 | // Process response and handle tool calls 104 | const finalText = []; 105 | const toolResults = []; 106 | 107 | for (const content of response.content) { 108 | if (content.type === "text") { 109 | finalText.push(content.text); 110 | } else if (content.type === "tool_use") { 111 | // Execute tool call 112 | const toolName = content.name; 113 | const toolArgs = content.input as { [x: string]: unknown } | undefined; 114 | 115 | const result = await this.mcp.callTool({ 116 | name: toolName, 117 | arguments: toolArgs, 118 | }); 119 | toolResults.push(result); 120 | finalText.push( 121 | `[Calling tool ${toolName} with args ${JSON.stringify(toolArgs)}]` 122 | ); 123 | 124 | // Continue conversation with tool results 125 | messages.push({ 126 | role: "user", 127 | content: result.content as string, 128 | }); 129 | 130 | // Get next response from Claude 131 | const response = await this.anthropic.messages.create({ 132 | model: "claude-3-5-sonnet-20241022", 133 | max_tokens: 1000, 134 | messages, 135 | }); 136 | 137 | finalText.push( 138 | response.content[0].type === "text" ? response.content[0].text : "" 139 | ); 140 | } 141 | } 142 | 143 | return finalText.join("\n"); 144 | } 145 | 146 | async chatLoop() { 147 | /** 148 | * Run an interactive chat loop 149 | */ 150 | const rl = readline.createInterface({ 151 | input: process.stdin, 152 | output: process.stdout, 153 | }); 154 | 155 | try { 156 | console.log("Type your queries or 'quit' to exit."); 157 | 158 | while (true) { 159 | const message = await rl.question("\nQuery: "); 160 | if (message.toLowerCase() === "quit") { 161 | break; 162 | } 163 | const response = await this.processQuery(message); 164 | console.log("\n" + response); 165 | } 166 | } finally { 167 | rl.close(); 168 | } 169 | } 170 | 171 | async cleanup() { 172 | /** 173 | * Clean up resources 174 | */ 175 | await this.mcp.close(); 176 | } 177 | } 178 | 179 | async function main() { 180 | // Default port 181 | let port = 8123; 182 | 183 | // Parse command-line arguments 184 | for (let i = 2; i < process.argv.length; i++) { 185 | const arg = process.argv[i]; 186 | 187 | if (arg.startsWith("--mcp-localhost-port=")) { 188 | const value = parseInt(arg.split("=")[1], 10); 189 | if (!isNaN(value)) { 190 | port = value; 191 | } else { 192 | console.error("Invalid value for --mcp-localhost-port"); 193 | process.exit(1); 194 | } 195 | } 196 | } 197 | 198 | const mcpClient = new MCPClient(); 199 | try { 200 | await mcpClient.connectToServer(`http://localhost:${port}/mcp`); 201 | await mcpClient.chatLoop(); 202 | } finally { 203 | await mcpClient.cleanup(); 204 | process.exit(0); 205 | } 206 | } 207 | 208 | main(); 209 | -------------------------------------------------------------------------------- /typescript-example/client/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcp-client", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "mcp-client", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@anthropic-ai/sdk": "^0.51.0", 13 | "@modelcontextprotocol/sdk": "^1.11.4", 14 | "dotenv": "^16.5.0" 15 | }, 16 | "devDependencies": { 17 | "@types/node": "^22.13.4", 18 | "typescript": "^5.7.3" 19 | }, 20 | "engines": { 21 | "node": ">=16.0.0" 22 | } 23 | }, 24 | "node_modules/@anthropic-ai/sdk": { 25 | "version": "0.51.0", 26 | "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.51.0.tgz", 27 | "integrity": "sha512-fAFC/uHhyzfw7rs65EPVV+scXDytGNm5BjttxHf6rP/YGvaBRKEvp2lwyuMigTwMI95neeG4bzrZigz7KCikjw==", 28 | "license": "MIT", 29 | "bin": { 30 | "anthropic-ai-sdk": "bin/cli" 31 | } 32 | }, 33 | "node_modules/@modelcontextprotocol/sdk": { 34 | "version": "1.11.4", 35 | "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.4.tgz", 36 | "integrity": "sha512-OTbhe5slIjiOtLxXhKalkKGhIQrwvhgCDs/C2r8kcBTy5HR/g43aDQU0l7r8O0VGbJPTNJvDc7ZdQMdQDJXmbw==", 37 | "license": "MIT", 38 | "dependencies": { 39 | "ajv": "^8.17.1", 40 | "content-type": "^1.0.5", 41 | "cors": "^2.8.5", 42 | "cross-spawn": "^7.0.5", 43 | "eventsource": "^3.0.2", 44 | "express": "^5.0.1", 45 | "express-rate-limit": "^7.5.0", 46 | "pkce-challenge": "^5.0.0", 47 | "raw-body": "^3.0.0", 48 | "zod": "^3.23.8", 49 | "zod-to-json-schema": "^3.24.1" 50 | }, 51 | "engines": { 52 | "node": ">=18" 53 | } 54 | }, 55 | "node_modules/@types/node": { 56 | "version": "22.15.19", 57 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz", 58 | "integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==", 59 | "dev": true, 60 | "license": "MIT", 61 | "dependencies": { 62 | "undici-types": "~6.21.0" 63 | } 64 | }, 65 | "node_modules/accepts": { 66 | "version": "2.0.0", 67 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", 68 | "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", 69 | "license": "MIT", 70 | "dependencies": { 71 | "mime-types": "^3.0.0", 72 | "negotiator": "^1.0.0" 73 | }, 74 | "engines": { 75 | "node": ">= 0.6" 76 | } 77 | }, 78 | "node_modules/ajv": { 79 | "version": "8.17.1", 80 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", 81 | "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", 82 | "license": "MIT", 83 | "dependencies": { 84 | "fast-deep-equal": "^3.1.3", 85 | "fast-uri": "^3.0.1", 86 | "json-schema-traverse": "^1.0.0", 87 | "require-from-string": "^2.0.2" 88 | }, 89 | "funding": { 90 | "type": "github", 91 | "url": "https://github.com/sponsors/epoberezkin" 92 | } 93 | }, 94 | "node_modules/body-parser": { 95 | "version": "2.2.0", 96 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", 97 | "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", 98 | "license": "MIT", 99 | "dependencies": { 100 | "bytes": "^3.1.2", 101 | "content-type": "^1.0.5", 102 | "debug": "^4.4.0", 103 | "http-errors": "^2.0.0", 104 | "iconv-lite": "^0.6.3", 105 | "on-finished": "^2.4.1", 106 | "qs": "^6.14.0", 107 | "raw-body": "^3.0.0", 108 | "type-is": "^2.0.0" 109 | }, 110 | "engines": { 111 | "node": ">=18" 112 | } 113 | }, 114 | "node_modules/bytes": { 115 | "version": "3.1.2", 116 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 117 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 118 | "license": "MIT", 119 | "engines": { 120 | "node": ">= 0.8" 121 | } 122 | }, 123 | "node_modules/call-bind-apply-helpers": { 124 | "version": "1.0.2", 125 | "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 126 | "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 127 | "license": "MIT", 128 | "dependencies": { 129 | "es-errors": "^1.3.0", 130 | "function-bind": "^1.1.2" 131 | }, 132 | "engines": { 133 | "node": ">= 0.4" 134 | } 135 | }, 136 | "node_modules/call-bound": { 137 | "version": "1.0.4", 138 | "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", 139 | "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", 140 | "license": "MIT", 141 | "dependencies": { 142 | "call-bind-apply-helpers": "^1.0.2", 143 | "get-intrinsic": "^1.3.0" 144 | }, 145 | "engines": { 146 | "node": ">= 0.4" 147 | }, 148 | "funding": { 149 | "url": "https://github.com/sponsors/ljharb" 150 | } 151 | }, 152 | "node_modules/content-disposition": { 153 | "version": "1.0.0", 154 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", 155 | "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", 156 | "license": "MIT", 157 | "dependencies": { 158 | "safe-buffer": "5.2.1" 159 | }, 160 | "engines": { 161 | "node": ">= 0.6" 162 | } 163 | }, 164 | "node_modules/content-type": { 165 | "version": "1.0.5", 166 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 167 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 168 | "license": "MIT", 169 | "engines": { 170 | "node": ">= 0.6" 171 | } 172 | }, 173 | "node_modules/cookie": { 174 | "version": "0.7.2", 175 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 176 | "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 177 | "license": "MIT", 178 | "engines": { 179 | "node": ">= 0.6" 180 | } 181 | }, 182 | "node_modules/cookie-signature": { 183 | "version": "1.2.2", 184 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", 185 | "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", 186 | "license": "MIT", 187 | "engines": { 188 | "node": ">=6.6.0" 189 | } 190 | }, 191 | "node_modules/cors": { 192 | "version": "2.8.5", 193 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 194 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 195 | "license": "MIT", 196 | "dependencies": { 197 | "object-assign": "^4", 198 | "vary": "^1" 199 | }, 200 | "engines": { 201 | "node": ">= 0.10" 202 | } 203 | }, 204 | "node_modules/cross-spawn": { 205 | "version": "7.0.6", 206 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 207 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 208 | "license": "MIT", 209 | "dependencies": { 210 | "path-key": "^3.1.0", 211 | "shebang-command": "^2.0.0", 212 | "which": "^2.0.1" 213 | }, 214 | "engines": { 215 | "node": ">= 8" 216 | } 217 | }, 218 | "node_modules/debug": { 219 | "version": "4.4.1", 220 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", 221 | "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", 222 | "license": "MIT", 223 | "dependencies": { 224 | "ms": "^2.1.3" 225 | }, 226 | "engines": { 227 | "node": ">=6.0" 228 | }, 229 | "peerDependenciesMeta": { 230 | "supports-color": { 231 | "optional": true 232 | } 233 | } 234 | }, 235 | "node_modules/depd": { 236 | "version": "2.0.0", 237 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 238 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 239 | "license": "MIT", 240 | "engines": { 241 | "node": ">= 0.8" 242 | } 243 | }, 244 | "node_modules/dotenv": { 245 | "version": "16.5.0", 246 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", 247 | "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", 248 | "license": "BSD-2-Clause", 249 | "engines": { 250 | "node": ">=12" 251 | }, 252 | "funding": { 253 | "url": "https://dotenvx.com" 254 | } 255 | }, 256 | "node_modules/dunder-proto": { 257 | "version": "1.0.1", 258 | "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 259 | "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 260 | "license": "MIT", 261 | "dependencies": { 262 | "call-bind-apply-helpers": "^1.0.1", 263 | "es-errors": "^1.3.0", 264 | "gopd": "^1.2.0" 265 | }, 266 | "engines": { 267 | "node": ">= 0.4" 268 | } 269 | }, 270 | "node_modules/ee-first": { 271 | "version": "1.1.1", 272 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 273 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", 274 | "license": "MIT" 275 | }, 276 | "node_modules/encodeurl": { 277 | "version": "2.0.0", 278 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", 279 | "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", 280 | "license": "MIT", 281 | "engines": { 282 | "node": ">= 0.8" 283 | } 284 | }, 285 | "node_modules/es-define-property": { 286 | "version": "1.0.1", 287 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 288 | "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", 289 | "license": "MIT", 290 | "engines": { 291 | "node": ">= 0.4" 292 | } 293 | }, 294 | "node_modules/es-errors": { 295 | "version": "1.3.0", 296 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 297 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 298 | "license": "MIT", 299 | "engines": { 300 | "node": ">= 0.4" 301 | } 302 | }, 303 | "node_modules/es-object-atoms": { 304 | "version": "1.1.1", 305 | "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 306 | "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 307 | "license": "MIT", 308 | "dependencies": { 309 | "es-errors": "^1.3.0" 310 | }, 311 | "engines": { 312 | "node": ">= 0.4" 313 | } 314 | }, 315 | "node_modules/escape-html": { 316 | "version": "1.0.3", 317 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 318 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", 319 | "license": "MIT" 320 | }, 321 | "node_modules/etag": { 322 | "version": "1.8.1", 323 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 324 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 325 | "license": "MIT", 326 | "engines": { 327 | "node": ">= 0.6" 328 | } 329 | }, 330 | "node_modules/eventsource": { 331 | "version": "3.0.7", 332 | "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", 333 | "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", 334 | "license": "MIT", 335 | "dependencies": { 336 | "eventsource-parser": "^3.0.1" 337 | }, 338 | "engines": { 339 | "node": ">=18.0.0" 340 | } 341 | }, 342 | "node_modules/eventsource-parser": { 343 | "version": "3.0.2", 344 | "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.2.tgz", 345 | "integrity": "sha512-6RxOBZ/cYgd8usLwsEl+EC09Au/9BcmCKYF2/xbml6DNczf7nv0MQb+7BA2F+li6//I+28VNlQR37XfQtcAJuA==", 346 | "license": "MIT", 347 | "engines": { 348 | "node": ">=18.0.0" 349 | } 350 | }, 351 | "node_modules/express": { 352 | "version": "5.1.0", 353 | "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", 354 | "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", 355 | "license": "MIT", 356 | "dependencies": { 357 | "accepts": "^2.0.0", 358 | "body-parser": "^2.2.0", 359 | "content-disposition": "^1.0.0", 360 | "content-type": "^1.0.5", 361 | "cookie": "^0.7.1", 362 | "cookie-signature": "^1.2.1", 363 | "debug": "^4.4.0", 364 | "encodeurl": "^2.0.0", 365 | "escape-html": "^1.0.3", 366 | "etag": "^1.8.1", 367 | "finalhandler": "^2.1.0", 368 | "fresh": "^2.0.0", 369 | "http-errors": "^2.0.0", 370 | "merge-descriptors": "^2.0.0", 371 | "mime-types": "^3.0.0", 372 | "on-finished": "^2.4.1", 373 | "once": "^1.4.0", 374 | "parseurl": "^1.3.3", 375 | "proxy-addr": "^2.0.7", 376 | "qs": "^6.14.0", 377 | "range-parser": "^1.2.1", 378 | "router": "^2.2.0", 379 | "send": "^1.1.0", 380 | "serve-static": "^2.2.0", 381 | "statuses": "^2.0.1", 382 | "type-is": "^2.0.1", 383 | "vary": "^1.1.2" 384 | }, 385 | "engines": { 386 | "node": ">= 18" 387 | }, 388 | "funding": { 389 | "type": "opencollective", 390 | "url": "https://opencollective.com/express" 391 | } 392 | }, 393 | "node_modules/express-rate-limit": { 394 | "version": "7.5.0", 395 | "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", 396 | "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", 397 | "license": "MIT", 398 | "engines": { 399 | "node": ">= 16" 400 | }, 401 | "funding": { 402 | "url": "https://github.com/sponsors/express-rate-limit" 403 | }, 404 | "peerDependencies": { 405 | "express": "^4.11 || 5 || ^5.0.0-beta.1" 406 | } 407 | }, 408 | "node_modules/fast-deep-equal": { 409 | "version": "3.1.3", 410 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 411 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 412 | "license": "MIT" 413 | }, 414 | "node_modules/fast-uri": { 415 | "version": "3.0.6", 416 | "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", 417 | "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", 418 | "funding": [ 419 | { 420 | "type": "github", 421 | "url": "https://github.com/sponsors/fastify" 422 | }, 423 | { 424 | "type": "opencollective", 425 | "url": "https://opencollective.com/fastify" 426 | } 427 | ], 428 | "license": "BSD-3-Clause" 429 | }, 430 | "node_modules/finalhandler": { 431 | "version": "2.1.0", 432 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", 433 | "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", 434 | "license": "MIT", 435 | "dependencies": { 436 | "debug": "^4.4.0", 437 | "encodeurl": "^2.0.0", 438 | "escape-html": "^1.0.3", 439 | "on-finished": "^2.4.1", 440 | "parseurl": "^1.3.3", 441 | "statuses": "^2.0.1" 442 | }, 443 | "engines": { 444 | "node": ">= 0.8" 445 | } 446 | }, 447 | "node_modules/forwarded": { 448 | "version": "0.2.0", 449 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 450 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 451 | "license": "MIT", 452 | "engines": { 453 | "node": ">= 0.6" 454 | } 455 | }, 456 | "node_modules/fresh": { 457 | "version": "2.0.0", 458 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", 459 | "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", 460 | "license": "MIT", 461 | "engines": { 462 | "node": ">= 0.8" 463 | } 464 | }, 465 | "node_modules/function-bind": { 466 | "version": "1.1.2", 467 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 468 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 469 | "license": "MIT", 470 | "funding": { 471 | "url": "https://github.com/sponsors/ljharb" 472 | } 473 | }, 474 | "node_modules/get-intrinsic": { 475 | "version": "1.3.0", 476 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 477 | "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 478 | "license": "MIT", 479 | "dependencies": { 480 | "call-bind-apply-helpers": "^1.0.2", 481 | "es-define-property": "^1.0.1", 482 | "es-errors": "^1.3.0", 483 | "es-object-atoms": "^1.1.1", 484 | "function-bind": "^1.1.2", 485 | "get-proto": "^1.0.1", 486 | "gopd": "^1.2.0", 487 | "has-symbols": "^1.1.0", 488 | "hasown": "^2.0.2", 489 | "math-intrinsics": "^1.1.0" 490 | }, 491 | "engines": { 492 | "node": ">= 0.4" 493 | }, 494 | "funding": { 495 | "url": "https://github.com/sponsors/ljharb" 496 | } 497 | }, 498 | "node_modules/get-proto": { 499 | "version": "1.0.1", 500 | "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 501 | "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 502 | "license": "MIT", 503 | "dependencies": { 504 | "dunder-proto": "^1.0.1", 505 | "es-object-atoms": "^1.0.0" 506 | }, 507 | "engines": { 508 | "node": ">= 0.4" 509 | } 510 | }, 511 | "node_modules/gopd": { 512 | "version": "1.2.0", 513 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 514 | "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", 515 | "license": "MIT", 516 | "engines": { 517 | "node": ">= 0.4" 518 | }, 519 | "funding": { 520 | "url": "https://github.com/sponsors/ljharb" 521 | } 522 | }, 523 | "node_modules/has-symbols": { 524 | "version": "1.1.0", 525 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 526 | "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", 527 | "license": "MIT", 528 | "engines": { 529 | "node": ">= 0.4" 530 | }, 531 | "funding": { 532 | "url": "https://github.com/sponsors/ljharb" 533 | } 534 | }, 535 | "node_modules/hasown": { 536 | "version": "2.0.2", 537 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 538 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 539 | "license": "MIT", 540 | "dependencies": { 541 | "function-bind": "^1.1.2" 542 | }, 543 | "engines": { 544 | "node": ">= 0.4" 545 | } 546 | }, 547 | "node_modules/http-errors": { 548 | "version": "2.0.0", 549 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 550 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 551 | "license": "MIT", 552 | "dependencies": { 553 | "depd": "2.0.0", 554 | "inherits": "2.0.4", 555 | "setprototypeof": "1.2.0", 556 | "statuses": "2.0.1", 557 | "toidentifier": "1.0.1" 558 | }, 559 | "engines": { 560 | "node": ">= 0.8" 561 | } 562 | }, 563 | "node_modules/iconv-lite": { 564 | "version": "0.6.3", 565 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 566 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 567 | "license": "MIT", 568 | "dependencies": { 569 | "safer-buffer": ">= 2.1.2 < 3.0.0" 570 | }, 571 | "engines": { 572 | "node": ">=0.10.0" 573 | } 574 | }, 575 | "node_modules/inherits": { 576 | "version": "2.0.4", 577 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 578 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 579 | "license": "ISC" 580 | }, 581 | "node_modules/ipaddr.js": { 582 | "version": "1.9.1", 583 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 584 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 585 | "license": "MIT", 586 | "engines": { 587 | "node": ">= 0.10" 588 | } 589 | }, 590 | "node_modules/is-promise": { 591 | "version": "4.0.0", 592 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", 593 | "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", 594 | "license": "MIT" 595 | }, 596 | "node_modules/isexe": { 597 | "version": "2.0.0", 598 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 599 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 600 | "license": "ISC" 601 | }, 602 | "node_modules/json-schema-traverse": { 603 | "version": "1.0.0", 604 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", 605 | "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", 606 | "license": "MIT" 607 | }, 608 | "node_modules/math-intrinsics": { 609 | "version": "1.1.0", 610 | "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 611 | "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", 612 | "license": "MIT", 613 | "engines": { 614 | "node": ">= 0.4" 615 | } 616 | }, 617 | "node_modules/media-typer": { 618 | "version": "1.1.0", 619 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", 620 | "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", 621 | "license": "MIT", 622 | "engines": { 623 | "node": ">= 0.8" 624 | } 625 | }, 626 | "node_modules/merge-descriptors": { 627 | "version": "2.0.0", 628 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", 629 | "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", 630 | "license": "MIT", 631 | "engines": { 632 | "node": ">=18" 633 | }, 634 | "funding": { 635 | "url": "https://github.com/sponsors/sindresorhus" 636 | } 637 | }, 638 | "node_modules/mime-db": { 639 | "version": "1.54.0", 640 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", 641 | "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", 642 | "license": "MIT", 643 | "engines": { 644 | "node": ">= 0.6" 645 | } 646 | }, 647 | "node_modules/mime-types": { 648 | "version": "3.0.1", 649 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", 650 | "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", 651 | "license": "MIT", 652 | "dependencies": { 653 | "mime-db": "^1.54.0" 654 | }, 655 | "engines": { 656 | "node": ">= 0.6" 657 | } 658 | }, 659 | "node_modules/ms": { 660 | "version": "2.1.3", 661 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 662 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 663 | "license": "MIT" 664 | }, 665 | "node_modules/negotiator": { 666 | "version": "1.0.0", 667 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", 668 | "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", 669 | "license": "MIT", 670 | "engines": { 671 | "node": ">= 0.6" 672 | } 673 | }, 674 | "node_modules/object-assign": { 675 | "version": "4.1.1", 676 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 677 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 678 | "license": "MIT", 679 | "engines": { 680 | "node": ">=0.10.0" 681 | } 682 | }, 683 | "node_modules/object-inspect": { 684 | "version": "1.13.4", 685 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", 686 | "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", 687 | "license": "MIT", 688 | "engines": { 689 | "node": ">= 0.4" 690 | }, 691 | "funding": { 692 | "url": "https://github.com/sponsors/ljharb" 693 | } 694 | }, 695 | "node_modules/on-finished": { 696 | "version": "2.4.1", 697 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 698 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 699 | "license": "MIT", 700 | "dependencies": { 701 | "ee-first": "1.1.1" 702 | }, 703 | "engines": { 704 | "node": ">= 0.8" 705 | } 706 | }, 707 | "node_modules/once": { 708 | "version": "1.4.0", 709 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 710 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 711 | "license": "ISC", 712 | "dependencies": { 713 | "wrappy": "1" 714 | } 715 | }, 716 | "node_modules/parseurl": { 717 | "version": "1.3.3", 718 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 719 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 720 | "license": "MIT", 721 | "engines": { 722 | "node": ">= 0.8" 723 | } 724 | }, 725 | "node_modules/path-key": { 726 | "version": "3.1.1", 727 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 728 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 729 | "license": "MIT", 730 | "engines": { 731 | "node": ">=8" 732 | } 733 | }, 734 | "node_modules/path-to-regexp": { 735 | "version": "8.2.0", 736 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", 737 | "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", 738 | "license": "MIT", 739 | "engines": { 740 | "node": ">=16" 741 | } 742 | }, 743 | "node_modules/pkce-challenge": { 744 | "version": "5.0.0", 745 | "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", 746 | "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", 747 | "license": "MIT", 748 | "engines": { 749 | "node": ">=16.20.0" 750 | } 751 | }, 752 | "node_modules/proxy-addr": { 753 | "version": "2.0.7", 754 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 755 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 756 | "license": "MIT", 757 | "dependencies": { 758 | "forwarded": "0.2.0", 759 | "ipaddr.js": "1.9.1" 760 | }, 761 | "engines": { 762 | "node": ">= 0.10" 763 | } 764 | }, 765 | "node_modules/qs": { 766 | "version": "6.14.0", 767 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", 768 | "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", 769 | "license": "BSD-3-Clause", 770 | "dependencies": { 771 | "side-channel": "^1.1.0" 772 | }, 773 | "engines": { 774 | "node": ">=0.6" 775 | }, 776 | "funding": { 777 | "url": "https://github.com/sponsors/ljharb" 778 | } 779 | }, 780 | "node_modules/range-parser": { 781 | "version": "1.2.1", 782 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 783 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 784 | "license": "MIT", 785 | "engines": { 786 | "node": ">= 0.6" 787 | } 788 | }, 789 | "node_modules/raw-body": { 790 | "version": "3.0.0", 791 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", 792 | "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", 793 | "license": "MIT", 794 | "dependencies": { 795 | "bytes": "3.1.2", 796 | "http-errors": "2.0.0", 797 | "iconv-lite": "0.6.3", 798 | "unpipe": "1.0.0" 799 | }, 800 | "engines": { 801 | "node": ">= 0.8" 802 | } 803 | }, 804 | "node_modules/require-from-string": { 805 | "version": "2.0.2", 806 | "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", 807 | "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", 808 | "license": "MIT", 809 | "engines": { 810 | "node": ">=0.10.0" 811 | } 812 | }, 813 | "node_modules/router": { 814 | "version": "2.2.0", 815 | "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", 816 | "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", 817 | "license": "MIT", 818 | "dependencies": { 819 | "debug": "^4.4.0", 820 | "depd": "^2.0.0", 821 | "is-promise": "^4.0.0", 822 | "parseurl": "^1.3.3", 823 | "path-to-regexp": "^8.0.0" 824 | }, 825 | "engines": { 826 | "node": ">= 18" 827 | } 828 | }, 829 | "node_modules/safe-buffer": { 830 | "version": "5.2.1", 831 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 832 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 833 | "funding": [ 834 | { 835 | "type": "github", 836 | "url": "https://github.com/sponsors/feross" 837 | }, 838 | { 839 | "type": "patreon", 840 | "url": "https://www.patreon.com/feross" 841 | }, 842 | { 843 | "type": "consulting", 844 | "url": "https://feross.org/support" 845 | } 846 | ], 847 | "license": "MIT" 848 | }, 849 | "node_modules/safer-buffer": { 850 | "version": "2.1.2", 851 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 852 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 853 | "license": "MIT" 854 | }, 855 | "node_modules/send": { 856 | "version": "1.2.0", 857 | "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", 858 | "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", 859 | "license": "MIT", 860 | "dependencies": { 861 | "debug": "^4.3.5", 862 | "encodeurl": "^2.0.0", 863 | "escape-html": "^1.0.3", 864 | "etag": "^1.8.1", 865 | "fresh": "^2.0.0", 866 | "http-errors": "^2.0.0", 867 | "mime-types": "^3.0.1", 868 | "ms": "^2.1.3", 869 | "on-finished": "^2.4.1", 870 | "range-parser": "^1.2.1", 871 | "statuses": "^2.0.1" 872 | }, 873 | "engines": { 874 | "node": ">= 18" 875 | } 876 | }, 877 | "node_modules/serve-static": { 878 | "version": "2.2.0", 879 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", 880 | "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", 881 | "license": "MIT", 882 | "dependencies": { 883 | "encodeurl": "^2.0.0", 884 | "escape-html": "^1.0.3", 885 | "parseurl": "^1.3.3", 886 | "send": "^1.2.0" 887 | }, 888 | "engines": { 889 | "node": ">= 18" 890 | } 891 | }, 892 | "node_modules/setprototypeof": { 893 | "version": "1.2.0", 894 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 895 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 896 | "license": "ISC" 897 | }, 898 | "node_modules/shebang-command": { 899 | "version": "2.0.0", 900 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 901 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 902 | "license": "MIT", 903 | "dependencies": { 904 | "shebang-regex": "^3.0.0" 905 | }, 906 | "engines": { 907 | "node": ">=8" 908 | } 909 | }, 910 | "node_modules/shebang-regex": { 911 | "version": "3.0.0", 912 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 913 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 914 | "license": "MIT", 915 | "engines": { 916 | "node": ">=8" 917 | } 918 | }, 919 | "node_modules/side-channel": { 920 | "version": "1.1.0", 921 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", 922 | "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", 923 | "license": "MIT", 924 | "dependencies": { 925 | "es-errors": "^1.3.0", 926 | "object-inspect": "^1.13.3", 927 | "side-channel-list": "^1.0.0", 928 | "side-channel-map": "^1.0.1", 929 | "side-channel-weakmap": "^1.0.2" 930 | }, 931 | "engines": { 932 | "node": ">= 0.4" 933 | }, 934 | "funding": { 935 | "url": "https://github.com/sponsors/ljharb" 936 | } 937 | }, 938 | "node_modules/side-channel-list": { 939 | "version": "1.0.0", 940 | "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", 941 | "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", 942 | "license": "MIT", 943 | "dependencies": { 944 | "es-errors": "^1.3.0", 945 | "object-inspect": "^1.13.3" 946 | }, 947 | "engines": { 948 | "node": ">= 0.4" 949 | }, 950 | "funding": { 951 | "url": "https://github.com/sponsors/ljharb" 952 | } 953 | }, 954 | "node_modules/side-channel-map": { 955 | "version": "1.0.1", 956 | "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", 957 | "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", 958 | "license": "MIT", 959 | "dependencies": { 960 | "call-bound": "^1.0.2", 961 | "es-errors": "^1.3.0", 962 | "get-intrinsic": "^1.2.5", 963 | "object-inspect": "^1.13.3" 964 | }, 965 | "engines": { 966 | "node": ">= 0.4" 967 | }, 968 | "funding": { 969 | "url": "https://github.com/sponsors/ljharb" 970 | } 971 | }, 972 | "node_modules/side-channel-weakmap": { 973 | "version": "1.0.2", 974 | "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", 975 | "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", 976 | "license": "MIT", 977 | "dependencies": { 978 | "call-bound": "^1.0.2", 979 | "es-errors": "^1.3.0", 980 | "get-intrinsic": "^1.2.5", 981 | "object-inspect": "^1.13.3", 982 | "side-channel-map": "^1.0.1" 983 | }, 984 | "engines": { 985 | "node": ">= 0.4" 986 | }, 987 | "funding": { 988 | "url": "https://github.com/sponsors/ljharb" 989 | } 990 | }, 991 | "node_modules/statuses": { 992 | "version": "2.0.1", 993 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 994 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 995 | "license": "MIT", 996 | "engines": { 997 | "node": ">= 0.8" 998 | } 999 | }, 1000 | "node_modules/toidentifier": { 1001 | "version": "1.0.1", 1002 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1003 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1004 | "license": "MIT", 1005 | "engines": { 1006 | "node": ">=0.6" 1007 | } 1008 | }, 1009 | "node_modules/type-is": { 1010 | "version": "2.0.1", 1011 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", 1012 | "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", 1013 | "license": "MIT", 1014 | "dependencies": { 1015 | "content-type": "^1.0.5", 1016 | "media-typer": "^1.1.0", 1017 | "mime-types": "^3.0.0" 1018 | }, 1019 | "engines": { 1020 | "node": ">= 0.6" 1021 | } 1022 | }, 1023 | "node_modules/typescript": { 1024 | "version": "5.8.3", 1025 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", 1026 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", 1027 | "dev": true, 1028 | "license": "Apache-2.0", 1029 | "bin": { 1030 | "tsc": "bin/tsc", 1031 | "tsserver": "bin/tsserver" 1032 | }, 1033 | "engines": { 1034 | "node": ">=14.17" 1035 | } 1036 | }, 1037 | "node_modules/undici-types": { 1038 | "version": "6.21.0", 1039 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", 1040 | "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", 1041 | "dev": true, 1042 | "license": "MIT" 1043 | }, 1044 | "node_modules/unpipe": { 1045 | "version": "1.0.0", 1046 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1047 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1048 | "license": "MIT", 1049 | "engines": { 1050 | "node": ">= 0.8" 1051 | } 1052 | }, 1053 | "node_modules/vary": { 1054 | "version": "1.1.2", 1055 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1056 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1057 | "license": "MIT", 1058 | "engines": { 1059 | "node": ">= 0.8" 1060 | } 1061 | }, 1062 | "node_modules/which": { 1063 | "version": "2.0.2", 1064 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1065 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1066 | "license": "ISC", 1067 | "dependencies": { 1068 | "isexe": "^2.0.0" 1069 | }, 1070 | "bin": { 1071 | "node-which": "bin/node-which" 1072 | }, 1073 | "engines": { 1074 | "node": ">= 8" 1075 | } 1076 | }, 1077 | "node_modules/wrappy": { 1078 | "version": "1.0.2", 1079 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1080 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 1081 | "license": "ISC" 1082 | }, 1083 | "node_modules/zod": { 1084 | "version": "3.25.7", 1085 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.7.tgz", 1086 | "integrity": "sha512-YGdT1cVRmKkOg6Sq7vY7IkxdphySKnXhaUmFI4r4FcuFVNgpCb9tZfNwXbT6BPjD5oz0nubFsoo9pIqKrDcCvg==", 1087 | "license": "MIT", 1088 | "funding": { 1089 | "url": "https://github.com/sponsors/colinhacks" 1090 | } 1091 | }, 1092 | "node_modules/zod-to-json-schema": { 1093 | "version": "3.24.5", 1094 | "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", 1095 | "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", 1096 | "license": "ISC", 1097 | "peerDependencies": { 1098 | "zod": "^3.24.1" 1099 | } 1100 | } 1101 | } 1102 | } 1103 | -------------------------------------------------------------------------------- /typescript-example/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcp-client", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1", 7 | "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "type": "module", 13 | "dependencies": { 14 | "@anthropic-ai/sdk": "^0.51.0", 15 | "@modelcontextprotocol/sdk": "^1.11.4", 16 | "dotenv": "^16.5.0" 17 | }, 18 | "devDependencies": { 19 | "@types/node": "^22.13.4", 20 | "typescript": "^5.7.3" 21 | }, 22 | "engines": { 23 | "node": ">=16.0.0" 24 | } 25 | } -------------------------------------------------------------------------------- /typescript-example/client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "Node16", 5 | "moduleResolution": "Node16", 6 | "outDir": "./build", 7 | "rootDir": "./", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true 12 | }, 13 | "include": ["index.ts"], 14 | "exclude": ["node_modules"] 15 | } -------------------------------------------------------------------------------- /typescript-example/server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "server", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@modelcontextprotocol/sdk": "^1.11.4", 13 | "express": "^5.1.0" 14 | }, 15 | "bin": { 16 | "create-mcp-server": "build/index.js" 17 | }, 18 | "devDependencies": { 19 | "@types/express": "^5.0.1", 20 | "@types/node": "^22.14.0", 21 | "typescript": "^5.8.3" 22 | } 23 | }, 24 | "node_modules/@modelcontextprotocol/sdk": { 25 | "version": "1.11.4", 26 | "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.4.tgz", 27 | "integrity": "sha512-OTbhe5slIjiOtLxXhKalkKGhIQrwvhgCDs/C2r8kcBTy5HR/g43aDQU0l7r8O0VGbJPTNJvDc7ZdQMdQDJXmbw==", 28 | "license": "MIT", 29 | "dependencies": { 30 | "ajv": "^8.17.1", 31 | "content-type": "^1.0.5", 32 | "cors": "^2.8.5", 33 | "cross-spawn": "^7.0.5", 34 | "eventsource": "^3.0.2", 35 | "express": "^5.0.1", 36 | "express-rate-limit": "^7.5.0", 37 | "pkce-challenge": "^5.0.0", 38 | "raw-body": "^3.0.0", 39 | "zod": "^3.23.8", 40 | "zod-to-json-schema": "^3.24.1" 41 | }, 42 | "engines": { 43 | "node": ">=18" 44 | } 45 | }, 46 | "node_modules/@types/body-parser": { 47 | "version": "1.19.5", 48 | "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", 49 | "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", 50 | "dev": true, 51 | "license": "MIT", 52 | "dependencies": { 53 | "@types/connect": "*", 54 | "@types/node": "*" 55 | } 56 | }, 57 | "node_modules/@types/connect": { 58 | "version": "3.4.38", 59 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", 60 | "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", 61 | "dev": true, 62 | "license": "MIT", 63 | "dependencies": { 64 | "@types/node": "*" 65 | } 66 | }, 67 | "node_modules/@types/express": { 68 | "version": "5.0.2", 69 | "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.2.tgz", 70 | "integrity": "sha512-BtjL3ZwbCQriyb0DGw+Rt12qAXPiBTPs815lsUvtt1Grk0vLRMZNMUZ741d5rjk+UQOxfDiBZ3dxpX00vSkK3g==", 71 | "dev": true, 72 | "license": "MIT", 73 | "dependencies": { 74 | "@types/body-parser": "*", 75 | "@types/express-serve-static-core": "^5.0.0", 76 | "@types/serve-static": "*" 77 | } 78 | }, 79 | "node_modules/@types/express-serve-static-core": { 80 | "version": "5.0.6", 81 | "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", 82 | "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", 83 | "dev": true, 84 | "license": "MIT", 85 | "dependencies": { 86 | "@types/node": "*", 87 | "@types/qs": "*", 88 | "@types/range-parser": "*", 89 | "@types/send": "*" 90 | } 91 | }, 92 | "node_modules/@types/http-errors": { 93 | "version": "2.0.4", 94 | "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", 95 | "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", 96 | "dev": true, 97 | "license": "MIT" 98 | }, 99 | "node_modules/@types/mime": { 100 | "version": "1.3.5", 101 | "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", 102 | "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", 103 | "dev": true, 104 | "license": "MIT" 105 | }, 106 | "node_modules/@types/node": { 107 | "version": "22.15.19", 108 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.19.tgz", 109 | "integrity": "sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==", 110 | "dev": true, 111 | "license": "MIT", 112 | "dependencies": { 113 | "undici-types": "~6.21.0" 114 | } 115 | }, 116 | "node_modules/@types/qs": { 117 | "version": "6.14.0", 118 | "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", 119 | "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", 120 | "dev": true, 121 | "license": "MIT" 122 | }, 123 | "node_modules/@types/range-parser": { 124 | "version": "1.2.7", 125 | "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", 126 | "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", 127 | "dev": true, 128 | "license": "MIT" 129 | }, 130 | "node_modules/@types/send": { 131 | "version": "0.17.4", 132 | "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", 133 | "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", 134 | "dev": true, 135 | "license": "MIT", 136 | "dependencies": { 137 | "@types/mime": "^1", 138 | "@types/node": "*" 139 | } 140 | }, 141 | "node_modules/@types/serve-static": { 142 | "version": "1.15.7", 143 | "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", 144 | "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", 145 | "dev": true, 146 | "license": "MIT", 147 | "dependencies": { 148 | "@types/http-errors": "*", 149 | "@types/node": "*", 150 | "@types/send": "*" 151 | } 152 | }, 153 | "node_modules/accepts": { 154 | "version": "2.0.0", 155 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", 156 | "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", 157 | "license": "MIT", 158 | "dependencies": { 159 | "mime-types": "^3.0.0", 160 | "negotiator": "^1.0.0" 161 | }, 162 | "engines": { 163 | "node": ">= 0.6" 164 | } 165 | }, 166 | "node_modules/ajv": { 167 | "version": "8.17.1", 168 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", 169 | "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", 170 | "license": "MIT", 171 | "dependencies": { 172 | "fast-deep-equal": "^3.1.3", 173 | "fast-uri": "^3.0.1", 174 | "json-schema-traverse": "^1.0.0", 175 | "require-from-string": "^2.0.2" 176 | }, 177 | "funding": { 178 | "type": "github", 179 | "url": "https://github.com/sponsors/epoberezkin" 180 | } 181 | }, 182 | "node_modules/body-parser": { 183 | "version": "2.2.0", 184 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", 185 | "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", 186 | "license": "MIT", 187 | "dependencies": { 188 | "bytes": "^3.1.2", 189 | "content-type": "^1.0.5", 190 | "debug": "^4.4.0", 191 | "http-errors": "^2.0.0", 192 | "iconv-lite": "^0.6.3", 193 | "on-finished": "^2.4.1", 194 | "qs": "^6.14.0", 195 | "raw-body": "^3.0.0", 196 | "type-is": "^2.0.0" 197 | }, 198 | "engines": { 199 | "node": ">=18" 200 | } 201 | }, 202 | "node_modules/bytes": { 203 | "version": "3.1.2", 204 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 205 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 206 | "license": "MIT", 207 | "engines": { 208 | "node": ">= 0.8" 209 | } 210 | }, 211 | "node_modules/call-bind-apply-helpers": { 212 | "version": "1.0.2", 213 | "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 214 | "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 215 | "license": "MIT", 216 | "dependencies": { 217 | "es-errors": "^1.3.0", 218 | "function-bind": "^1.1.2" 219 | }, 220 | "engines": { 221 | "node": ">= 0.4" 222 | } 223 | }, 224 | "node_modules/call-bound": { 225 | "version": "1.0.4", 226 | "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", 227 | "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", 228 | "license": "MIT", 229 | "dependencies": { 230 | "call-bind-apply-helpers": "^1.0.2", 231 | "get-intrinsic": "^1.3.0" 232 | }, 233 | "engines": { 234 | "node": ">= 0.4" 235 | }, 236 | "funding": { 237 | "url": "https://github.com/sponsors/ljharb" 238 | } 239 | }, 240 | "node_modules/content-disposition": { 241 | "version": "1.0.0", 242 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", 243 | "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", 244 | "license": "MIT", 245 | "dependencies": { 246 | "safe-buffer": "5.2.1" 247 | }, 248 | "engines": { 249 | "node": ">= 0.6" 250 | } 251 | }, 252 | "node_modules/content-type": { 253 | "version": "1.0.5", 254 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 255 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 256 | "license": "MIT", 257 | "engines": { 258 | "node": ">= 0.6" 259 | } 260 | }, 261 | "node_modules/cookie": { 262 | "version": "0.7.2", 263 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 264 | "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 265 | "license": "MIT", 266 | "engines": { 267 | "node": ">= 0.6" 268 | } 269 | }, 270 | "node_modules/cookie-signature": { 271 | "version": "1.2.2", 272 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", 273 | "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", 274 | "license": "MIT", 275 | "engines": { 276 | "node": ">=6.6.0" 277 | } 278 | }, 279 | "node_modules/cors": { 280 | "version": "2.8.5", 281 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 282 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 283 | "license": "MIT", 284 | "dependencies": { 285 | "object-assign": "^4", 286 | "vary": "^1" 287 | }, 288 | "engines": { 289 | "node": ">= 0.10" 290 | } 291 | }, 292 | "node_modules/cross-spawn": { 293 | "version": "7.0.6", 294 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 295 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 296 | "license": "MIT", 297 | "dependencies": { 298 | "path-key": "^3.1.0", 299 | "shebang-command": "^2.0.0", 300 | "which": "^2.0.1" 301 | }, 302 | "engines": { 303 | "node": ">= 8" 304 | } 305 | }, 306 | "node_modules/debug": { 307 | "version": "4.4.1", 308 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", 309 | "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", 310 | "license": "MIT", 311 | "dependencies": { 312 | "ms": "^2.1.3" 313 | }, 314 | "engines": { 315 | "node": ">=6.0" 316 | }, 317 | "peerDependenciesMeta": { 318 | "supports-color": { 319 | "optional": true 320 | } 321 | } 322 | }, 323 | "node_modules/depd": { 324 | "version": "2.0.0", 325 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 326 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 327 | "license": "MIT", 328 | "engines": { 329 | "node": ">= 0.8" 330 | } 331 | }, 332 | "node_modules/dunder-proto": { 333 | "version": "1.0.1", 334 | "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 335 | "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 336 | "license": "MIT", 337 | "dependencies": { 338 | "call-bind-apply-helpers": "^1.0.1", 339 | "es-errors": "^1.3.0", 340 | "gopd": "^1.2.0" 341 | }, 342 | "engines": { 343 | "node": ">= 0.4" 344 | } 345 | }, 346 | "node_modules/ee-first": { 347 | "version": "1.1.1", 348 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 349 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", 350 | "license": "MIT" 351 | }, 352 | "node_modules/encodeurl": { 353 | "version": "2.0.0", 354 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", 355 | "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", 356 | "license": "MIT", 357 | "engines": { 358 | "node": ">= 0.8" 359 | } 360 | }, 361 | "node_modules/es-define-property": { 362 | "version": "1.0.1", 363 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 364 | "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", 365 | "license": "MIT", 366 | "engines": { 367 | "node": ">= 0.4" 368 | } 369 | }, 370 | "node_modules/es-errors": { 371 | "version": "1.3.0", 372 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 373 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 374 | "license": "MIT", 375 | "engines": { 376 | "node": ">= 0.4" 377 | } 378 | }, 379 | "node_modules/es-object-atoms": { 380 | "version": "1.1.1", 381 | "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 382 | "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 383 | "license": "MIT", 384 | "dependencies": { 385 | "es-errors": "^1.3.0" 386 | }, 387 | "engines": { 388 | "node": ">= 0.4" 389 | } 390 | }, 391 | "node_modules/escape-html": { 392 | "version": "1.0.3", 393 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 394 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", 395 | "license": "MIT" 396 | }, 397 | "node_modules/etag": { 398 | "version": "1.8.1", 399 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 400 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 401 | "license": "MIT", 402 | "engines": { 403 | "node": ">= 0.6" 404 | } 405 | }, 406 | "node_modules/eventsource": { 407 | "version": "3.0.7", 408 | "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", 409 | "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", 410 | "license": "MIT", 411 | "dependencies": { 412 | "eventsource-parser": "^3.0.1" 413 | }, 414 | "engines": { 415 | "node": ">=18.0.0" 416 | } 417 | }, 418 | "node_modules/eventsource-parser": { 419 | "version": "3.0.2", 420 | "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.2.tgz", 421 | "integrity": "sha512-6RxOBZ/cYgd8usLwsEl+EC09Au/9BcmCKYF2/xbml6DNczf7nv0MQb+7BA2F+li6//I+28VNlQR37XfQtcAJuA==", 422 | "license": "MIT", 423 | "engines": { 424 | "node": ">=18.0.0" 425 | } 426 | }, 427 | "node_modules/express": { 428 | "version": "5.1.0", 429 | "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", 430 | "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", 431 | "license": "MIT", 432 | "dependencies": { 433 | "accepts": "^2.0.0", 434 | "body-parser": "^2.2.0", 435 | "content-disposition": "^1.0.0", 436 | "content-type": "^1.0.5", 437 | "cookie": "^0.7.1", 438 | "cookie-signature": "^1.2.1", 439 | "debug": "^4.4.0", 440 | "encodeurl": "^2.0.0", 441 | "escape-html": "^1.0.3", 442 | "etag": "^1.8.1", 443 | "finalhandler": "^2.1.0", 444 | "fresh": "^2.0.0", 445 | "http-errors": "^2.0.0", 446 | "merge-descriptors": "^2.0.0", 447 | "mime-types": "^3.0.0", 448 | "on-finished": "^2.4.1", 449 | "once": "^1.4.0", 450 | "parseurl": "^1.3.3", 451 | "proxy-addr": "^2.0.7", 452 | "qs": "^6.14.0", 453 | "range-parser": "^1.2.1", 454 | "router": "^2.2.0", 455 | "send": "^1.1.0", 456 | "serve-static": "^2.2.0", 457 | "statuses": "^2.0.1", 458 | "type-is": "^2.0.1", 459 | "vary": "^1.1.2" 460 | }, 461 | "engines": { 462 | "node": ">= 18" 463 | }, 464 | "funding": { 465 | "type": "opencollective", 466 | "url": "https://opencollective.com/express" 467 | } 468 | }, 469 | "node_modules/express-rate-limit": { 470 | "version": "7.5.0", 471 | "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", 472 | "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", 473 | "license": "MIT", 474 | "engines": { 475 | "node": ">= 16" 476 | }, 477 | "funding": { 478 | "url": "https://github.com/sponsors/express-rate-limit" 479 | }, 480 | "peerDependencies": { 481 | "express": "^4.11 || 5 || ^5.0.0-beta.1" 482 | } 483 | }, 484 | "node_modules/fast-deep-equal": { 485 | "version": "3.1.3", 486 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 487 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 488 | "license": "MIT" 489 | }, 490 | "node_modules/fast-uri": { 491 | "version": "3.0.6", 492 | "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", 493 | "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", 494 | "funding": [ 495 | { 496 | "type": "github", 497 | "url": "https://github.com/sponsors/fastify" 498 | }, 499 | { 500 | "type": "opencollective", 501 | "url": "https://opencollective.com/fastify" 502 | } 503 | ], 504 | "license": "BSD-3-Clause" 505 | }, 506 | "node_modules/finalhandler": { 507 | "version": "2.1.0", 508 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", 509 | "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", 510 | "license": "MIT", 511 | "dependencies": { 512 | "debug": "^4.4.0", 513 | "encodeurl": "^2.0.0", 514 | "escape-html": "^1.0.3", 515 | "on-finished": "^2.4.1", 516 | "parseurl": "^1.3.3", 517 | "statuses": "^2.0.1" 518 | }, 519 | "engines": { 520 | "node": ">= 0.8" 521 | } 522 | }, 523 | "node_modules/forwarded": { 524 | "version": "0.2.0", 525 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 526 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 527 | "license": "MIT", 528 | "engines": { 529 | "node": ">= 0.6" 530 | } 531 | }, 532 | "node_modules/fresh": { 533 | "version": "2.0.0", 534 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", 535 | "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", 536 | "license": "MIT", 537 | "engines": { 538 | "node": ">= 0.8" 539 | } 540 | }, 541 | "node_modules/function-bind": { 542 | "version": "1.1.2", 543 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 544 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 545 | "license": "MIT", 546 | "funding": { 547 | "url": "https://github.com/sponsors/ljharb" 548 | } 549 | }, 550 | "node_modules/get-intrinsic": { 551 | "version": "1.3.0", 552 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 553 | "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 554 | "license": "MIT", 555 | "dependencies": { 556 | "call-bind-apply-helpers": "^1.0.2", 557 | "es-define-property": "^1.0.1", 558 | "es-errors": "^1.3.0", 559 | "es-object-atoms": "^1.1.1", 560 | "function-bind": "^1.1.2", 561 | "get-proto": "^1.0.1", 562 | "gopd": "^1.2.0", 563 | "has-symbols": "^1.1.0", 564 | "hasown": "^2.0.2", 565 | "math-intrinsics": "^1.1.0" 566 | }, 567 | "engines": { 568 | "node": ">= 0.4" 569 | }, 570 | "funding": { 571 | "url": "https://github.com/sponsors/ljharb" 572 | } 573 | }, 574 | "node_modules/get-proto": { 575 | "version": "1.0.1", 576 | "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 577 | "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 578 | "license": "MIT", 579 | "dependencies": { 580 | "dunder-proto": "^1.0.1", 581 | "es-object-atoms": "^1.0.0" 582 | }, 583 | "engines": { 584 | "node": ">= 0.4" 585 | } 586 | }, 587 | "node_modules/gopd": { 588 | "version": "1.2.0", 589 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 590 | "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", 591 | "license": "MIT", 592 | "engines": { 593 | "node": ">= 0.4" 594 | }, 595 | "funding": { 596 | "url": "https://github.com/sponsors/ljharb" 597 | } 598 | }, 599 | "node_modules/has-symbols": { 600 | "version": "1.1.0", 601 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 602 | "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", 603 | "license": "MIT", 604 | "engines": { 605 | "node": ">= 0.4" 606 | }, 607 | "funding": { 608 | "url": "https://github.com/sponsors/ljharb" 609 | } 610 | }, 611 | "node_modules/hasown": { 612 | "version": "2.0.2", 613 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 614 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 615 | "license": "MIT", 616 | "dependencies": { 617 | "function-bind": "^1.1.2" 618 | }, 619 | "engines": { 620 | "node": ">= 0.4" 621 | } 622 | }, 623 | "node_modules/http-errors": { 624 | "version": "2.0.0", 625 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 626 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 627 | "license": "MIT", 628 | "dependencies": { 629 | "depd": "2.0.0", 630 | "inherits": "2.0.4", 631 | "setprototypeof": "1.2.0", 632 | "statuses": "2.0.1", 633 | "toidentifier": "1.0.1" 634 | }, 635 | "engines": { 636 | "node": ">= 0.8" 637 | } 638 | }, 639 | "node_modules/iconv-lite": { 640 | "version": "0.6.3", 641 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 642 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 643 | "license": "MIT", 644 | "dependencies": { 645 | "safer-buffer": ">= 2.1.2 < 3.0.0" 646 | }, 647 | "engines": { 648 | "node": ">=0.10.0" 649 | } 650 | }, 651 | "node_modules/inherits": { 652 | "version": "2.0.4", 653 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 654 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 655 | "license": "ISC" 656 | }, 657 | "node_modules/ipaddr.js": { 658 | "version": "1.9.1", 659 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 660 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 661 | "license": "MIT", 662 | "engines": { 663 | "node": ">= 0.10" 664 | } 665 | }, 666 | "node_modules/is-promise": { 667 | "version": "4.0.0", 668 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", 669 | "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", 670 | "license": "MIT" 671 | }, 672 | "node_modules/isexe": { 673 | "version": "2.0.0", 674 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 675 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 676 | "license": "ISC" 677 | }, 678 | "node_modules/json-schema-traverse": { 679 | "version": "1.0.0", 680 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", 681 | "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", 682 | "license": "MIT" 683 | }, 684 | "node_modules/math-intrinsics": { 685 | "version": "1.1.0", 686 | "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 687 | "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", 688 | "license": "MIT", 689 | "engines": { 690 | "node": ">= 0.4" 691 | } 692 | }, 693 | "node_modules/media-typer": { 694 | "version": "1.1.0", 695 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", 696 | "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", 697 | "license": "MIT", 698 | "engines": { 699 | "node": ">= 0.8" 700 | } 701 | }, 702 | "node_modules/merge-descriptors": { 703 | "version": "2.0.0", 704 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", 705 | "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", 706 | "license": "MIT", 707 | "engines": { 708 | "node": ">=18" 709 | }, 710 | "funding": { 711 | "url": "https://github.com/sponsors/sindresorhus" 712 | } 713 | }, 714 | "node_modules/mime-db": { 715 | "version": "1.54.0", 716 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", 717 | "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", 718 | "license": "MIT", 719 | "engines": { 720 | "node": ">= 0.6" 721 | } 722 | }, 723 | "node_modules/mime-types": { 724 | "version": "3.0.1", 725 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", 726 | "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", 727 | "license": "MIT", 728 | "dependencies": { 729 | "mime-db": "^1.54.0" 730 | }, 731 | "engines": { 732 | "node": ">= 0.6" 733 | } 734 | }, 735 | "node_modules/ms": { 736 | "version": "2.1.3", 737 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 738 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 739 | "license": "MIT" 740 | }, 741 | "node_modules/negotiator": { 742 | "version": "1.0.0", 743 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", 744 | "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", 745 | "license": "MIT", 746 | "engines": { 747 | "node": ">= 0.6" 748 | } 749 | }, 750 | "node_modules/object-assign": { 751 | "version": "4.1.1", 752 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 753 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 754 | "license": "MIT", 755 | "engines": { 756 | "node": ">=0.10.0" 757 | } 758 | }, 759 | "node_modules/object-inspect": { 760 | "version": "1.13.4", 761 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", 762 | "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", 763 | "license": "MIT", 764 | "engines": { 765 | "node": ">= 0.4" 766 | }, 767 | "funding": { 768 | "url": "https://github.com/sponsors/ljharb" 769 | } 770 | }, 771 | "node_modules/on-finished": { 772 | "version": "2.4.1", 773 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 774 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 775 | "license": "MIT", 776 | "dependencies": { 777 | "ee-first": "1.1.1" 778 | }, 779 | "engines": { 780 | "node": ">= 0.8" 781 | } 782 | }, 783 | "node_modules/once": { 784 | "version": "1.4.0", 785 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 786 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 787 | "license": "ISC", 788 | "dependencies": { 789 | "wrappy": "1" 790 | } 791 | }, 792 | "node_modules/parseurl": { 793 | "version": "1.3.3", 794 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 795 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 796 | "license": "MIT", 797 | "engines": { 798 | "node": ">= 0.8" 799 | } 800 | }, 801 | "node_modules/path-key": { 802 | "version": "3.1.1", 803 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 804 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 805 | "license": "MIT", 806 | "engines": { 807 | "node": ">=8" 808 | } 809 | }, 810 | "node_modules/path-to-regexp": { 811 | "version": "8.2.0", 812 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", 813 | "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", 814 | "license": "MIT", 815 | "engines": { 816 | "node": ">=16" 817 | } 818 | }, 819 | "node_modules/pkce-challenge": { 820 | "version": "5.0.0", 821 | "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", 822 | "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", 823 | "license": "MIT", 824 | "engines": { 825 | "node": ">=16.20.0" 826 | } 827 | }, 828 | "node_modules/proxy-addr": { 829 | "version": "2.0.7", 830 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 831 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 832 | "license": "MIT", 833 | "dependencies": { 834 | "forwarded": "0.2.0", 835 | "ipaddr.js": "1.9.1" 836 | }, 837 | "engines": { 838 | "node": ">= 0.10" 839 | } 840 | }, 841 | "node_modules/qs": { 842 | "version": "6.14.0", 843 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", 844 | "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", 845 | "license": "BSD-3-Clause", 846 | "dependencies": { 847 | "side-channel": "^1.1.0" 848 | }, 849 | "engines": { 850 | "node": ">=0.6" 851 | }, 852 | "funding": { 853 | "url": "https://github.com/sponsors/ljharb" 854 | } 855 | }, 856 | "node_modules/range-parser": { 857 | "version": "1.2.1", 858 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 859 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 860 | "license": "MIT", 861 | "engines": { 862 | "node": ">= 0.6" 863 | } 864 | }, 865 | "node_modules/raw-body": { 866 | "version": "3.0.0", 867 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", 868 | "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", 869 | "license": "MIT", 870 | "dependencies": { 871 | "bytes": "3.1.2", 872 | "http-errors": "2.0.0", 873 | "iconv-lite": "0.6.3", 874 | "unpipe": "1.0.0" 875 | }, 876 | "engines": { 877 | "node": ">= 0.8" 878 | } 879 | }, 880 | "node_modules/require-from-string": { 881 | "version": "2.0.2", 882 | "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", 883 | "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", 884 | "license": "MIT", 885 | "engines": { 886 | "node": ">=0.10.0" 887 | } 888 | }, 889 | "node_modules/router": { 890 | "version": "2.2.0", 891 | "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", 892 | "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", 893 | "license": "MIT", 894 | "dependencies": { 895 | "debug": "^4.4.0", 896 | "depd": "^2.0.0", 897 | "is-promise": "^4.0.0", 898 | "parseurl": "^1.3.3", 899 | "path-to-regexp": "^8.0.0" 900 | }, 901 | "engines": { 902 | "node": ">= 18" 903 | } 904 | }, 905 | "node_modules/safe-buffer": { 906 | "version": "5.2.1", 907 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 908 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 909 | "funding": [ 910 | { 911 | "type": "github", 912 | "url": "https://github.com/sponsors/feross" 913 | }, 914 | { 915 | "type": "patreon", 916 | "url": "https://www.patreon.com/feross" 917 | }, 918 | { 919 | "type": "consulting", 920 | "url": "https://feross.org/support" 921 | } 922 | ], 923 | "license": "MIT" 924 | }, 925 | "node_modules/safer-buffer": { 926 | "version": "2.1.2", 927 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 928 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 929 | "license": "MIT" 930 | }, 931 | "node_modules/send": { 932 | "version": "1.2.0", 933 | "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", 934 | "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", 935 | "license": "MIT", 936 | "dependencies": { 937 | "debug": "^4.3.5", 938 | "encodeurl": "^2.0.0", 939 | "escape-html": "^1.0.3", 940 | "etag": "^1.8.1", 941 | "fresh": "^2.0.0", 942 | "http-errors": "^2.0.0", 943 | "mime-types": "^3.0.1", 944 | "ms": "^2.1.3", 945 | "on-finished": "^2.4.1", 946 | "range-parser": "^1.2.1", 947 | "statuses": "^2.0.1" 948 | }, 949 | "engines": { 950 | "node": ">= 18" 951 | } 952 | }, 953 | "node_modules/serve-static": { 954 | "version": "2.2.0", 955 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", 956 | "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", 957 | "license": "MIT", 958 | "dependencies": { 959 | "encodeurl": "^2.0.0", 960 | "escape-html": "^1.0.3", 961 | "parseurl": "^1.3.3", 962 | "send": "^1.2.0" 963 | }, 964 | "engines": { 965 | "node": ">= 18" 966 | } 967 | }, 968 | "node_modules/setprototypeof": { 969 | "version": "1.2.0", 970 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 971 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 972 | "license": "ISC" 973 | }, 974 | "node_modules/shebang-command": { 975 | "version": "2.0.0", 976 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 977 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 978 | "license": "MIT", 979 | "dependencies": { 980 | "shebang-regex": "^3.0.0" 981 | }, 982 | "engines": { 983 | "node": ">=8" 984 | } 985 | }, 986 | "node_modules/shebang-regex": { 987 | "version": "3.0.0", 988 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 989 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 990 | "license": "MIT", 991 | "engines": { 992 | "node": ">=8" 993 | } 994 | }, 995 | "node_modules/side-channel": { 996 | "version": "1.1.0", 997 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", 998 | "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", 999 | "license": "MIT", 1000 | "dependencies": { 1001 | "es-errors": "^1.3.0", 1002 | "object-inspect": "^1.13.3", 1003 | "side-channel-list": "^1.0.0", 1004 | "side-channel-map": "^1.0.1", 1005 | "side-channel-weakmap": "^1.0.2" 1006 | }, 1007 | "engines": { 1008 | "node": ">= 0.4" 1009 | }, 1010 | "funding": { 1011 | "url": "https://github.com/sponsors/ljharb" 1012 | } 1013 | }, 1014 | "node_modules/side-channel-list": { 1015 | "version": "1.0.0", 1016 | "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", 1017 | "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", 1018 | "license": "MIT", 1019 | "dependencies": { 1020 | "es-errors": "^1.3.0", 1021 | "object-inspect": "^1.13.3" 1022 | }, 1023 | "engines": { 1024 | "node": ">= 0.4" 1025 | }, 1026 | "funding": { 1027 | "url": "https://github.com/sponsors/ljharb" 1028 | } 1029 | }, 1030 | "node_modules/side-channel-map": { 1031 | "version": "1.0.1", 1032 | "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", 1033 | "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", 1034 | "license": "MIT", 1035 | "dependencies": { 1036 | "call-bound": "^1.0.2", 1037 | "es-errors": "^1.3.0", 1038 | "get-intrinsic": "^1.2.5", 1039 | "object-inspect": "^1.13.3" 1040 | }, 1041 | "engines": { 1042 | "node": ">= 0.4" 1043 | }, 1044 | "funding": { 1045 | "url": "https://github.com/sponsors/ljharb" 1046 | } 1047 | }, 1048 | "node_modules/side-channel-weakmap": { 1049 | "version": "1.0.2", 1050 | "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", 1051 | "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", 1052 | "license": "MIT", 1053 | "dependencies": { 1054 | "call-bound": "^1.0.2", 1055 | "es-errors": "^1.3.0", 1056 | "get-intrinsic": "^1.2.5", 1057 | "object-inspect": "^1.13.3", 1058 | "side-channel-map": "^1.0.1" 1059 | }, 1060 | "engines": { 1061 | "node": ">= 0.4" 1062 | }, 1063 | "funding": { 1064 | "url": "https://github.com/sponsors/ljharb" 1065 | } 1066 | }, 1067 | "node_modules/statuses": { 1068 | "version": "2.0.1", 1069 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1070 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1071 | "license": "MIT", 1072 | "engines": { 1073 | "node": ">= 0.8" 1074 | } 1075 | }, 1076 | "node_modules/toidentifier": { 1077 | "version": "1.0.1", 1078 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1079 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1080 | "license": "MIT", 1081 | "engines": { 1082 | "node": ">=0.6" 1083 | } 1084 | }, 1085 | "node_modules/type-is": { 1086 | "version": "2.0.1", 1087 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", 1088 | "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", 1089 | "license": "MIT", 1090 | "dependencies": { 1091 | "content-type": "^1.0.5", 1092 | "media-typer": "^1.1.0", 1093 | "mime-types": "^3.0.0" 1094 | }, 1095 | "engines": { 1096 | "node": ">= 0.6" 1097 | } 1098 | }, 1099 | "node_modules/typescript": { 1100 | "version": "5.8.3", 1101 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", 1102 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", 1103 | "dev": true, 1104 | "license": "Apache-2.0", 1105 | "bin": { 1106 | "tsc": "bin/tsc", 1107 | "tsserver": "bin/tsserver" 1108 | }, 1109 | "engines": { 1110 | "node": ">=14.17" 1111 | } 1112 | }, 1113 | "node_modules/undici-types": { 1114 | "version": "6.21.0", 1115 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", 1116 | "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", 1117 | "dev": true, 1118 | "license": "MIT" 1119 | }, 1120 | "node_modules/unpipe": { 1121 | "version": "1.0.0", 1122 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1123 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1124 | "license": "MIT", 1125 | "engines": { 1126 | "node": ">= 0.8" 1127 | } 1128 | }, 1129 | "node_modules/vary": { 1130 | "version": "1.1.2", 1131 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1132 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1133 | "license": "MIT", 1134 | "engines": { 1135 | "node": ">= 0.8" 1136 | } 1137 | }, 1138 | "node_modules/which": { 1139 | "version": "2.0.2", 1140 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 1141 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 1142 | "license": "ISC", 1143 | "dependencies": { 1144 | "isexe": "^2.0.0" 1145 | }, 1146 | "bin": { 1147 | "node-which": "bin/node-which" 1148 | }, 1149 | "engines": { 1150 | "node": ">= 8" 1151 | } 1152 | }, 1153 | "node_modules/wrappy": { 1154 | "version": "1.0.2", 1155 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1156 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 1157 | "license": "ISC" 1158 | }, 1159 | "node_modules/zod": { 1160 | "version": "3.25.7", 1161 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.7.tgz", 1162 | "integrity": "sha512-YGdT1cVRmKkOg6Sq7vY7IkxdphySKnXhaUmFI4r4FcuFVNgpCb9tZfNwXbT6BPjD5oz0nubFsoo9pIqKrDcCvg==", 1163 | "license": "MIT", 1164 | "funding": { 1165 | "url": "https://github.com/sponsors/colinhacks" 1166 | } 1167 | }, 1168 | "node_modules/zod-to-json-schema": { 1169 | "version": "3.24.5", 1170 | "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", 1171 | "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", 1172 | "license": "ISC", 1173 | "peerDependencies": { 1174 | "zod": "^3.24.1" 1175 | } 1176 | } 1177 | } 1178 | } 1179 | -------------------------------------------------------------------------------- /typescript-example/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "type": "module", 7 | "bin": { 8 | "create-mcp-server": "./build/index.js" 9 | }, 10 | "scripts": { 11 | "build": "tsc && chmod 755 build/index.js" 12 | }, 13 | "files": [ 14 | "build" 15 | ], 16 | "license": "ISC", 17 | "dependencies": { 18 | "@modelcontextprotocol/sdk": "^1.11.4", 19 | "express": "^5.1.0" 20 | }, 21 | "devDependencies": { 22 | "@types/express": "^5.0.1", 23 | "@types/node": "^22.14.0", 24 | "typescript": "^5.8.3" 25 | } 26 | } -------------------------------------------------------------------------------- /typescript-example/server/src/index.ts: -------------------------------------------------------------------------------- 1 | import express, { Request, Response } from "express"; 2 | import { Server } from "@modelcontextprotocol/sdk/server/index.js"; 3 | import { MCPServer } from "./server.js"; 4 | 5 | // Default port 6 | let PORT = 8123; 7 | 8 | // Parse command-line arguments for --port=XXXX 9 | for (let i = 2; i < process.argv.length; i++) { 10 | const arg = process.argv[i]; 11 | if (arg.startsWith("--port=")) { 12 | const value = parseInt(arg.split("=")[1], 10); 13 | if (!isNaN(value)) { 14 | PORT = value; 15 | } else { 16 | console.error("Invalid value for --port"); 17 | process.exit(1); 18 | } 19 | } 20 | } 21 | 22 | const server = new MCPServer( 23 | new Server( 24 | { 25 | name: "mcp-server", 26 | version: "1.0.0", 27 | }, 28 | { 29 | capabilities: { 30 | tools: {}, 31 | logging: {}, 32 | }, 33 | } 34 | ) 35 | ); 36 | 37 | const app = express(); 38 | app.use(express.json()); 39 | 40 | const router = express.Router(); 41 | 42 | // single endpoint for the client to send messages to 43 | const MCP_ENDPOINT = "/mcp"; 44 | 45 | router.post(MCP_ENDPOINT, async (req: Request, res: Response) => { 46 | await server.handlePostRequest(req, res); 47 | }); 48 | 49 | router.get(MCP_ENDPOINT, async (req: Request, res: Response) => { 50 | await server.handleGetRequest(req, res); 51 | }); 52 | 53 | app.use("/", router); 54 | 55 | app.listen(PORT, () => { 56 | console.log(`MCP Streamable HTTP Server listening on port ${PORT}`); 57 | }); 58 | 59 | process.on("SIGINT", async () => { 60 | console.log("Shutting down server..."); 61 | await server.cleanup(); 62 | process.exit(0); 63 | }); 64 | -------------------------------------------------------------------------------- /typescript-example/server/src/server.ts: -------------------------------------------------------------------------------- 1 | import { Server } from "@modelcontextprotocol/sdk/server/index.js"; 2 | import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; 3 | import { 4 | Notification, 5 | CallToolRequestSchema, 6 | ListToolsRequestSchema, 7 | LoggingMessageNotification, 8 | ToolListChangedNotification, 9 | JSONRPCNotification, 10 | JSONRPCError, 11 | InitializeRequestSchema, 12 | } from "@modelcontextprotocol/sdk/types.js"; 13 | import { randomUUID } from "crypto"; 14 | import { Request, Response } from "express"; 15 | 16 | const SESSION_ID_HEADER_NAME = "mcp-session-id"; 17 | const JSON_RPC = "2.0"; 18 | const NWS_API_BASE = "https://api.weather.gov"; 19 | const USER_AGENT = "weather-app/1.0"; 20 | 21 | // Helper function for making NWS API requests 22 | async function makeNWSRequest(url: string): Promise { 23 | const headers = { 24 | "User-Agent": USER_AGENT, 25 | Accept: "application/geo+json", 26 | }; 27 | 28 | try { 29 | const response = await fetch(url, { headers }); 30 | if (!response.ok) { 31 | throw new Error(`HTTP error! status: ${response.status}`); 32 | } 33 | return (await response.json()) as T; 34 | } catch (error) { 35 | console.error("Error making NWS request:", error); 36 | return null; 37 | } 38 | } 39 | 40 | interface AlertFeature { 41 | properties: { 42 | event?: string; 43 | areaDesc?: string; 44 | severity?: string; 45 | status?: string; 46 | headline?: string; 47 | }; 48 | } 49 | 50 | // Format alert data 51 | function formatAlert(feature: AlertFeature): string { 52 | const props = feature.properties; 53 | return [ 54 | `Event: ${props.event || "Unknown"}`, 55 | `Area: ${props.areaDesc || "Unknown"}`, 56 | `Severity: ${props.severity || "Unknown"}`, 57 | `Status: ${props.status || "Unknown"}`, 58 | `Headline: ${props.headline || "No headline"}`, 59 | "---", 60 | ].join("\n"); 61 | } 62 | 63 | interface ForecastPeriod { 64 | name?: string; 65 | temperature?: number; 66 | temperatureUnit?: string; 67 | windSpeed?: string; 68 | windDirection?: string; 69 | shortForecast?: string; 70 | } 71 | 72 | interface AlertsResponse { 73 | features: AlertFeature[]; 74 | } 75 | 76 | interface PointsResponse { 77 | properties: { 78 | forecast?: string; 79 | }; 80 | } 81 | 82 | interface ForecastResponse { 83 | properties: { 84 | periods: ForecastPeriod[]; 85 | }; 86 | } 87 | 88 | export class MCPServer { 89 | server: Server; 90 | 91 | // to support multiple simultaneous connections 92 | transports: { [sessionId: string]: StreamableHTTPServerTransport } = {}; 93 | 94 | private toolInterval: NodeJS.Timeout | undefined; 95 | private getAlertsToolName = "get-alerts"; 96 | private getForecastToolName = "get-forecast"; 97 | 98 | constructor(server: Server) { 99 | this.server = server; 100 | this.setupTools(); 101 | } 102 | 103 | async handleGetRequest(req: Request, res: Response) { 104 | // if server does not offer an SSE stream at this endpoint. 105 | // res.status(405).set('Allow', 'POST').send('Method Not Allowed') 106 | 107 | const sessionId = req.headers["mcp-session-id"] as string | undefined; 108 | if (!sessionId || !this.transports[sessionId]) { 109 | res 110 | .status(400) 111 | .json( 112 | this.createErrorResponse("Bad Request: invalid session ID or method.") 113 | ); 114 | return; 115 | } 116 | 117 | console.log(`Establishing SSE stream for session ${sessionId}`); 118 | const transport = this.transports[sessionId]; 119 | await transport.handleRequest(req, res); 120 | await this.streamMessages(transport); 121 | 122 | return; 123 | } 124 | 125 | async handlePostRequest(req: Request, res: Response) { 126 | const sessionId = req.headers[SESSION_ID_HEADER_NAME] as string | undefined; 127 | let transport: StreamableHTTPServerTransport; 128 | 129 | try { 130 | // reuse existing transport 131 | if (sessionId && this.transports[sessionId]) { 132 | transport = this.transports[sessionId]; 133 | await transport.handleRequest(req, res, req.body); 134 | return; 135 | } 136 | 137 | // create new transport 138 | if (!sessionId && this.isInitializeRequest(req.body)) { 139 | const transport = new StreamableHTTPServerTransport({ 140 | sessionIdGenerator: () => randomUUID(), 141 | }); 142 | 143 | await this.server.connect(transport); 144 | await transport.handleRequest(req, res, req.body); 145 | 146 | // session ID will only be available (if in not Stateless-Mode) 147 | // after handling the first request 148 | const sessionId = transport.sessionId; 149 | if (sessionId) { 150 | this.transports[sessionId] = transport; 151 | } 152 | 153 | return; 154 | } 155 | 156 | res 157 | .status(400) 158 | .json( 159 | this.createErrorResponse("Bad Request: invalid session ID or method.") 160 | ); 161 | return; 162 | } catch (error) { 163 | console.error("Error handling MCP request:", error); 164 | res.status(500).json(this.createErrorResponse("Internal server error.")); 165 | return; 166 | } 167 | } 168 | 169 | async cleanup() { 170 | this.toolInterval?.close(); 171 | await this.server.close(); 172 | } 173 | 174 | private setupTools() { 175 | // Define available tools 176 | const setToolSchema = () => 177 | this.server.setRequestHandler(ListToolsRequestSchema, async () => { 178 | const getAlertsTool = { 179 | name: this.getAlertsToolName, 180 | description: "Get weather alerts for a state", 181 | inputSchema: { 182 | type: "object", 183 | properties: { 184 | state: { 185 | type: "string", 186 | description: "Two-letter state code (e.g. CA, NY)", 187 | }, 188 | }, 189 | required: ["state"], 190 | }, 191 | }; 192 | 193 | const getForecastTool = { 194 | name: this.getForecastToolName, 195 | description: "Get weather forecast for a location", 196 | inputSchema: { 197 | type: "object", 198 | properties: { 199 | latitude: { 200 | type: "number", 201 | description: "Latitude of the location", 202 | }, 203 | longitude: { 204 | type: "number", 205 | description: "Longitude of the location", 206 | }, 207 | }, 208 | required: ["latitude", "longitude"], 209 | }, 210 | }; 211 | 212 | return { 213 | tools: [getAlertsTool, getForecastTool], 214 | }; 215 | }); 216 | 217 | setToolSchema(); 218 | 219 | // set tools dynamically, changing 5 second 220 | this.toolInterval = setInterval(async () => { 221 | setToolSchema(); 222 | // to notify client that the tool changed 223 | Object.values(this.transports).forEach((transport) => { 224 | const notification: ToolListChangedNotification = { 225 | method: "notifications/tools/list_changed", 226 | }; 227 | this.sendNotification(transport, notification); 228 | }); 229 | }, 5000); 230 | 231 | // handle tool calls 232 | this.server.setRequestHandler( 233 | CallToolRequestSchema, 234 | async (request, extra) => { 235 | const args = request.params.arguments; 236 | const toolName = request.params.name; 237 | console.log("Received request for tool with argument:", toolName, args); 238 | 239 | if (!args) { 240 | throw new Error("arguments undefined"); 241 | } 242 | 243 | if (!toolName) { 244 | throw new Error("tool name undefined"); 245 | } 246 | 247 | if (toolName === this.getAlertsToolName) { 248 | const state = args.state as string; 249 | const stateCode = state.toUpperCase(); 250 | const alertsUrl = `${NWS_API_BASE}/alerts?area=${stateCode}`; 251 | const alertsData = await makeNWSRequest(alertsUrl); 252 | 253 | if (!alertsData) { 254 | return { 255 | content: [ 256 | { 257 | type: "text", 258 | text: "Failed to retrieve alerts data", 259 | }, 260 | ], 261 | }; 262 | } 263 | 264 | const features = alertsData.features || []; 265 | if (features.length === 0) { 266 | return { 267 | content: [ 268 | { 269 | type: "text", 270 | text: `No active alerts for ${stateCode}`, 271 | }, 272 | ], 273 | }; 274 | } 275 | 276 | const formattedAlerts = features.map(formatAlert); 277 | const alertsText = `Active alerts for ${stateCode}:\n\n${formattedAlerts.join( 278 | "\n" 279 | )}`; 280 | 281 | return { 282 | content: [ 283 | { 284 | type: "text", 285 | text: alertsText, 286 | }, 287 | ], 288 | }; 289 | } 290 | 291 | if (toolName === this.getForecastToolName) { 292 | const latitude = args.latitude as number; 293 | const longitude = args.longitude as number; 294 | // Get grid point data 295 | const pointsUrl = `${NWS_API_BASE}/points/${latitude.toFixed( 296 | 4 297 | )},${longitude.toFixed(4)}`; 298 | const pointsData = await makeNWSRequest(pointsUrl); 299 | 300 | if (!pointsData) { 301 | return { 302 | content: [ 303 | { 304 | type: "text", 305 | text: `Failed to retrieve grid point data for coordinates: ${latitude}, ${longitude}. This location may not be supported by the NWS API (only US locations are supported).`, 306 | }, 307 | ], 308 | }; 309 | } 310 | 311 | const forecastUrl = pointsData.properties?.forecast; 312 | if (!forecastUrl) { 313 | return { 314 | content: [ 315 | { 316 | type: "text", 317 | text: "Failed to get forecast URL from grid point data", 318 | }, 319 | ], 320 | }; 321 | } 322 | 323 | // Get forecast data 324 | const forecastData = await makeNWSRequest( 325 | forecastUrl 326 | ); 327 | if (!forecastData) { 328 | return { 329 | content: [ 330 | { 331 | type: "text", 332 | text: "Failed to retrieve forecast data", 333 | }, 334 | ], 335 | }; 336 | } 337 | 338 | const periods = forecastData.properties?.periods || []; 339 | if (periods.length === 0) { 340 | return { 341 | content: [ 342 | { 343 | type: "text", 344 | text: "No forecast periods available", 345 | }, 346 | ], 347 | }; 348 | } 349 | 350 | // Format forecast periods 351 | const formattedForecast = periods.map((period: ForecastPeriod) => 352 | [ 353 | `${period.name || "Unknown"}:`, 354 | `Temperature: ${period.temperature || "Unknown"}°${ 355 | period.temperatureUnit || "F" 356 | }`, 357 | `Wind: ${period.windSpeed || "Unknown"} ${ 358 | period.windDirection || "" 359 | }`, 360 | `${period.shortForecast || "No forecast available"}`, 361 | "---", 362 | ].join("\n") 363 | ); 364 | 365 | const forecastText = `Forecast for ${latitude}, ${longitude}:\n\n${formattedForecast.join( 366 | "\n" 367 | )}`; 368 | 369 | return { 370 | content: [ 371 | { 372 | type: "text", 373 | text: forecastText, 374 | }, 375 | ], 376 | }; 377 | } 378 | 379 | throw new Error("Tool not found"); 380 | } 381 | ); 382 | } 383 | 384 | // send message streaming message every second 385 | private async streamMessages(transport: StreamableHTTPServerTransport) { 386 | try { 387 | // based on LoggingMessageNotificationSchema to trigger setNotificationHandler on client 388 | const message: LoggingMessageNotification = { 389 | method: "notifications/message", 390 | params: { level: "info", data: "SSE Connection established" }, 391 | }; 392 | 393 | this.sendNotification(transport, message); 394 | 395 | let messageCount = 0; 396 | 397 | const interval = setInterval(async () => { 398 | messageCount++; 399 | 400 | const data = `Message ${messageCount} at ${new Date().toISOString()}`; 401 | 402 | const message: LoggingMessageNotification = { 403 | method: "notifications/message", 404 | params: { level: "info", data: data }, 405 | }; 406 | 407 | try { 408 | this.sendNotification(transport, message); 409 | 410 | if (messageCount === 2) { 411 | clearInterval(interval); 412 | 413 | const message: LoggingMessageNotification = { 414 | method: "notifications/message", 415 | params: { level: "info", data: "Streaming complete!" }, 416 | }; 417 | 418 | this.sendNotification(transport, message); 419 | } 420 | } catch (error) { 421 | console.error("Error sending message:", error); 422 | clearInterval(interval); 423 | } 424 | }, 1000); 425 | } catch (error) { 426 | console.error("Error sending message:", error); 427 | } 428 | } 429 | 430 | private async sendNotification( 431 | transport: StreamableHTTPServerTransport, 432 | notification: Notification 433 | ) { 434 | const rpcNotificaiton: JSONRPCNotification = { 435 | ...notification, 436 | jsonrpc: JSON_RPC, 437 | }; 438 | await transport.send(rpcNotificaiton); 439 | } 440 | 441 | private createErrorResponse(message: string): JSONRPCError { 442 | return { 443 | jsonrpc: "2.0", 444 | error: { 445 | code: -32000, 446 | message: message, 447 | }, 448 | id: randomUUID(), 449 | }; 450 | } 451 | 452 | private isInitializeRequest(body: any): boolean { 453 | const isInitial = (data: any) => { 454 | const result = InitializeRequestSchema.safeParse(data); 455 | return result.success; 456 | }; 457 | if (Array.isArray(body)) { 458 | return body.some((request) => isInitial(request)); 459 | } 460 | return isInitial(body); 461 | } 462 | } 463 | -------------------------------------------------------------------------------- /typescript-example/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "Node16", 5 | "moduleResolution": "Node16", 6 | "outDir": "./build", 7 | "rootDir": "./src", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "skipLibCheck": true, 11 | "forceConsistentCasingInFileNames": true 12 | }, 13 | "include": ["src/**/*", "node_modules/@modelcontextprotocol"], 14 | "exclude": ["node_modules"] 15 | } --------------------------------------------------------------------------------