{"id":29451325,"url":"https://github.com/phuctm97/modelfetch","last_synced_at":"2026-02-13T19:35:59.147Z","repository":{"id":302578653,"uuid":"1010451591","full_name":"phuctm97/modelfetch","owner":"phuctm97","description":"Runtime-agnostic TypeScript/JavaScript SDK for MCP Servers","archived":false,"fork":false,"pushed_at":"2025-09-02T05:53:45.000Z","size":1509,"stargazers_count":137,"open_issues_count":0,"forks_count":8,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T18:59:01.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://modelfetch.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phuctm97.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-29T05:15:11.000Z","updated_at":"2025-10-01T05:42:51.000Z","dependencies_parsed_at":"2025-07-17T17:08:16.379Z","dependency_job_id":"0a4e2ec4-f7fa-4bda-9c88-970cef5fb0d4","html_url":"https://github.com/phuctm97/modelfetch","commit_stats":null,"previous_names":["phuctm97/modelfetch"],"tags_count":74,"template":false,"template_full_name":null,"purl":"pkg:github/phuctm97/modelfetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuctm97%2Fmodelfetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuctm97%2Fmodelfetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuctm97%2Fmodelfetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuctm97%2Fmodelfetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phuctm97","download_url":"https://codeload.github.com/phuctm97/modelfetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuctm97%2Fmodelfetch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29415904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-13T22:01:03.298Z","updated_at":"2026-02-13T19:35:59.133Z","avatar_url":"https://github.com/phuctm97.png","language":"TypeScript","funding_links":[],"categories":["SDKs"],"sub_categories":["JavaScript/TypeScript"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eModelFetch\u003c/h1\u003e\n  \u003cp\u003eModelFetch is a delightful TypeScript/JavaScript SDK for building and deploying MCP servers anywhere TypeScript/JavaScript runs.\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/phuctm97/modelfetch/releases/latest\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/v/release/phuctm97/modelfetch\" alt=\"Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/phuctm97/modelfetch/blob/main/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/phuctm97/modelfetch\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.modelfetch.com/docs\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/docs-modelfetch.com-blue\" alt=\"Documentation\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## 🚀 Features\n\n- **Multi-Runtime**: Write once, run anywhere: Node.js, Next.js, Bun, Deno, Vercel, Cloudflare, Netlify, Fastly, Supabase, Gcore, AWS Lambda, and Azure Functions\n- **Official SDK**: Built on top of the [official MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) to avoid lock-in, guarantee long-term support, and ensure up-to-date implementation\n- **Hot Reload**: Development server with automatic reloading\n- **MCP Inspector**: Built-in integration for testing and debugging\n- **Modular Design**: Platform-specific package for optimal performance\n\n## 🏁 Quick Start\n\nGet started in seconds using our `create-modelfetch` CLI:\n\n```bash\nnpx -y create-modelfetch@latest\n```\n\n## 🔧 How It Works\n\nModelFetch works with any [`McpServer`](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#server) instance from the [official MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk). Here's all it takes:\n\n### Create your [`McpServer`](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#server) with the [official MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)\n\n```typescript\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\n\nconst server = new McpServer({\n  title: \"My MCP Server\",\n  name: \"my-mcp-server\",\n  version: \"1.0.0\",\n});\n\nserver.registerTool(\n  \"roll_dice\",\n  {\n    title: \"Roll Dice\",\n    description: \"Rolls an N-sided dice\",\n    inputSchema: { sides: z.number().int().min(2) },\n  },\n  ({ sides }) =\u003e ({\n    content: [\n      {\n        type: \"text\",\n        text: `🎲 You rolled a ${1 + Math.floor(Math.random() * sides)}!`,\n      },\n    ],\n  }),\n);\n\nexport default server;\n```\n\n### Run it anywhere with ModelFetch's [`handle()`](https://www.modelfetch.com/docs#the-handle-function) function\n\n#### Node.js\n\n```typescript\nimport handle from \"@modelfetch/node\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Next.js\n\n```typescript\nimport handle from \"@modelfetch/next\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nconst handler = handle(server); // That's it — ModelFetch handles all runtime-specific details\n\nexport const GET = handler;\nexport const POST = handler;\nexport const DELETE = handler;\n```\n\n#### Bun\n\n```typescript\nimport handle from \"@modelfetch/bun\"; // Choose your runtime\nimport server from \"./server.ts\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Deno\n\n```typescript\nimport handle from \"@modelfetch/deno\"; // Choose your runtime\nimport server from \"./server.ts\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Vercel\n\n```typescript\nimport handle from \"@modelfetch/vercel\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nconst handler = handle(server); // That's it — ModelFetch handles all runtime-specific details\n\nexport const GET = handler;\nexport const POST = handler;\nexport const DELETE = handler;\n```\n\n#### Cloudflare\n\n```typescript\nimport handle from \"@modelfetch/cloudflare\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nexport default {\n  fetch: handle(server), // That's it — ModelFetch handles all runtime-specific details\n} satisfies ExportedHandler\u003cEnv\u003e;\n```\n\n#### Netlify\n\n```typescript\nimport handle from \"@modelfetch/netlify\"; // Choose your runtime\nimport server from \"../server.ts\"; // Import your server\n\nexport default handle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Fastly\n\n```typescript\nimport handle from \"@modelfetch/fastly\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Supabase\n\n```typescript\nimport handle from \"@modelfetch/supabase\"; // Choose your runtime\nimport server from \"./server.ts\"; // Import your server\n\nhandle(\"mcp-server\", server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Gcore\n\n```typescript\nimport handle from \"@modelfetch/gcore\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### AWS Lambda\n\n```typescript\nimport handle from \"@modelfetch/aws-lambda\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nexport const handler: AWSLambda.LambdaFunctionURLHandler = handle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n#### Azure Functions\n\n```typescript\nimport handle from \"@modelfetch/azure-functions\"; // Choose your runtime\nimport server from \"./server.js\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\nThat's just a few lines of code to make your [`McpServer`](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#server) work across all supported platforms.\n\n## ⚡ The [`handle()`](https://www.modelfetch.com/docs#the-handle-function) Function\n\nEvery runtime package exports a default [`handle()`](https://www.modelfetch.com/docs#the-handle-function) function that takes an [`McpServer`](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#server) instance as its first parameter and handles all runtime-specific details:\n\n```typescript\nimport handle from \"@modelfetch/node\"; // Choose your runtime\nimport server from \"./server\"; // Import your server\n\nhandle(server); // That's it — ModelFetch handles all runtime-specific details\n```\n\n## 📦 Runtimes\n\nModelFetch provides runtime-specific packages that handle tedious platform differences while you focus on building your MCP server capabilities. Each package maintains a [consistent API](https://www.modelfetch.com/docs#the-handle-function) across different runtimes.\n\n| Package                                                          | Description                           | Status   |\n| ---------------------------------------------------------------- | ------------------------------------- | -------- |\n| [`@modelfetch/node`](libs/modelfetch-node)                       | Run simple MCP servers with Node.js   | ✅ Ready |\n| [`@modelfetch/next`](libs/modelfetch-next)                       | Run flexible MCP servers with Next.js | ✅ Ready |\n| [`@modelfetch/bun`](libs/modelfetch-bun)                         | Run fast MCP servers with Bun         | ✅ Ready |\n| [`@modelfetch/deno`](libs/modelfetch-deno)                       | Run secure MCP servers with Deno      | ✅ Ready |\n| [`@modelfetch/vercel`](libs/modelfetch-vercel)                   | Deploy MCP servers to Vercel          | ✅ Ready |\n| [`@modelfetch/cloudflare`](libs/modelfetch-cloudflare)           | Deploy MCP servers to Cloudflare      | ✅ Ready |\n| [`@modelfetch/netlify`](libs/modelfetch-netlify)                 | Deploy MCP servers to Netlify         | ✅ Ready |\n| [`@modelfetch/fastly`](libs/modelfetch-fastly)                   | Deploy MCP servers to Fastly          | ✅ Ready |\n| [`@modelfetch/supabase`](libs/modelfetch-supabase)               | Deploy MCP servers to Supabase        | ✅ Ready |\n| [`@modelfetch/gcore`](libs/modelfetch-gcore)                     | Deploy MCP servers to Gcore           | ✅ Ready |\n| [`@modelfetch/aws-lambda`](libs/modelfetch-aws-lambda)           | Deploy MCP servers to AWS Lambda      | ✅ Ready |\n| [`@modelfetch/azure-functions`](libs/modelfetch-azure-functions) | Deploy MCP servers to Azure Functions | ✅ Ready |\n\n## 🛠️ Development\n\n### Prerequisites\n\n- Node.js 22+\n- pnpm 10+\n\n### Initial Steps\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/phuctm97/modelfetch.git\n   cd modelfetch\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   pnpm install\n   ```\n\n3. Type check, lint, and build all projects\n   ```bash\n   pnpm exec nx run-many -t typecheck lint build\n   ```\n\n### Common Commands\n\n```bash\n# Run development server for a project\npnpm exec nx dev modelfetch-website\n\n# Type check all projects\npnpm exec nx run-many -t typecheck\n\n# Lint and auto-fix all projects\npnpm exec nx run-many -t lint --args=--fix\n\n# Build all projects\npnpm exec nx run-many -t build\n\n# Format code\npnpm -w format\n```\n\n## 📚 Documentation\n\n- [Model Context Protocol - TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)\n- [Model Context Protocol - Documentation](https://modelcontextprotocol.io)\n- [ModelFetch - Website](https://www.modelfetch.com)\n- [ModelFetch - Documentation](https://www.modelfetch.com/docs)\n\n## 📄 License\n\nModelFetch is [MIT licensed](LICENSE).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eBuilt with ❤️ by \u003ca href=\"https://x.com/phuctm97\"\u003eMinh-Phuc Tran\u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuctm97%2Fmodelfetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphuctm97%2Fmodelfetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuctm97%2Fmodelfetch/lists"}