Open Policy Agent (OPA) REST API MCP Server
MCP-Server
Dieses Projekt ist ein MCP-Server (Multi-Agent Conversation Protocol) für die angegebene OpenAPI-URL – https://api.apis.guru/v2/specs/openpolicy.local/0.28.0/openapi.json , automatisch generiert mit dem MCP-Builder von AG2.
Voraussetzungen
Python 3.9+
Pip und UV
Related MCP server: swaggbot
Installation
Klonen Sie das Repository:
git clone <repository-url> cd mcp-serverAbhängigkeiten installieren: Das Skript .devcontainer/setup.sh übernimmt die Installation von Abhängigkeiten mit
pip install -e ".[dev]". Wenn Sie den Dev-Container nicht verwenden, können Sie diesen Befehl manuell ausführen.pip install -e ".[dev]"Alternativ können Sie
uvverwenden:uv pip install --editable ".[dev]"
Entwicklung
Dieses Projekt verwendet ruff zum Lint-Test und Formatieren, mypy zur statischen Typprüfung und pytest zum Testen.
Lintierung und Formatierung
So prüfen Sie, ob Probleme mit der Flusenbildung vorliegen:
ruff checkSo formatieren Sie den Code:
ruff formatDiese Befehle sind auch über das Skript scripts/lint.sh verfügbar.
Statische Analyse
So führen Sie eine statische Analyse aus (mypy, bandit, semgrep):
./scripts/static-analysis.shDieses Skript ist auch als Pre-Commit-Hook in .pre-commit-config.yaml konfiguriert.
Ausführen von Tests
So führen Sie Tests mit Abdeckung durch:
./scripts/test.shDadurch wird pytest ausgeführt und ein Abdeckungsbericht generiert. Für einen kombinierten Bericht und eine Bereinigung können Sie Folgendes verwenden:
./scripts/test-cov.shPre-Commit-Hooks
Dieses Projekt verwendet Pre-Commit-Hooks, die in .pre-commit-config.yaml definiert sind. So installieren Sie die Hooks:
pre-commit installDie Hooks werden vor jedem Commit automatisch ausgeführt.
Ausführen des Servers
Der MCP-Server kann mit dem Skript mcp_server/main.py gestartet werden. Er unterstützt verschiedene Transportmodi (z. B. stdio , sse ).
So starten Sie den Server (z. B. im Standardmodus):
python mcp_server/main.py stdioDer Server kann mithilfe von Umgebungsvariablen konfiguriert werden:
CONFIG_PATH: Pfad zu einer JSON-Konfigurationsdatei (z. B. mcp_server/mcp_config.json ).CONFIG: Eine JSON-Zeichenfolge, die die Konfiguration enthält.SECURITY: Umgebungsvariablen für Sicherheitsparameter (z. B. API-Schlüssel).
Weitere Informationen zum Laden finden Sie im Block if __name__ == "__main__": in mcp_server/main.py .
Die Datei tests/test_mcp_server.py zeigt, wie Sie den Server zum Testen programmgesteuert starten und mit ihm interagieren.
Erstellen und Veröffentlichen
Dieses Projekt verwendet Hatch zum Erstellen und Veröffentlichen. So erstellen Sie das Projekt:
hatch buildSo veröffentlichen Sie das Projekt:
hatch publishDiese Befehle sind auch über das Skript scripts/publish.sh verfügbar.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceThis MCP Server provides a natural language interface to interact with Google's Policy Analyzer API, allowing users to analyze policies and evaluate compliance through conversations.-
- AlicenseNot gradedqualityDmaintenanceTransforms Swagger/OpenAPI documented APIs into conversational interfaces, enabling natural language interaction with APIs through an MCP server for use with AI assistants.4MIT
- AlicenseCqualityDmaintenanceAn MCP server that exposes Oracle Cloud Infrastructure (OCI) control plane to LLM clients, enabling management of compute, networking, storage, databases, and more through natural language.551Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA lightweight MCP server that enables natural language interaction with Kubernetes clusters, allowing management of pods, deployments, namespaces, and cluster resources through conversational queries or API endpoints.1MIT
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/ag2-mcp-servers/open-policy-agent-opa-rest-api'
If you have feedback or need assistance with the MCP directory API, please join our Discord server