agent-mcp-oauth
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
🤖 Agent + MCP + OAuth 2.0 — Demo Técnica
Landing con un agente de IA que usa herramientas de un servidor MCP propio, protegida con OAuth 2.0 real ("Sign in with GitHub", Authorization Code + PKCE). Construido por BMOPS Consulting — todo funciona de verdad, nada es mockup.
🔗 Demo en vivo: https://agentdemo.bmops.tech (o http://localhost:8780 en local)
✨ Qué demuestra
Capa | Qué hace | Cómo está implementado |
OAuth 2.0 | Login con GitHub | Flujo Authorization Code + PKCE contra |
MCP | Servidor de herramientas estándar |
|
Agente = cliente MCP | El LLM decide qué tool usar |
|
RAG con tus archivos | Sube PDF/DOCX/TXT y pregúntale sobre ellos | Botón 📎 → el backend extrae el texto y lo indexa en Qdrant vía la tool MCP |
LLM self-hosted | Razonamiento | Gateway local de modelos (gratis) — sin depender de APIs de pago. |
Related MCP server: LangGraph FastAPI MCP Server
🏗️ Arquitectura
navegador ──► FastAPI (server.py) ── OAuth 2.0 ──► github.com (consentimiento)
│ │
│ ┌─────────────────────┘
▼ ▼
sesión cookie HMAC
│
▼
/api/chat (agente)
│ 1. LLM decide: ¿tool MCP?
│ 2. ClientSession.call_tool(nombre, args) ← protocolo MCP
▼ │
gateway LLM :3010 mcp_server.py (stdio)
(razonamiento) ├─ hora_actual()
├─ fetch_url(url)
├─ consultar_docs(q) ──► Qdrant (vectores)
├─ indexar_documento(nombre, texto) ──► Qdrant
└─ listar_documentos()🚀 Correr en local
# 1. Requisitos: Python 3.11+, Qdrant y servidor de embeddings opcionales
# (sin Qdrant, consultar_docs responde "no encontré" — hora_actual y fetch_url siguen vivos)
pip install -r requirements.txt
# 2. Crea una OAuth App en GitHub: Settings → Developer settings → OAuth Apps
# Homepage URL: http://localhost:8780
# Callback URL: http://localhost:8780/callback
# 3. Configura (o exporta como env vars)
cp .env.example .env # rellena GITHUB_CLIENT_ID y GITHUB_CLIENT_SECRET
# 4. Lanza
uvicorn server:app --port 8780 # o: python3 server.pyAbre http://localhost:8780 → Continuar con GitHub → prueba:
🕐 "¿Qué hora es?" → usará
hora_actual📚 "¿Qué documentos tienes indexados?" → usará
listar_documentos📎 Sube un PDF/DOCX/TXT → se indexa vía
indexar_documento→ "resume mi documento" → usaráconsultar_docs(RAG con tu archivo)🌐 "Lee https://bmops.tech" → usará
fetch_url
🧪 Probar el servidor MCP solo (sin web)
python3 test_mcp2.py # lista tools y ejecuta hora_actual + consultar_docs📁 Estructura
├── server.py # FastAPI: OAuth 2.0 + sesión + agente cliente MCP + chat
├── mcp_server.py # Servidor MCP propio (tools: hora_actual, fetch_url, consultar_docs, indexar_documento, listar_documentos)
├── static/index.html # Landing premium (login GitHub + chat con indicador de tools)
├── seed_qdrant.py # Siembra la colección mcp_demo en Qdrant
├── test_mcp2.py # Test del servidor MCP vía cliente oficial
├── requirements.txt
└── .env.example🔒 Notas de seguridad (patrones BMOPS)
Anti-inyección deny-first: el chat filtra intentos de prompt injection antes de llegar al LLM (patrón probado en producción).
Sesión firmada: cookie
HttpOnly+ HMAC-SHA256 (elSESSION_SECRETva en.env, nunca en el repo).PKCE: el
code_verifierviaja en cookieHttpOnly; elstatese valida con comparación en tiempo constante.
⚖️ Stack
Python · FastAPI · MCP SDK (fastmcp + cliente oficial mcp) · OAuth 2.0 (PKCE) · Qdrant · Embeddings MiniLM · Docker/VPS self-hosted
BMOPS Consulting — agentes de IA en producción con usuarios reales. 17+ webs, 3 agentes RAG, pipeline lead→CRM→Stripe, infraestructura self-hosted con 7 MCP servers operativos.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server that exposes GitHub operations as tools for AI agents, enabling code search, issue management, and PR review.12MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM-powered agents to securely communicate with and orchestrate downstream microservices via FastAPI endpoints exposed as MCP tools.-
- AlicenseAqualityDmaintenanceMCP server for AI agents to securely access GitHub data, including listing repositories and user profile info via the GitHub API.2ISC
- AlicenseNot gradedqualityBmaintenanceMCP server that wraps the GitHub REST API into tools for repo queries, issue/PR management, code review, search, and authentication, letting coding agents operate GitHub directly in conversations.5 npmMIT