LLM MCP Bridge

LLM MCP Bridge

Provides a universal bridge to interact with any OpenAI-compatible LLM API (local or cloud), enabling model testing, benchmarking, quality evaluation, and chat operations with performance metrics.

Category
访问服务器

README

LLM MCP Bridge 🌉

Un servidor MCP (Model Context Protocol) agnóstico para cualquier API compatible con OpenAI. Permite analizar y evaluar la calidad de modelos LLM.

🎯 Proveedores Soportados

Cualquier servidor que implemente la OpenAI API:

Proveedor URL Base Típica
LM Studio http://localhost:1234/v1
Ollama http://localhost:11434/v1
vLLM http://localhost:8000/v1
LocalAI http://localhost:8080/v1
llama.cpp http://localhost:8080/v1
OpenAI https://api.openai.com/v1
Azure OpenAI https://{resource}.openai.azure.com/
Together.ai https://api.together.xyz/v1
Groq https://api.groq.com/openai/v1
Anyscale https://api.endpoints.anyscale.com/v1

🛠️ Herramientas MCP Disponibles

Herramienta Descripción
llm_get_models Obtiene lista de modelos (JSON)
llm_status Verifica conexión con el servidor
llm_list_models Lista modelos (formato legible)
llm_chat Chat con métricas de rendimiento
llm_benchmark Benchmark con múltiples prompts
llm_evaluate_coherence Evalúa consistencia del modelo
llm_test_capabilities Test en diferentes áreas
llm_compare_models Compara múltiples modelos
llm_quality_report Reporte completo de calidad

Parámetros Configurables en Chat

Todas las herramientas aceptan baseURL y apiKey opcionales para override de conexión.

Parámetro Descripción Default
prompt Texto a enviar al modelo requerido
model ID del modelo modelo por defecto
maxTokens Máximo de tokens 512
temperature Temperatura (0-2) 0.7
topP Nucleus sampling (0-1) -
topK Top K sampling -
repeatPenalty Penalización repetición -
presencePenalty Penalización presencia -
frequencyPenalty Penalización frecuencia -
stop Secuencias de parada -
systemPrompt Prompt de sistema -

📋 Requisitos

  • Node.js >= 18
  • Un servidor LLM con API compatible con OpenAI

🚀 Instalación

cd llm-mcp-bridge
npm install
npm run build

⚙️ Configuración en VS Code

Añade a tu archivo mcp.json de VS Code:

LM Studio (local)

{
  "servers": {
    "llm-local": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "http://localhost:1234/v1"
      }
    }
  }
}

Ollama

{
  "servers": {
    "ollama": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "http://localhost:11434/v1"
      }
    }
  }
}

OpenAI

{
  "servers": {
    "openai": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "https://api.openai.com/v1",
        "LLM_API_KEY": "sk-..."
      }
    }
  }
}

Groq

{
  "servers": {
    "groq": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "https://api.groq.com/openai/v1",
        "LLM_API_KEY": "gsk_..."
      }
    }
  }
}

Múltiples proveedores

{
  "servers": {
    "llm-lmstudio": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "http://localhost:1234/v1"
      }
    },
    "llm-ollama": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "http://localhost:11434/v1"
      }
    },
    "llm-openai": {
      "type": "stdio",
      "command": "node",
      "args": ["/ruta/a/llm-mcp-bridge/dist/index.js"],
      "env": {
        "LLM_BASE_URL": "https://api.openai.com/v1",
        "LLM_API_KEY": "sk-..."
      }
    }
  }
}

🔧 Variables de Entorno

Variable Descripción Default
LLM_BASE_URL URL del servidor LLM http://localhost:1234/v1
LLM_API_KEY API Key (requerida para servicios cloud) -

📖 Ejemplos de Uso

Verificar conexión

@llm_status

Obtener modelos (JSON)

@llm_get_models

Chat con métricas

@llm_chat prompt="Explica qué es machine learning" temperature=0.5 maxTokens=256

Chat con otro servidor (override)

@llm_chat prompt="Hola" baseURL="http://localhost:11434/v1"

Benchmark

@llm_benchmark prompts=["Hola", "¿Qué hora es?", "Cuenta hasta 10"]

Reporte de calidad

@llm_quality_report

Comparar modelos

@llm_compare_models prompt="Escribe un haiku sobre la luna"

🏗️ Estructura del Proyecto

llm-mcp-bridge/
├── src/
│   ├── index.ts       # Servidor MCP principal
│   ├── llm-client.ts  # Cliente OpenAI-compatible
│   └── tools.ts       # Definiciones de herramientas MCP
├── dist/              # Código compilado
├── package.json
├── tsconfig.json
└── README.md

📊 Métricas de Calidad

El servidor analiza:

  • Latencia: Tiempo total de respuesta (ms)
  • Tokens/segundo: Velocidad de generación
  • Coherencia: Consistencia entre múltiples ejecuciones
  • Capacidades: Rendimiento en diferentes tipos de tareas
    • Razonamiento
    • Programación
    • Creatividad
    • Conocimiento factual
    • Seguir instrucciones

🤝 Contribuir

¡Las contribuciones son bienvenidas! Abre un issue o pull request.

📄 Licencia

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选