AgentLayer MCP Server
AgentLayer MCP-Server
Ein Model Context Protocol (MCP) Server, der Echtzeit-KI-Infrastrukturdaten über TypeScript + Hono auf Cloudflare Workers bereitstellt.
Übersicht
Der AgentLayer MCP-Server stellt 5 Endpunkte für die Nutzung durch KI-Agenten bereit:
Endpunkt | Beschreibung |
| Echtzeit-LLM-Preisdaten verschiedener Anbieter |
| Modell-Leistungs-Benchmarks und Vergleiche |
| Verfolgung veralteter API-Versionen und Migrationspfade |
| KI-Modell-Qualitäts-Scores mit Sentiment-Analyse |
| Verfolgung von Agenten-API-Ausgaben mit Unterstützung für x402-Mikrozahlungen |
Funktionen
Authentifizierung: API-Key-Authentifizierung für alle Endpunkte
Ratenbegrenzung: Konfigurierbare Limits pro API-Key
Nutzungsprotokollierung: Vollständige Anfragen-/Antwort-Protokollierung
Fehlerbehandlung: Umfassende Fehlerbehandlung mit aussagekräftigen Antworten
x402-Mikrozahlungen: Native Unterstützung für das x402-Zahlungsprotokoll
Stripe-Abrechnung: Abonnement-Stufen (Starter $99/Monat, Pro $299/Monat, Scale $499/Monat)
Sentiment-Analyse: Automatisches Reddit/HN-Scraping für Modell-Sentiment-Scores
Tech-Stack
Laufzeitumgebung: Cloudflare Workers
Framework: Hono (leichtgewichtig, schnell)
Sprache: TypeScript
Datenbank: Neon Postgres (serverless)
Zahlungen: Stripe + x402-Protokoll
Datenaufnahme: Firecrawl API
Schnellstart
Voraussetzungen
Node.js 20+
Cloudflare-Konto
Neon-Datenbank
Stripe-Konto
Firecrawl API-Key
Installation
npm installUmgebungseinrichtung
Kopieren Sie .env.example nach .env und konfigurieren Sie:
cp .env.example .envErforderliche Variablen:
NEON_DATABASE_URL- Neon Postgres VerbindungszeichenfolgeFIRECRAWL_API_KEY- Firecrawl API-KeySTRIPE_SECRET_KEY- Stripe Secret KeySTRIPE_STARTER_PRICE_ID- Stripe Preis-ID für die Starter-StufeSTRIPE_PRO_MONTHLY_PRICE_ID- Stripe Preis-ID für die Pro-StufeSTRIPE_SCALE_MONTHLY_PRICE_ID- Stripe Preis-ID für die Scale-Stufe
Datenbankeinrichtung
# Apply schema to Neon
npx tsx scripts/setup-neon-db.ts
# Verify tables created
npx tsx scripts/verify-db.tsEntwicklung
npm run devBereitstellung
npm run deployAPI-Dokumentation
Authentifizierung
Alle Endpunkte erfordern einen API-Key über Header oder Abfrageparameter:
X-API-Key: your-api-key
# or
?api_key=your-api-keyEndpunkte
GET /llm-costs
Gibt LLM-Preisdaten zurück.
curl -H "X-API-Key: your-key" https://your-worker.workers.dev/llm-costsGET /model-benchmarks
Gibt Modell-Benchmark-Ergebnisse zurück.
curl -H "X-API-Key: your-key" https://your-worker.workers.dev/model-benchmarksGET /api-deprecations
Gibt veraltete API-Versionen zurück.
curl -H "X-API-Key: your-key" https://your-worker.workers.dev/api-deprecationsGET/POST /quality-scores
Qualitäts-Scores mit optionaler Sentiment-Aktualisierung.
# Get scores
curl -H "X-API-Key: your-key" https://your-worker.workers.dev/v1/quality-scores
# Trigger sentiment refresh
curl -H "X-API-Key: your-key" "https://your-worker.workers.dev/v1/quality-scores?refresh=true"POST /agent-spend
Protokollieren Sie Agenten-API-Ausgaben mit Unterstützung für x402-Mikrozahlungen.
curl -X POST -H "X-API-Key: your-key" \
-H "Content-Type: application/json" \
-d '{"agent_id":"agent-123","model":"gpt-4","tokens_used":1500,"cost":0.045,"payment_receipt":"x402-receipt"}' \
https://your-worker.workers.dev/agent-spendGET /agent-spend
Abrufen von Agenten-Ausgabendatensätzen.
curl -H "X-API-Key: your-key" "https://your-worker.workers.dev/agent-spend?agent_id=agent-123"Einreichung beim MCP Hub
Dieser Server implementiert das Model Context Protocol für die Integration von KI-Agenten. Reichen Sie ihn beim MCP Hub ein mit:
Server-Name: agentlayer-mcp-server
Beschreibung: Echtzeit-KI-Infrastrukturdaten (Kosten, Benchmarks, Deprecations, Qualitäts-Scores, Ausgabenverfolgung)
Transport: HTTP mit API-Key-Authentifizierung
Repository: https://github.com/[org]/agentlayer-mcp-server
Architektur
src/
├── index.ts # Main Hono app with all endpoints
├── routes/
│ └── v1-quality-scores.ts # Quality scores route with sentiment refresh
└── scrapers/
└── reddit-hn-sentiment.ts # Reddit/HN sentiment scraper via FirecrawlCI/CD
GitHub Actions Workflow (.github/workflows/deploy.yml):
Läuft bei Push auf
mainTyp-Prüfung mit TypeScript
Bereitstellung auf Cloudflare Workers
Erforderliche GitHub-Secrets:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDNEON_DATABASE_URLFIRECRAWL_API_KEYSTRIPE_SECRET_KEYSTRIPE_STARTER_PRICE_IDSTRIPE_PRO_MONTHLY_PRICE_IDSTRIPE_SCALE_MONTHLY_PRICE_ID
Lizenz
MIT
Support
Für Probleme und Funktionsanfragen nutzen Sie bitte den GitHub Issue Tracker.
This server cannot be installed
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/ToddFisher42/agentlayer-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server