Skip to content

Support any JS runtime #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Support any JS runtime #61

wants to merge 2 commits into from

Conversation

gregnr
Copy link
Collaborator

@gregnr gregnr commented Apr 21, 2025

Adds support for running this library on any JS runtime. Strips out any node-only APIs.

Specifically we now run tests on the following runtimes:

  • Node.js
  • Vercel edge runtime
  • Browsers (chromium, firefox, webkit)

In the future we can add tests for:

  • Deno
  • Supabase edge runtime
  • Cloudflare workers (workerd)

The above require separate binaries so will take a bit more work to set up.

Why?

The rationale for doing this is to make it possible to embed this MCP server as a library on any JS runtime, most commonly with Vercel's AI SDK. Because AI SDK is typically used in Next.js on Vercel's edge runtime, we add tests for running in their edge runtime environment.

Running LLMs directly from the browser is less common, but possible. Testing in browser runtimes mainly forces us to stick to web standard APIs.

Keeping this server runtime agnostic also makes it easier for us to switch runtimes this later if needed (Deno, Bun, etc).

@gregnr gregnr changed the base branch from feat/edge-functions to main April 22, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants