MCP-S Gateway is an MCP server that provides a secure, open-source OAuth authentication proxy and integration layer for Model Context Protocol deployments. It connects AI clients to underlying STDIO and StreamableHTTP MCP servers while managing identity and access control through standard identity providers. Developers, platform engineers, and enterprise teams use this gateway to centralize access management, enforce OAuth policies, and route client traffic to multiple downstream MCP tools. By wrapping internal or third-party servers behind a single endpoint, MCP-S Gateway enables developers to authenticate users via providers like Google, Okta, Azure AD, or GitHub before granting tool execution rights. It supports both local STDIO communication and remote HTTP streaming connections, allowing specific downstream servers to be targeted using configuration parameters. By providing centralized token verification and standardized routing, the gateway simplifies the process of securing multi-server MCP environments across diverse development teams and agentic applications.
Category: AI & LLM Tooling
Tags: authentication, gateway, oauth, security
mcp.json file defining your downstream MCP servers. 2. Configure an environment file (.env) with AUTH_SECRET, your chosen AUTH_PROVIDER, and associated client credentials. 3. Start the gateway server using npx @mcp-s/secure-mcp-gateway (or provide custom configs via --mcp-config and --envfile). 4. Add the gateway to your MCP client configuration. For stdio configuration in clients like Claude Desktop or Cursor: json { "mcpServers": { "mcp-gateway": { "command": "npx", "args": ["-y", "@mcp-s/mcp"], "env": { "BASE_URL": "http://localhost:3000" } } } } For Streamable HTTP configuration: json { "mcpServers": { "mcp-gateway": { "url": "http://localhost:3000/mcp" } } }Part of MCP Servers
You can run the gateway directly using npx with the command npx @mcp-s/secure-mcp-gateway, or by cloning the repository from GitHub and running npm install followed by npm run start. You must also supply a valid mcp.json configuration file and the required authentication environment variables.
MCP-S Gateway acts as an integration and security layer for Model Context Protocol servers. It authenticates client sessions via OAuth providers through Auth.js, manages token expiration, supports SQLite-backed session storage, and routes requests across STDIO and StreamableHTTP MCP connections.
MCP-S Gateway works with any Model Context Protocol compliant client that supports stdio or HTTP streaming. Tested clients include Claude, Cursor, Windsurf, VSCode, Cline, Highlight AI, and Augment Code.
MCP-S Gateway requires Node.js version 22 or higher. Older versions will trigger an ERR_UNKNOWN_BUILTIN_MODULE error because the built-in node:sqlite module is required for operation.
Yes, MCP-S Gateway is open-source software licensed under the MIT License. The code and issue tracker are publicly hosted on GitHub.