Skip to main content
Glama

MCP Relay Server

A lightweight MCP server that exposes provider-specific tools and relays HTTP requests to configured providers (Supabase, Vercel, Context7, etc.).

Quick start

  1. Install dependencies

npm install
  1. Set up environment variables

Set environment variables for provider auth tokens (locally or in your host settings):

CONTEXT7_API_KEY=your-token-here SUPABASE_URL=https://your-project.supabase.co SUPABASE_ANON_KEY=your-key-here

Example for your shell:

  • PowerShell: $env:CONTEXT7_API_KEY = "your-token"

  • Bash: export CONTEXT7_API_KEY="your-token"

  1. Add a provider

npm run build node dist/cli.js add
  1. Run the relay (stdio transport)

node dist/index.js
  1. Run the relay (HTTP transport)

node dist/httpServer.js

Provider config

Provider configs live in providers/*.json.

Example:

{ "name": "supabase", "type": "http", "baseUrl": "https://YOUR_PROJECT.supabase.co", "description": "Supabase REST API", "auth": { "type": "bearer", "env": "SUPABASE_TOKEN" }, "defaultHeaders": { "apikey": "${SUPABASE_ANON_KEY}" }, "allowMethods": ["GET", "POST"], "allowPaths": ["/rest/v1/"] }

Note: set any secrets via environment variables (locally or in your host). ${ENV_VAR} placeholders in baseUrl and defaultHeaders are expanded at runtime.

Presets: providers/vercel.json uses VERCEL_TOKEN. providers/supabase.json uses SUPABASE_URL and SUPABASE_ANON_KEY.

Tools

Each provider creates a tool named:

  • provider.<name>.request

Inputs:

  • path: path starting with /

  • method: HTTP method

  • headers: additional headers

  • query: query params

  • body: string or JSON

Optional provider fields:

  • allowMethods: restricts allowed HTTP methods.

  • allowPaths: list of allowed path prefixes.

The server also exposes:

  • relay.list_providers

CLI flags

node dist/cli.js add --name supabase --base-url https://xyz.supabase.co --auth bearer --auth-env SUPABASE_TOKEN

One-click deploy

Replace YOUR_REPO_URL with your GitHub repo URL.

  • Vercel (serverless, stateless MCP HTTP at /mcp):

Deploy with Vercel

  • Render (long-running HTTP server on /mcp):

Deploy to Render

Set env vars in your hosting dashboard for any providers you configure (for example VERCEL_TOKEN, CONTEXT7_API_KEY, SUPABASE_URL, SUPABASE_ANON_KEY).

HTTP settings

  • PORT: port for the HTTP server (default: 3000).

  • HOST: bind address for the HTTP server (default: 0.0.0.0).

  • MCP_PATH: HTTP path for MCP (default: /mcp).

Build

npm run build
-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/econ-watch/mcprelay'

If you have feedback or need assistance with the MCP directory API, please join our Discord server