MCP LangChainJS Search Server
Enables searching the langchain-ai/langchainjs GitHub repository for TypeScript/JavaScript/Markdown code snippets using the search_langchain tool.
README
MCP LangChainJS Server
Serveur MCP (Model Context Protocol) en TypeScript permettant de rechercher des exemples et du code dans le dépôt GitHub LangChainJS (langchain-ai/langchainjs). Il expose un outil search_langchain que les clients MCP (ex. Claude Desktop) peuvent appeler pour retrouver rapidement des snippets TS/JS/MD pertinents.
Aperçu
- Outil principal:
search_langchain - Source: GitHub Search Code API via
@octokit/rest - Transport:
stdio(pour intégration avec clients MCP) - Langage: TypeScript (build vers
dist/)
Prérequis
- Node.js 18+ et npm
- (Optionnel) Un jeton GitHub personnel pour des quotas plus généreux
- Variable d’environnement:
GITHUB_TOKEN
- Variable d’environnement:
Installation
npm install
npm run build
Démarrage
- Développement (TypeScript, sans build):
npm run dev
- Watch (redémarrage auto):
npm run watch
- Production (depuis
dist/):
npm start
Le serveur écoute via stdio et est destiné à être lancé par un client MCP.
Configuration du client MCP (ex. Claude Desktop)
Exemple de configuration Claude Desktop (à adapter à votre chemin local) :
{
"mcpServers": {
"langchain-js": {
"command": "node",
"args": [
"/chemin/vers/votre/projet/dist/index.js"
],
"env": {
"GITHUB_TOKEN": "votre_token_optionnel"
}
}
}
}
Notes:
GITHUB_TOKENest recommandé pour éviter les limitations strictes de l’API publique.- Ne commitez jamais de secrets. Préférez des variables d’environnement ou un fichier
.envignoré par Git.
Variables d’environnement
Vous pouvez fournir un jeton GitHub pour augmenter les limites d’API :
export GITHUB_TOKEN=ghp_xxx_votre_token
Ou via un fichier .env (non commité) si votre outil de lancement le supporte.
Outils exposés
search_langchain- Entrée:
query(string, requis): la requête de recherche (TS/JS/MD)
- Sortie (texte): liste des correspondances avec nom, chemin, et URL HTML
- Entrée:
Exemple d’appel (côté client MCP):
{
"name": "search_langchain",
"arguments": { "query": "RetrievalQA" }
}
Architecture
src/index.ts: serveur MCP + transportstdio, enregistrement des handlerssrc/tools/search.ts: schéma de l’outil et handlersearch_langchainsrc/github-client.ts: client GitHub (Octokit) pour recherche et lecture de contenusrc/types.ts: types internes (exemples, résultats)
Scripts npm
npm run dev: exécutesrc/index.tsavects-nodenpm run watch: redémarre avecnodemonsur changementsnpm run build: compile TypeScript versdist/npm start: lancenode dist/index.js
Dépannage
- Erreurs 403/abuse/ratelimit: fournissez
GITHUB_TOKEN. - Résultats vides: vérifiez la requête (
query) et les extensions ciblées (TS/JS/MD). - Import/ESM: le projet est configuré en
type: commonjsavects-nodeadapté; utiliseznpm run buildpuisnpm starten prod.
Sécurité
- Ne mettez jamais un jeton en clair dans le dépôt.
- Préférez des variables d’environnement et des gestionnaires de secrets.
Licence
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.