Skip to main content
Glama

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

/llm-costs

Echtzeit-LLM-Preisdaten verschiedener Anbieter

/model-benchmarks

Modell-Leistungs-Benchmarks und Vergleiche

/api-deprecations

Verfolgung veralteter API-Versionen und Migrationspfade

/quality-scores

KI-Modell-Qualitäts-Scores mit Sentiment-Analyse

/agent-spend

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 install

Umgebungseinrichtung

Kopieren Sie .env.example nach .env und konfigurieren Sie:

cp .env.example .env

Erforderliche Variablen:

  • NEON_DATABASE_URL - Neon Postgres Verbindungszeichenfolge

  • FIRECRAWL_API_KEY - Firecrawl API-Key

  • STRIPE_SECRET_KEY - Stripe Secret Key

  • STRIPE_STARTER_PRICE_ID - Stripe Preis-ID für die Starter-Stufe

  • STRIPE_PRO_MONTHLY_PRICE_ID - Stripe Preis-ID für die Pro-Stufe

  • STRIPE_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.ts

Entwicklung

npm run dev

Bereitstellung

npm run deploy

API-Dokumentation

Authentifizierung

Alle Endpunkte erfordern einen API-Key über Header oder Abfrageparameter:

X-API-Key: your-api-key
# or
?api_key=your-api-key

Endpunkte

GET /llm-costs

Gibt LLM-Preisdaten zurück.

curl -H "X-API-Key: your-key" https://your-worker.workers.dev/llm-costs

GET /model-benchmarks

Gibt Modell-Benchmark-Ergebnisse zurück.

curl -H "X-API-Key: your-key" https://your-worker.workers.dev/model-benchmarks

GET /api-deprecations

Gibt veraltete API-Versionen zurück.

curl -H "X-API-Key: your-key" https://your-worker.workers.dev/api-deprecations

GET/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-spend

GET /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 Firecrawl

CI/CD

GitHub Actions Workflow (.github/workflows/deploy.yml):

  • Läuft bei Push auf main

  • Typ-Prüfung mit TypeScript

  • Bereitstellung auf Cloudflare Workers

Erforderliche GitHub-Secrets:

  • CLOUDFLARE_API_TOKEN

  • CLOUDFLARE_ACCOUNT_ID

  • NEON_DATABASE_URL

  • FIRECRAWL_API_KEY

  • STRIPE_SECRET_KEY

  • STRIPE_STARTER_PRICE_ID

  • STRIPE_PRO_MONTHLY_PRICE_ID

  • STRIPE_SCALE_MONTHLY_PRICE_ID

Lizenz

MIT

Support

Für Probleme und Funktionsanfragen nutzen Sie bitte den GitHub Issue Tracker.

F
license - not found
-
quality - not tested
C
maintenance

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