MCP-S Gateway
About
A secure, open-source OAuth gateway for MCP authentication.
Details
- Author
- mcp-s-ai
- Categories
- Developer Tools, Security, API
Jump to
Setup
Install MCP-S Gateway in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/mcp-s-ai/secure-mcp-gateway
Follow the installation instructions in the repository README, then restart your MCP client.
Webrix MCP-S Gateway
A secure, open-source OAuth gateway for MCP authenticationGateway + integration layer for theModel Context Protocol (MCP)
mcp-gatewayis a secure gateway and integration layer for theModel Context Protocol (MCP). It provides a unified, enterprise-ready interface for connecting, managing, and extending MCP modules and services, with a focus on security and seamless integration.
1. Configure your MCP servers- Createmcp.jsonfile in your project:
{ "mcpServers": { "your-server": { "command": "npx", "args": ["-y", "@your-mcp-server"], "env": { "API_KEY": "your-api-key" } }, "octocode": { "command": "npx", "args": ["octocode-mcp"] } } }
2. Use the.env.examplefile as a base, and override as needed:
# Default (uses ./mcp.json and ./.env) npx @mcp-s/secure-mcp-gateway # Custom configuration paths npx @mcp-s/secure-mcp-gateway --mcp-config ./custom/mcp.json --envfile ./custom/.env
git clone https://github.com/mcp-s-ai/secure-mcp-gateway.git && cd secure-mcp-gateway npm install && npm run start
{ "mcpServers": { "mcp-gateway": { "command": "npx", "args": ["-y", "@mcp-s/mcp"], "env": { "BASE_URL": "http://localhost:3000" } } } }
{ "mcpServers": { "mcp-gateway": { "url": "http://localhost:3000/mcp" } } }
- Self-Hosted Gateway: Deploy within your own infrastructure for maximum control
- OAuth Authentication: Secure authentication with any OAuth provider viaAuth.js
- TypeScript Support: Fully typed for robust development
-
STDIO: Standard input/output MCP servers
StreamableHTTP: HTTP-based streaming connections viahttp://localhost:3000/mcp(orhttps://<your-domain>/mcpfor hosted deployments)
Server Selection: You can connect to a specific MCP server by adding the?server_name=XXXquery parameter, whereXXXis the name of the server from yourmcp.jsonconfiguration. For example:http://localhost:3000/mcp?server_name=your-server
- Set up your environment variables (seeAdvanced Configuration)
- Create yourmcp.jsonconfiguration file
- Runnpx @mcp-s/secure-mcp-gateway
For production deployments, consider using:
- Process managers like PM2:pm2 start "npx @mcp-s/secure-mcp-gateway" --name mcp-gateway
- Container orchestration (Docker, Kubernetes)
- Cloud platforms (Heroku, Railway, Render)
Simply set theAUTH_PROVIDERenvironment variable and provide the required credentials for your chosen provider - mcp-gateway handles the rest.
AUTH_SECRET=your-random-secret AUTH_PROVIDER=google AUTH_GOOGLE_ID=your-google-client-id AUTH_GOOGLE_SECRET=your-google-client-secret
AUTH_SECRET=your-random-secret AUTH_PROVIDER=okta AUTH_OKTA_ID=your-okta-client-id AUTH_OKTA_SECRET=your-okta-client-secret AUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
Documentation:Auth.js Azure AD Provider
AUTH_SECRET=your-random-secret AUTH_PROVIDER=azure-ad AUTH_AZURE_AD_ID=your-azure-client-id AUTH_AZURE_AD_SECRET=your-azure-client-secret AUTH_AZURE_AD_TENANT_ID=your-tenant-id-or-common
GitHub OAuth is particularly useful for MCP servers that interact with GitHub repositories, such as Octocode. When using GitHub OAuth, you can specify scopes to control what permissions your MCP servers have access to.
AUTH_SECRET=your-random-secret AUTH_PROVIDER=github AUTH_GITHUB_ID=your-github-client-id AUTH_GITHUB_SECRET=your-github-client-secret AUTH_GITHUB_SCOPES=repo
- repo- Full access to repositories (public and private)
- public_repo- Access to public repositories only
- read:user- Read access to user profile information
- user:email- Access to user email addresses
For Octocode and similar MCP servers that need repository access, thereposcope is typically required.
For other providers, see theAuth.js Providers documentation.
Issue: When using StreamableHTTP configuration in Cursor, tools don't appear even after successful authentication.
Solution: Make sure you have onlyone Cursor window open. Multiple Cursor windows can interfere with the MCP connection establishment.
- Close all Cursor windows
- Open a single Cursor window
- Retry the authentication process
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:sqlite
Solution: This error occurs when using an older version of Node.js. Thenode:sqlitemodule requiresNode.js version 22 or higher.
- Update Node.js to version 22 or later
- Verify your version:node --version
- Restart the gateway:npm run start
- Usingnvm:nvm install 22 && nvm use 22
- Download fromnodejs.org
Visitwebrix.aifor our fully managed hosting solution with advanced features:
- Zero Configuration: Get started in seconds without any setup
- Enterprise-grade Security: Advanced SSO authentication for all MCP interactions
- 20+ Pre-built Connectors: Fast plug-and-play integration with hundreds of tools
- Roles & Permissions: Granular access control with custom role definitions
- Monitoring & Analytics: Real-time insights into your MCP usage
- High Availability: 99.9% uptime SLA with global CDN
- Premium Support: Direct access to our engineering team
- Custom Integrations: Build and deploy custom MCP connectors
Have questions? Need help getting started? Want to share your MCP setup?
Join our Slack community where developers are actively helping each other with MCP gatway implementations, troubleshooting, and sharing best practices.
Released under theMITLicense. Contributions welcome - star & fork!
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Enterprise-grade authentication with secure credential management, multi-protocol support, and real-time threat detection.
Official managed MCP server for the Cycode platform. Exposes projects, violations, compliance frameworks, audit logs, brokers, SBOM, and more via OAuth-authenticated remote access — no local install required.
A secure MCP gateway that acts as a proxy, providing authentication, tool discovery, caching, and guardrail enforcement.
Performs data enrichment on observables using third-party services via the security-cli Python package.
Hosted OAuth 2.1 + Dynamic Client Registration (RFC 7591) for MCP servers
Scan projects for over 500 types of secrets using GitGuardian's API to prevent credential leaks.
A FastAPI microservice for health-related operations, featuring JWT authentication and a PostgreSQL database with Alembic migrations.
Hosted Streamable HTTP MCP server for IP intelligence, fraud risk scoring, email validation, DNS, WHOIS, domain age, quota, and usage tools for AI agents.
GeoIP and ASN intelligence for AI agents with country, city, timezone, network ownership and ASN lookups.
An MCP server for Keycloak administration, offering over 30 tools to manage users, realms, clients, roles, and more from AI assistants.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





