claude-ia-mcp-tools-auth
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., "@claude-ia-mcp-tools-authauthenticate me, then list all users"
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 Tools with OAuth Authentication
A Python example demonstrating how to build an MCP (Model Context Protocol) server with OAuth authentication, combining an API client, business logic layer, and secured MCP tools.
Features
OAuth Authentication Flow: Click-to-authenticate in browser for session tokens
Layered Architecture: API Client → Business Logic → MCP Tools
Secure Tool Access: Requires valid auth token to call protected tools
Simple HTTP Server: Flask-based auth server running on localhost:5000
Token Management: 24-hour session tokens with persistence
Architecture
src/example/
├── api/
│ ├── api_client.py # HTTP API client (JSONPlaceholder)
│ └── http_server.py # Local HTTP server
├── auth/
│ └── manager.py # OAuth token & state management
├── business/
│ └── service.py # Business logic layer
├── http/
│ └── auth_server.py # Flask OAuth auth server
├── mcp/
│ └── server.py # MCP server with auth
└── main.pyInstallation
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txtQuick Start
1. Start the Authentication Server
python -m src.example.http.auth_serverThis starts a Flask server on http://localhost:5000 with an OAuth flow:
Visit the homepage
Click "Click to Authenticate"
Get your session token on the callback page
Copy and save your token
2. Start the MCP Server
In another terminal:
python -m src.example.mcp.server3. Use MCP Tools
The MCP server now requires authentication. First, get the auth URL:
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python -m src.example.mcp.serverThen authenticate and use tools with your token:
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_user","arguments":{"user_id":1},"auth_token":"YOUR_SESSION_TOKEN"},"id":1}' | python -m src.example.mcp.serverAuthentication Flow
Get Auth URL: Call
get_auth_urltool (no auth required){"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_auth_url","arguments":{}},"id":1}Click in Browser: User clicks the returned auth URL
Opens
http://localhost:5000/auth/callback?state=...Browser shows success page with session token
Token is valid for 24 hours
Use Token: Include
auth_tokenin all tool calls{"params":{"name":"get_user","arguments":{"user_id":1},"auth_token":"YOUR_TOKEN"}}
Available Tools
Public (No Auth Required)
get_auth_url- Get OAuth authentication URL
Protected (Auth Required)
get_user- Get one user by IDlist_users- List all userscreate_user- Create a new userupdate_user- Update user name/emaildelete_user- Delete a user
Configuration
Set environment variables:
export PORT=5000 # Auth server port
export FLASK_SECRET_KEY=your-secret-key # Flask secret (change in production!)Testing
Run tests with pytest:
pytest -v
pytest --cov=src # With coverage
pytest tests/test_auth.py # Auth tests onlyRun shell script
sh test-auth-flow.sh
========================================
MCP Auth Server - Complete Flow Test
========================================
Base URL: https://claude-ia-mcp-tools-auth-staging.up.railway.app
Step 1: Start Auth Flow
GET /auth/start
Status: 401
Auth URL: https://claude-ia-mcp-tools-auth-staging.up.railway.app/auth/callback?state=Xukdt6MwHba0n0UfkOX3lAAanm7MJhSyzomyCJCxj1M
State Token: Xukdt6MwHba0n0UfkOX3lAAanm7MJhSyzomyCJCx...
Step 2: Complete Auth Callback
GET /auth/callback?state=Xukdt6MwHba0n0UfkOX3lAAanm7MJhSyzomyCJCxj1M
Status: 200
Session Token: 7Y6SaanfrLmiOXoE2kUvTbdEfawIMSJyGDaNFPf1...
Step 3: Verify Token with Auth Status
GET /auth/status -H 'Authorization: Bearer 7Y6SaanfrLmiOXoE2kUvTbdEfawIMSJyGDaNFPf1-Bg'
Response:
{"authenticated":true,"user_id":"user_1b25e4982c9904b8"}
========================================
TEST RESULTS
========================================
State Token: Xukdt6MwHba0n0UfkOX3lAAanm7MJhSyzomyCJCxj1M
Session Token: 7Y6SaanfrLmiOXoE2kUvTbdEfawIMSJyGDaNFPf1-Bg
Authenticated: true
User ID: user_1b25e4982c9904b8
========================================
Step 4: Test Invalid Token
GET /auth/status -H 'Authorization: Bearer invalid_token_123'
Response: {"authenticated":false,"user_id":null}
SUCCESS: Complete auth flow working correctly!
You can now use this token for MCP:
Authorization: Bearer 7Y6SaanfrLmiOXoE2kUvTbdEfawIMSJyGDaNFPf1-Bg
Deployment
For production, update:
FLASK_SECRET_KEY - Use a strong random key
OAuth Provider - Replace with real OAuth (Google, GitHub, etc.)
Token Storage - Use database instead of
.auth_tokens.jsonHTTPS - Enable SSL/TLS for auth endpoints
Architecture Notes
This example demonstrates:
Separation of Concerns: API client, business logic, and MCP layer are independent
Layered Design: Easy to test and replace components
Authentication Integration: Auth tokens are passed through params, not headers
Error Handling: Proper error responses for auth failures
The API client uses https://jsonplaceholder.typicode.com as a demo API.
Replace with your own API implementation without changing MCP/business interfaces.
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.
Related MCP Connectors
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
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/vicboma1/claude-ia-mcp-tools-auth'
If you have feedback or need assistance with the MCP directory API, please join our Discord server