ProAlpha MCP Server

ProAlpha MCP Server

A Model-Context-Protocol server that provides a read-only interface to ProAlpha MSSQL databases, automatically capturing database schemas and enabling data analysis through SQL queries.

Category
Visit Server

README

ProAlpha MCP Server

Ein Model-Context-Protocol (MCP) Server für ProAlpha MSSQL-Datenbanken, der eine Read-Only-Schnittstelle zu Ihrer Datenbank bereitstellt und automatisch Schemas erfasst.

Funktionen

  • Verbindung zu ProAlpha MSSQL-Datenbanken
  • Automatische Erfassung des Datenbankschemas
  • Bereitstellung von Tabellenstrukturen als MCP-Ressourcen
  • Tools für Read-Only SQL-Abfragen
  • Prompts für gängige Datenanalyseaufgaben

Anforderungen

  • Python 3.8 oder höher
  • ODBC-Treiber für SQL Server
  • Zugriff auf eine ProAlpha MSSQL-Datenbank

Installation

  1. Repository klonen oder herunterladen

  2. Abhängigkeiten installieren:

pip install -r requirements.txt
  1. Konfigurationsdateien erstellen:

Erstellen Sie eine .env Datei mit den folgenden Einstellungen:

DB_SERVER_HOST=your_server_address
DB_SERVER_PORT=8080
DB_API_KEY=your_api_key
MCP_PORT=8000
MCP_HOST=0.0.0.0
SCHEMA_CACHE_PATH=./schema_cache
  1. Optional: Erstellen Sie eine Standard-Konfiguration für MCP-Prompts:
./generate_prompts.py

Dies erstellt eine mcp_prompts.json-Datei mit Standardvorlagen für Prompts und Toolbeispiele.

Verwendung

Server starten

python -m app

Der Server wird standardmäßig auf Port 8000 gestartet.

Verbindung mit MCP Inspector

npx @modelcontextprotocol/inspector python -m app

Öffnen Sie den MCP Inspector und verbinden Sie sich mit Ihrem Server (z.B. ws://localhost:8000/sse).

HTTP REST-API verwenden

Die REST-API ist parallel zum MCP-Server auf Port 8000 verfügbar. Beispiele für Endpunkte:

  • GET /api/schema – Gibt das gesamte Datenbankschema zurück
  • GET /api/schema/tables – Gibt eine Liste aller Tabellen zurück
  • GET /api/schema/tables/{table_name} – Gibt das Schema einer bestimmten Tabelle zurück
  • GET /api/schema/views – Gibt eine Liste aller Views zurück
  • GET /api/schema/views/{view_name} – Gibt das Schema einer bestimmten View zurück
  • GET /api/schema/relationships – Gibt alle Tabellenbeziehungen zurück
  • POST /api/query – Führt eine Read-Only-SQL-Abfrage aus (JSON: { "query": "SELECT ..." })
  • POST /api/schema/refresh – Aktualisiert den Schema-Cache

Beispiel für eine SQL-Abfrage per curl:

curl -X POST http://localhost:8000/api/query -H "Content-Type: application/json" -d '{"query": "SELECT TOP 5 * FROM BeispielTabelle"}'

MCP-Ressourcen

Der Server stellt folgende MCP-Ressourcen bereit:

  • resource://database_schema – Das vollständige Datenbankschema
  • table://{table_name} – Schema jeder Tabelle
  • view://{view_name} – Schema jeder View
  • resource://relationships – Beziehungen zwischen den Tabellen

MCP-Tools

Der Server stellt folgende MCP-Tools bereit:

  • execute_sql – Führt eine Read-Only-SQL-Abfrage aus
  • get_table_sample – Gibt eine Stichprobe der Daten einer Tabelle zurück
  • refresh_schema – Aktualisiert den Schema-Cache

Testen des Servers

Das Repository enthält ein Test-Skript, mit dem die grundlegende Funktionalität des Servers überprüft werden kann:

# Server in einem Terminal starten
python -m app

# In einem anderen Terminal das Test-Skript ausführen
./test_server.py

Das Test-Skript prüft die MCP-Serverfunktionalität und kann auch REST-API-Endpunkte testen.

Beispiel für MCP-Anfragen

SQL-Abfrage ausführen

{
  "resources": [],
  "tools": [
    {
      "id": "execute_sql",
      "parameters": {
        "query": "SELECT TOP 10 * FROM BeispielTabelle"
      }
    }
  ]
}

Tabellendaten abrufen

{
  "resources": [],
  "tools": [
    {
      "id": "get_table_sample",
      "parameters": {
        "table_name": "BeispielTabelle",
        "limit": 5
      }
    }
  ]
}

Integration mit LLMs

Dieser MCP-Server ist kompatibel mit jedem LLM, das das Model-Context-Protocol unterstützt.

Beispiel-Prompts

Datenbankanalyse

Analysiere die Tabelle [TabellenName] und beschreibe ihre Struktur und Beziehungen.

Datenabfrage

Schreibe eine SQL-Abfrage, um [Geschäftsfrage] zu beantworten.

Schema-Erkundung

Finde alle Tabellen und Spalten, die mit [Suchbegriff] zu tun haben könnten.

Lizenz

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured