mcp-auth-poc
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-auth-pocgreet Alice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Authentication & Security Proof of Concept
Purpose: Test and validate authentication patterns for remote MCP servers before integrating into the main e2b2 learning platform.
π― Project Context
This PoC is part of the e2b2 intelligent learning platform project. The main platform uses MCP (Model Context Protocol) tools to deliver personalized coding education through Claude Desktop.
Why This PoC Exists:
Validate token-based authentication for remote MCP servers
Test development workflow with security enabled
Understand Replit deployment process
Provide a reference implementation for the main project
Ensure authentication doesn't impede rapid development
Connection to Main Project:
Main project location:
../v3/Main project uses 8 core MCP tools (see
../v3/docs/)This PoC validates the authentication layer that will wrap those tools
Learnings from this PoC will be applied to the production architecture
Related MCP server: mcpv3e
π What This PoC Does
A minimal MCP server with:
β 2 simple tools (greeting generator and message echo)
β Token-based authentication (optional, can be disabled for development)
β SSE transport for remote connections
β User context injection (simulates student identification)
β Well-documented code (serves as example for main implementation)
ποΈ Architecture Overview
βββββββββββββββββββ
β Claude Desktop β (or OpenAI client)
ββββββββββ¬βββββββββ
β HTTP + Bearer Token
βΌ
βββββββββββββββββββ
β Auth Middlewareβ βββ Validates token, extracts user
ββββββββββ¬βββββββββ
β Adds user context
βΌ
βββββββββββββββββββ
β MCP Server β βββ Tools receive authenticated user
βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Tool Handlers β βββ get_greeting, echo_message
βββββββββββββββββββKey Design Decisions:
Token-based auth (not OAuth) for simplicity in PoC
Environment variable toggle for auth (easy local dev)
User context passed to all tools (pattern for main project)
Minimal dependencies (FastMCP, Uvicorn, python-dotenv)
π Documentation Structure
docs/
βββ 01_CONTEXT.md # Why this PoC exists, relationship to main project
βββ 02_AUTHENTICATION.md # Authentication architecture and decisions
βββ 03_LOCAL_DEVELOPMENT.md # Local setup and testing
βββ 04_REPLIT_DEPLOYMENT.md # Deploying to Replit
βββ 05_CLIENT_SETUP.md # Connecting Claude Desktop / OpenAI
βββ 06_LESSONS_LEARNED.md # Findings to apply to main projectπ Quick Start
Prerequisites
Python 3.10+
pip or uv package manager
Claude Desktop (or OpenAI compatible client)
Local Development (No Auth)
# 1. Navigate to project
cd /path/to/v3_3_auth_and_sec
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run server
python server.pyServer runs at http://localhost:8000
Local Development (With Auth)
# 1. Create environment file
cp .env.example .env
# 2. Edit .env and set AUTH_ENABLED=true
# 3. Run server
python server.pyTesting the Tools
Option 1: Claude Desktop (see docs/05_CLIENT_SETUP.md)
{
"mcpServers": {
"auth-poc": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}
}
}Option 2: MCP Inspector
npx @modelcontextprotocol/inspector python server.pyOption 3: Direct HTTP (with auth)
curl http://localhost:8000/tools \
-H "Authorization: Bearer tok_test1_abc123"π Project Structure
v3_3_auth_and_sec/
βββ README.md # This file - project overview
βββ requirements.txt # Python dependencies
βββ .env.example # Example configuration
βββ .env # Your local config (git-ignored)
βββ .gitignore # Ignore patterns
β
βββ server.py # Main MCP server (well-documented)
βββ auth_middleware.py # Authentication logic (well-documented)
βββ tools.py # Tool implementations (well-documented)
β
βββ docs/ # Comprehensive documentation
βββ 01_CONTEXT.md
βββ 02_AUTHENTICATION.md
βββ 03_LOCAL_DEVELOPMENT.md
βββ 04_REPLIT_DEPLOYMENT.md
βββ 05_CLIENT_SETUP.md
βββ 06_LESSONS_LEARNED.mdπ Authentication Flow
sequenceDiagram
participant Client as Claude Desktop
participant Middleware as Auth Middleware
participant Server as MCP Server
participant Tool as Tool Handler
Client->>Middleware: Request + Bearer Token
Middleware->>Middleware: Validate Token
Middleware->>Middleware: Extract User Info
Middleware->>Server: Request + User Context
Server->>Tool: Execute with User
Tool-->>Client: Response with User Dataπ§ͺ Testing Checklist
Local server runs without auth
Local server runs with auth enabled
Claude Desktop connects locally (no auth)
Claude Desktop connects locally (with auth)
Deploy to Replit successfully
Claude Desktop connects to Replit (with auth)
Multiple users can connect with different tokens
Invalid tokens are rejected with clear errors
π Key Files to Understand
server.py- Entry point, shows how FastMCP + auth middleware integrateauth_middleware.py- Core authentication logic, user extractiontools.py- Example tools that use user contextdocs/02_AUTHENTICATION.md- Deep dive on authentication architecture
π Learning Objectives
After working through this PoC, you should understand:
β How to add authentication to FastMCP servers
β How to toggle auth for development vs production
β How to inject user context into MCP tool handlers
β How to deploy authenticated MCP servers to Replit
β How to connect remote authenticated servers to Claude Desktop
β Patterns to apply to the main e2b2 platform
π Next Steps After PoC
Validate locally - Ensure auth works as expected
Deploy to Replit - Test remote authentication
Document learnings - Update
docs/06_LESSONS_LEARNED.mdApply to main project - Integrate patterns into
../v3/
π€ Development Notes
Code Style:
Comprehensive docstrings on all functions
Inline comments for complex logic
Type hints for clarity
Clear variable names
This code is intentionally over-documented to serve as a reference for the main project implementation.
π Related Documentation
Main Project:
../v3/README.mdMCP Specification: https://modelcontextprotocol.io
FastMCP Docs: https://github.com/jlowin/fastmcp
Replit Docs: https://docs.replit.com
π Questions?
If you encounter issues:
Check the relevant doc in
docs/Review code comments in the
.pyfilesConsult
docs/06_LESSONS_LEARNED.mdfor known issuesRefer back to the main project's architecture docs
Project Status: PoC Phase
Last Updated: 2025-10-11
Main Project: e2b2 Learning Platform (../v3/)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/360XView/mcp-auth-poc'
If you have feedback or need assistance with the MCP directory API, please join our Discord server