Skip to main content
Glama
jakedx6
by jakedx6
mcp-architecture-corrected.md2.8 kB
# Helios-9 MCP Server - Correct SaaS Architecture ## Architecture Overview ``` AI Assistant (Claude) → MCP Server → Helios-9 SaaS API → Supabase Database ``` **NOT**: ~~MCP Server → Direct Database Access~~ ❌ ## Correct Authentication Flow ### 1. User Gets API Key from Helios-9 SaaS - User logs into their Helios-9 account - Goes to Settings → API Keys - Generates a new API key for MCP access - API key is tied to their user account and permissions ### 2. MCP Server Authenticates with SaaS - MCP server uses the API key to call Helios-9 web APIs - All requests go through `/app/api/` routes - SaaS application handles database access with its own credentials - Maintains proper multi-tenancy and security ### 3. SaaS Application Handles Database - Web application authenticates to Supabase with its own credentials - Enforces Row Level Security (RLS) based on authenticated user - Returns data to MCP server via API responses ## Required Changes ### 1. Create API Key Management System **Add to Helios-9 SaaS**: ```typescript // app/api/auth/api-keys/route.ts export async function POST(request: Request) { // Generate API key for authenticated user // Store in database with user_id association // Return API key to user } export async function GET(request: Request) { // List user's API keys } export async function DELETE(request: Request) { // Revoke API key } ``` ### 2. Create MCP API Endpoints **Add to Helios-9 SaaS**: ```typescript // app/api/mcp/projects/route.ts export async function GET(request: Request) { // Authenticate via API key header // Call existing project logic // Return JSON for MCP server } // app/api/mcp/tasks/route.ts // app/api/mcp/documents/route.ts // etc. ``` ### 3. Update MCP Server to Call SaaS APIs **Instead of direct database access**: ```typescript // packages/mcp-server/src/lib/helios-client.ts class HeliosClient { constructor(private apiKey: string, private baseUrl: string) {} async getProjects() { const response = await fetch(`${this.baseUrl}/api/mcp/projects`, { headers: { 'Authorization': `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' } }) return response.json() } } ``` ## Security Benefits ✅ **Proper Multi-tenancy**: Each API key is tied to a specific user ✅ **No Database Exposure**: MCP server never sees database credentials ✅ **Centralized Authentication**: All auth goes through the SaaS app ✅ **Rate Limiting**: Can implement per-API-key rate limits ✅ **Audit Trail**: All MCP requests logged through SaaS app ✅ **Easy Revocation**: API keys can be instantly revoked ## Implementation Priority This is a **critical architectural fix** that should be implemented before the MCP server can be used safely in production.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jakedx6/helios9-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server