/ Directorio / Playground / mcp-agent-langchainjs
● Oficial Azure-Samples ⚡ Instantáneo

mcp-agent-langchainjs

por Azure-Samples · Azure-Samples/mcp-agent-langchainjs

Azure's official reference — a serverless LangChain.js agent that uses MCP to call a burger-ordering tool API, fully deployable via azd up.

This is an Azure Samples reference app, not an end-user MCP. It shows how to build a serverless LangChain.js agent that integrates MCP for tool calls, deployed to Azure Static Web Apps + Functions + Cosmos DB. The demo is a burger restaurant — but the pattern applies to any tool-using agent you want on Azure.

Por qué usarlo

Características clave

Demo en vivo

Cómo se ve en la práctica

agent-langchainjs.replay ▶ listo
0/0

Instalar

Elige tu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "agent-langchainjs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-langchainjs"
      ],
      "_inferred": true
    }
  }
}

Abre Claude Desktop → Settings → Developer → Edit Config. Reinicia después de guardar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "agent-langchainjs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-langchainjs"
      ],
      "_inferred": true
    }
  }
}

Cursor usa el mismo esquema mcpServers que Claude Desktop. La configuración del proyecto prevalece sobre la global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "agent-langchainjs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-langchainjs"
      ],
      "_inferred": true
    }
  }
}

Haz clic en el icono MCP Servers de la barra lateral de Cline y luego en "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "agent-langchainjs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-langchainjs"
      ],
      "_inferred": true
    }
  }
}

Mismo formato que Claude Desktop. Reinicia Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "agent-langchainjs",
      "command": "npx",
      "args": [
        "-y",
        "mcp-agent-langchainjs"
      ]
    }
  ]
}

Continue usa un array de objetos de servidor en lugar de un mapa.

~/.config/zed/settings.json
{
  "context_servers": {
    "agent-langchainjs": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-agent-langchainjs"
        ]
      }
    }
  }
}

Añádelo a context_servers. Zed recarga en caliente al guardar.

claude mcp add agent-langchainjs -- npx -y mcp-agent-langchainjs

Un solo comando. Verifica con claude mcp list. Quita con claude mcp remove.

Casos de uso

Usos del mundo real: mcp-agent-langchainjs

Bootstrap a serverless agent on Azure with MCP tool calls

👤 Azure devs building AI features ⏱ ~120 min advanced

Cuándo usarlo: You want to ship an LLM-powered feature on Azure and need a working reference to fork.

Requisitos previos
  • Azure subscription — azure.microsoft.com — free tier covers dev
  • Azure Developer CLIbrew install azd or Windows installer
Flujo
  1. Fork and deploy
    Fork Azure-Samples/mcp-agent-langchainjs and walk me through azd up to deploy to my Azure sub.✓ Copiado
    → Live Azure URL + Functions + Cosmos provisioned
  2. Swap the demo tool
    Replace the burger-ordering MCP with a custom MCP for my domain (e.g. appointment booking). Show me the wiring.✓ Copiado
    → Code diff + working custom tool
  3. Customize the UI
    The sample has a chat UI; customize brand/colors and the welcome message.✓ Copiado
    → Styled app

Resultado: A shippable Azure-hosted agent derived from a vetted sample.

Errores comunes
  • Free-tier Azure OpenAI has low quota — Provision your own OpenAI resource in a region with capacity; set endpoint in env
  • Local Ollama doesn't handle complex tool calls well — Use a cloud model (GPT-4o-mini, etc.) for dev that involves multi-step tool calls

Learn the MCP + LangChain.js integration pattern

👤 Devs new to MCP ⏱ ~60 min intermediate

Cuándo usarlo: You're evaluating MCP and want to see how it plugs into the LangChain.js ecosystem.

Flujo
  1. Read the code
    Summarize how this repo wires MCP to LangChain.js agents. What's the key integration point?✓ Copiado
    → Architecture explanation
  2. Run locally
    Run it in Codespaces. Exercise the burger-order flow. Observe the MCP tool calls in logs.✓ Copiado
    → Working local run + tool call traces

Resultado: Hands-on understanding of the pattern before building your own.

Combinaciones

Combínalo con otros MCPs para multiplicar por 10

agent-langchainjs + github

CI/CD the sample to your own fork

Fork the repo, set up GitHub Actions to azd deploy on push to main.✓ Copiado

Herramientas

Lo que expone este MCP

HerramientaEntradasCuándo llamarCoste
(reference app — not a callable MCP) N/A This is a sample app you deploy, not a tool Claude calls N/A

Coste y límites

Lo que cuesta ejecutarlo

Cuota de API
Azure consumption-based
Tokens por llamada
N/A — you're building the app, not calling it as a tool
Monetario
Varies — cheap on free tier for dev; production costs depend on traffic
Consejo
Use Azure cost alerts early. Cosmos DB can be expensive if mis-provisioned — keep it on serverless tier during dev.

Seguridad

Permisos, secretos, alcance

Almacenamiento de credenciales: Azure Key Vault + Managed Identity (set up by the Bicep templates)
Salida de datos: Entirely within your Azure sub + chosen LLM endpoint

Resolución de problemas

Errores comunes y soluciones

azd up fails: no capacity in region

OpenAI capacity varies by region. Try eastus2, swedencentral, or francecentral.

Functions cold-start slowness

Use Premium plan for prod; Consumption is fine for dev but cold-starts stall early chats.

MCP tool call not recognized

Confirm the LangChain.js tool binding is using the MCP client the sample sets up. Check the imports.

Alternativas

mcp-agent-langchainjs vs otros

AlternativaCuándo usarlaContrapartida
Vercel AI SDK starterYou prefer Vercel / Next.js hostingDifferent cloud; smaller sample
AWS Bedrock Agents + sampleYou're on AWSDifferent stack; Bedrock agents aren't MCP-native

Más

Recursos

📖 Lee el README oficial en GitHub

🐙 Ver issues abiertas

🔍 Ver todos los 400+ servidores MCP y Skills