Skip to content

Feature Request: Authentication Support for MCP Server #5

@ferstar

Description

@ferstar

Summary

Request for authentication mechanisms to enable secure access to Nowledge Mem MCP server, especially when accessed over network.

Current Situation

The Nowledge Mem MCP server currently does not implement any authentication mechanism. While this is acceptable for localhost-only usage, it poses security risks when the service needs to be accessed over a network (even private networks like VPN/Tailscale).

From the MCP client logs, I can see authentication attempts are being made but failing:

"No token data found"
"SDK auth error: fg: HTTP 404: Invalid OAuth error response"

This indicates the client is looking for authentication, but the server hasn't implemented the corresponding endpoints.

Use Cases

  1. Multi-device development: Securely access memories from different workstations on a private network (e.g., desktop + laptop)
  2. Remote development: Use Nowledge Mem over VPN/Tailscale when working remotely with proper access control
  3. Team collaboration: (Future) Share specific knowledge bases with team members securely

Security Risks

Without authentication, anyone with network access to the MCP server can:

  • Read sensitive data: Personal memories, conversation histories, and insights
  • Modify or delete data: Unauthorized tampering with knowledge base
  • Privacy violations: Access to potentially confidential information stored in knowledge graphs

These risks are especially critical since Nowledge Mem is designed to store personal context and long-term memories from AI interactions.

Proposed Solution

Implement authentication following MCP security best practices:

Phase 1: API Key/Bearer Token Authentication (Recommended first step)

  • Generate API keys through the Nowledge Mem UI
  • Client includes token in headers: Authorization: Bearer <token>
  • Support token rotation and revocation

Example MCP Client Configuration:

{
  "mcpServers": {
    "nowledge-mem": {
      "url": "http://192.168.1.100:14242/mcp",
      "type": "streamableHttp",
      "headers": {
        "APP": "Claude Code",
        "Authorization": "Bearer mem_sk_xxxxx..."
      }
    }
  }
}

Phase 2: OAuth 2.1 Support (For advanced use cases)

Implementation Priority

P0 (Critical):

  • API Key/Bearer Token authentication
  • Basic token validation on all MCP endpoints

P1 (High):

  • Token management UI (generate, revoke, rotate)
  • Token expiration and refresh mechanisms

P2 (Medium):

  • OAuth 2.1 support
  • Per-token permission scopes (read-only, read-write)

Reference

Willingness to Contribute

I'd be happy to help test this feature or contribute to the implementation if guidance is provided.


Environment:

  • Nowledge Mem Version: 0.4.9
  • MCP Client: Claude Code 2.0.36
  • Network Setup: Private network (Tailscale VPN)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions