loading…
Search for a command to run...
loading…
Enterprise MCP gateway with SSO, RBAC, audit trails, and token vaults for secure, centralized AI agent access control. Deploy via Helm charts on-premise or in y
Enterprise MCP gateway with SSO, RBAC, audit trails, and token vaults for secure, centralized AI agent access control. Deploy via Helm charts on-premise or in your cloud. [webrix.ai](https://webrix.ai)
Gateway + integration layer for the Model Context Protocol (MCP)
mcp-gateway is a secure gateway and integration layer for the Model 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 - Create mcp.json file 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.example file as a base, and override as needed:
3. Start with npx (Recommended):
# 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
Or clone:
git clone https://github.com/mcp-s-ai/secure-mcp-gateway.git && cd secure-mcp-gateway
npm install && npm run start
4. Add to your MCP configuration:
stdio:
{
"mcpServers": {
"mcp-gateway": {
"command": "npx",
"args": ["-y", "@mcp-s/mcp"],
"env": {
"BASE_URL": "http://localhost:3000"
}
}
}
}
Streamable HTTP Configuration:
{
"mcpServers": {
"mcp-gateway": {
"url": "http://localhost:3000/mcp"
}
}
}
Supports all MCP Connection Types:
STDIO: Standard input/output MCP servers
StreamableHTTP: HTTP-based streaming connections via http://localhost:3000/mcp (or https://<your-domain>/mcp for 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
Connect with your preferred AI client:
| Client | Link |
|---|---|
| claude.ai | |
| cursor.com | |
| codeium.com/windsurf | |
| code.visualstudio.com | |
| cline.tools | |
| highlightai.com | |
| augmentcode.com |
Deploy the mcp-s gateway using npx:
mcp.json configuration filenpx @mcp-s/secure-mcp-gatewayFor production deployments, consider using:
pm2 start "npx @mcp-s/secure-mcp-gateway" --name mcp-gatewaymcp-gateway leverages the power of Auth.js, which supports 80+ OAuth providers out of the box. This makes Auth.js the perfect companion for an open-source project like mcp-gateway. Both libraries share the same commitment to flexibility, security, and developer experience. By integrating with Auth.js, we avoid reinventing authentication wheels and instead provide you with battle-tested, production-ready OAuth flows that work seamlessly across providers.
Simply set the AUTH_PROVIDER environment variable and provide the required credentials for your chosen provider - mcp-gateway handles the rest.
Documentation: Auth.js Google Provider
AUTH_SECRET=your-random-secret
AUTH_PROVIDER=google
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret
Documentation: Auth.js Okta Provider
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
Documentation: Auth.js GitHub Provider
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
Common GitHub Scopes:
repo - Full access to repositories (public and private)public_repo - Access to public repositories onlyread:user - Read access to user profile informationuser:email - Access to user email addressesFor Octocode and similar MCP servers that need repository access, the repo scope is typically required.
For other providers, see the Auth.js Providers documentation.
| Option | Description | Default Value | Example |
|---|---|---|---|
--mcp-config |
Path to MCP servers configuration file | ./mcp.json |
--mcp-config ./config/servers.json |
--envfile |
Path to environment variables file | ./.env |
--envfile ./config/production.env |
| Environment Variable | Description | Default Value | Required |
|---|---|---|---|
PORT |
Server port | 3000 |
No |
BASE_URL |
Base URL for the gateway | http://localhost:3000 |
No |
AUTH_SECRET |
Secret for signing/encrypting tokens (generate with openssl rand -base64 33) |
- | Yes |
AUTH_PROVIDER |
OAuth provider name | google |
No |
TOKEN_EXPIRATION_TIME |
Token expiration time in milliseconds | 86400000 (24h) |
No |
DB_PATH |
SQLite database file path | ./mcp.sqlite |
No |
AUTH_[Provider]_ID |
OAuth client ID for your provider | - | Yes |
AUTH_[Provider]_SECRET |
OAuth client secret for your provider | - | Yes |
AUTH_[Provider]_* |
Additional provider-specific variables (see Auth.js documentation) | - | Varies |
Issue: When using StreamableHTTP configuration in Cursor, tools don't appear even after successful authentication.
Solution: Make sure you have only one Cursor window open. Multiple Cursor windows can interfere with the MCP connection establishment.
Issue: You see the following error:
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:sqlite
Solution: This error occurs when using an older version of Node.js. The node:sqlite module requires Node.js version 22 or higher.
Fix:
node --versionnpm run startInstallation options:
nvm install 22 && nvm use 22Visit webrix.ai for our fully managed hosting solution with advanced features:
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 the MIT License. Contributions welcome - star & fork!
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"webrix-mcp-gateway": {
"command": "npx",
"args": []
}
}
}