llm-mcp-bridge

ramgeart/llm-mcp-bridge

3.2

If you are the rightful owner of llm-mcp-bridge and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The LLM MCP Bridge is a versatile server designed to interface with any API compatible with OpenAI, enabling the analysis and evaluation of LLM models.

Tools
9
Resources
0
Prompts
0

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:

ProveedorURL Base Típica
LM Studiohttp://localhost:1234/v1
Ollamahttp://localhost:11434/v1
vLLMhttp://localhost:8000/v1
LocalAIhttp://localhost:8080/v1
llama.cpphttp://localhost:8080/v1
OpenAIhttps://api.openai.com/v1
Azure OpenAIhttps://{resource}.openai.azure.com/
Together.aihttps://api.together.xyz/v1
Groqhttps://api.groq.com/openai/v1
Anyscalehttps://api.endpoints.anyscale.com/v1

🛠️ Herramientas MCP Disponibles

HerramientaDescripción
llm_get_modelsObtiene lista de modelos (JSON)
llm_statusVerifica conexión con el servidor
llm_list_modelsLista modelos (formato legible)
llm_chatChat con métricas de rendimiento
llm_benchmarkBenchmark con múltiples prompts
llm_evaluate_coherenceEvalúa consistencia del modelo
llm_test_capabilitiesTest en diferentes áreas
llm_compare_modelsCompara múltiples modelos
llm_quality_reportReporte completo de calidad

Parámetros Configurables en Chat

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

ParámetroDescripciónDefault
promptTexto a enviar al modelorequerido
modelID del modelomodelo por defecto
maxTokensMáximo de tokens512
temperatureTemperatura (0-2)0.7
topPNucleus sampling (0-1)-
topKTop K sampling-
repeatPenaltyPenalización repetición-
presencePenaltyPenalización presencia-
frequencyPenaltyPenalización frecuencia-
stopSecuencias de parada-
systemPromptPrompt 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

VariableDescripciónDefault
LLM_BASE_URLURL del servidor LLMhttp://localhost:1234/v1
LLM_API_KEYAPI 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