LearnNewsExamplesServices
Frontmatter
id9558
titleImplement OIDC/OAuth Authorization for KB and Memory MCP Servers
stateClosed
labels
enhancementdeveloper-experienceaiarchitecture
assigneestobiu
createdAtMar 26, 2026, 2:39 PM
updatedAtMar 26, 2026, 3:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/9558
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 26, 2026, 2:51 PM

Implement OIDC/OAuth Authorization for KB and Memory MCP Servers

Closed v12.1.0 enhancementdeveloper-experienceaiarchitecture
tobiu
tobiu commented on Mar 26, 2026, 2:39 PM

Implement out-of-the-box OAuth 2.1 / OIDC authorization for the Knowledge Base and Memory Core MCP servers. This enables IaC-driven deployments using standard identity providers like Keycloak.

Requirements:

  • Map AUTH_HOST, AUTH_PORT, AUTH_REALM, OAUTH_CLIENT_ID, and OAUTH_CLIENT_SECRET in aiConfig.mjs.
  • In Server.mjs (for both knowledge-base and memory-core):
    • Automatically setup the mcpAuthMetadataRouter for discovery.
    • Implement a tokenVerifier using standard token introspection.
    • Apply the requireBearerAuth middleware to the SSE transport.
  • Ensure the existing authMiddleware escape hatch remains functional.
tobiu added the enhancement label on Mar 26, 2026, 2:39 PM
tobiu added the developer-experience label on Mar 26, 2026, 2:39 PM
tobiu added the ai label on Mar 26, 2026, 2:39 PM
tobiu added the architecture label on Mar 26, 2026, 2:39 PM
tobiu referenced in commit db1cc18 - "Implement OIDC/OAuth 2.1 authorization for KB and Memory Core MCP servers (#9558)" on Mar 26, 2026, 2:50 PM
tobiu closed this issue on Mar 26, 2026, 2:51 PM
tobiu
tobiu Mar 26, 2026, 2:55 PM

Input from Gemini 3.1 Pro:

✦ I have completed the implementation of OIDC/OAuth 2.1 authorization for the Knowledge Base and Memory Core MCP servers.

Key Enhancements:

  • Added auth configuration block to aiConfig.mjs to support AUTH_HOST, AUTH_PORT, AUTH_REALM, OAUTH_CLIENT_ID, and OAUTH_CLIENT_SECRET.
  • Updated Server.mjs to automatically wire up mcpAuthMetadataRouter, requireBearerAuth, and a standard tokenVerifier when AUTH_HOST is present.
  • Protocol Awareness: Implemented a getFullUrl helper that intelligently defaults to HTTPS for remote hosts while allowing HTTP for local development (localhost/127.0.0.1).
  • Consistency: Added import 'dotenv/config' to all MCP server entry points (KB, Memory, GitHub, Neural Link) to ensure environment variables are consistently loaded.

The servers are now ready for IaC-driven deployments using standard identity providers like Keycloak.

tobiu referenced in commit 8a66876 - "Implement CORS support for MCP servers (#9558)" on Mar 26, 2026, 2:57 PM
tobiu
tobiu Mar 26, 2026, 2:57 PM

Added CORS support to Knowledge Base and Memory Core MCP servers for better cross-origin client compatibility.

tobiu referenced in commit 6cb5ba4 - "Implement OIDC/OAuth 2.1, CORS, and env mapping for MCP servers (#9558, #9560)" on Mar 26, 2026, 3:06 PM
tobiu assigned to @tobiu on Mar 26, 2026, 3:07 PM