Skip to main content
Glama
yeison-liscano

Demo HTTP MCP Server

test-http-mcp

Servidor de Model Context Protocol (MCP) de demostración implementado en Python usando el paquete http-mcp. Puede ejecutarse sobre HTTP (Starlette/Uvicorn) o sobre stdio, exponiendo herramientas y sugerencias de ejemplo a cualquier cliente compatible con MCP. El proyecto incluye una interfaz de chat en React que proporciona una interfaz para consultar vulnerabilidades a través de la NVD (National Vulnerability Database).

Chat UI

Estructura del proyecto

test-http-mcp/
├── backend/                 # Python backend (FastAPI + MCP server)
│   ├── app/                 # Application source code
│   │   ├── app.py           # FastAPI app, routes, MCP mount
│   │   ├── main.py          # Entry points (HTTP / stdio)
│   │   ├── agen_memory.py   # SQLite message persistence
│   │   ├── config.py        # Settings via pydantic-settings
│   │   ├── tools/           # MCP tools (CPE/CVE search via NVD)
│   │   └── prompts/         # MCP prompt templates
│   ├── pyproject.toml       # Python deps & scripts
│   ├── uv.lock              # Locked dependencies
│   ├── ruff.toml            # Linter config
│   ├── mypy.ini             # Type-checker config
│   └── .envrc               # direnv auto-activation
├── frontend/                # React + TypeScript frontend (Vite)
│   ├── src/
│   │   ├── components/      # ChatApp, ChatInput, MessageList, MessageBubble
│   │   ├── api.ts           # API client (fetch history, stream messages)
│   │   ├── types.ts         # Shared TypeScript types
│   │   ├── App.tsx          # Root component
│   │   └── App.css          # Styles
│   ├── vite.config.ts       # Vite config with dev proxy
│   └── package.json         # Node dependencies
├── AGENTS.md
├── LICENSE
└── README.md

Requisitos

  • Python 3.13

  • Node.js 18+ y npm

  • uv (recomendado) o pip

Instalación

Backend (usando uv):

cd backend
uv run python -V            # creates a venv and syncs deps from pyproject

Backend (usando pip):

cd backend
python3.13 -m venv .venv
source .venv/bin/activate
pip install .

Frontend:

cd frontend
npm install

Ejecución

Desarrollo (frontend + backend por separado)

Iniciar el backend:

cd backend
uv run run-app
# → API on http://localhost:8000
# → MCP endpoint on http://localhost:8000/mcp/

Iniciar el servidor de desarrollo del frontend (en una terminal separada):

cd frontend
npm run dev
# → UI on http://localhost:5173 (proxies /api/* → backend)

Producción (el backend sirve el frontend compilado)

Compilar el frontend e iniciar el backend:

cd frontend && npm run build && cd ..
cd backend && uv run run-app
# → Everything on http://localhost:8000

Ejecución (modo stdio)

Uso con Cursor u otros clientes MCP

Ejemplo de .cursor/mcp.json para el modo HTTP:

{
  "mcpServers": {
    "test-http-mcp": {
      "type": "http",
      "url": "http://localhost:8000/mcp/",
      "headers": {
        "Authorization": "Bearer $TEST_TOKEN"
      }
    }
  }
}

Uso con Gemini:

{
  "mcpServers": {
    "test": {
      "httpUrl": "http://localhost:8000/mcp/",
      "timeout": 5000,
      "headers": {
        "Authorization": "Bearer TEST_TOKEN"
      }
    }
  }
}

Ejemplo de entrada en .cursor/mcp.json para conectar mediante stdio:

{
  "mcpServers": {
    "test_studio": {
      "command": "uv",
      "args": ["run", "--project", "backend", "run-stdio"],
      "env": { "AUTHORIZATION_TOKEN": "Bearer TEST_TOKEN" }
    }
  }
}

Qué expone este servidor

  • Herramientas (ver backend/app/tools/):

    • search_cpe(product, version, vendor) — buscar Common Platform Enumerations a través de NVD

    • search_cve(cpe_name) — buscar Common Vulnerabilities and Exposures para un CPE dado

  • Sugerencias (ver backend/app/prompts/):

    • sync_nvd_search(dependency, version) — sugerencia simple de búsqueda de vulnerabilidades

    • async_nvd_search(dependency, version) — sugerencia avanzada con datos de CVE pre-obtenidos

Scripts del proyecto

Se definen dos puntos de entrada de consola en backend/pyproject.toml:

  • run-appapp.main:run_http

  • run-stdioapp.main:run_stdio

  • run-app-localapp.app:main (con recarga automática)

Desarrollo

Tareas comunes (ejecutar desde el directorio backend/):

uv run ruff check .           # lint
uv run mypy .                 # type check
uv run pytest                 # tests
uv run mdformat .             # format markdown

Tareas del frontend (ejecutar desde el directorio frontend/):

npm run dev                   # start dev server
npm run build                 # production build
npm run lint                  # lint with ESLint
npx tsc --noEmit              # type check

Notas de implementación

  • La aplicación FastAPI está definida en backend/app/app.py y monta http_mcp.server.MCPServer en /mcp.

  • La interfaz de chat utiliza pydantic-ai con un agente de Gemini que puede llamar a herramientas MCP para buscar vulnerabilidades.

  • El historial de chat se persiste en una base de datos SQLite local a través de agen_memory.py.

  • El frontend de React transmite las respuestas como JSON delimitado por nuevas líneas y renderiza markdown con la biblioteca marked.

  • En producción, el backend sirve el frontend compilado desde frontend/dist/ con enrutamiento de respaldo para SPA.

  • En desarrollo, Vite redirige las solicitudes /api/* al backend en el puerto 8000.

Licencia

MIT — ver LICENSE.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
-
quality - not tested

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

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/yeison-liscano/demo_http_mcp'

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