Skip to main content
Glama
yeison-liscano

Demo HTTP MCP Server

test-http-mcp

Demo Model Context Protocol (MCP)-Server, implementiert in Python unter Verwendung des http-mcp-Pakets. Er kann über HTTP (Starlette/Uvicorn) oder über stdio ausgeführt werden und stellt Beispiel-Tools und Prompts für jeden MCP-fähigen Client bereit. Das Projekt enthält ein React-Frontend, das eine Chat-Oberfläche zur Abfrage von Schwachstellen über die NVD (National Vulnerability Database) bietet.

Chat UI

Projektstruktur

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

Anforderungen

  • Python 3.13

  • Node.js 18+ und npm

  • uv (empfohlen) oder pip

Installation

Backend (mit uv):

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

Backend (mit pip):

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

Frontend:

cd frontend
npm install

Ausführung

Entwicklung (Frontend + Backend separat)

Starten des Backends:

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

Starten des Frontend-Entwicklungsservers (in einem separaten Terminal):

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

Produktion (Backend stellt das gebaute Frontend bereit)

Bauen des Frontends und Starten des Backends:

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

Ausführung (stdio-Modus)

Verwendung mit Cursor oder anderen MCP-Clients

Beispiel .cursor/mcp.json für den HTTP-Modus:

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

Verwendung mit Gemini:

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

Beispiel .cursor/mcp.json-Eintrag zur Verbindung über stdio:

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

Was dieser Server bereitstellt

  • Tools (siehe backend/app/tools/):

    • search_cpe(product, version, vendor) — Suche nach Common Platform Enumerations über NVD

    • search_cve(cpe_name) — Suche nach Common Vulnerabilities and Exposures für ein gegebenes CPE

  • Prompts (siehe backend/app/prompts/):

    • sync_nvd_search(dependency, version) — einfacher Schwachstellen-Such-Prompt

    • async_nvd_search(dependency, version) — fortgeschrittener Prompt mit vorab abgerufenen CVE-Daten

Projektskripte

Zwei Konsolen-Einstiegspunkte sind in backend/pyproject.toml definiert:

  • run-appapp.main:run_http

  • run-stdioapp.main:run_stdio

  • run-app-localapp.app:main (mit Auto-Reload)

Entwicklung

Allgemeine Aufgaben (auszuführen aus dem backend/-Verzeichnis):

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

Frontend-Aufgaben (auszuführen aus dem frontend/-Verzeichnis):

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

Implementierungshinweise

  • Die FastAPI-App ist in backend/app/app.py definiert und bindet http_mcp.server.MCPServer unter /mcp ein.

  • Die Chat-Oberfläche verwendet pydantic-ai mit einem Gemini-Agenten, der MCP-Tools aufrufen kann, um nach Schwachstellen zu suchen.

  • Der Chat-Verlauf wird in einer lokalen SQLite-Datenbank über agen_memory.py gespeichert.

  • Das React-Frontend streamt Antworten als zeilenweise getrenntes JSON und rendert Markdown mit der marked-Bibliothek.

  • In der Produktion stellt das Backend das gebaute Frontend aus frontend/dist/ mit SPA-Fallback-Routing bereit.

  • In der Entwicklung leitet Vite /api/*-Anfragen an das Backend auf Port 8000 weiter.

Lizenz

MIT — siehe 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