Model Context Protocol (MCP) Server
LangChain / Python を使用した MCP クライアント
このシンプルなモデル コンテキスト プロトコル (MCP)クライアントは、LangChain ReAct Agent による MCP サーバー ツールの使用方法を示します。
これは、 langchain_mcp_toolsのユーティリティ関数convert_mcp_to_langchain_tools()を活用します。
この関数は、指定された複数の MCP サーバーの並列初期化を処理し、使用可能なツールを LangChain 互換ツールのリスト ( List[BaseTool] ) に変換します。
現在、Anthropic、OpenAI、Groq の LLM がサポートされています。
このMCPクライアントのTypescriptバージョンはここから入手できます。
前提条件
Related MCP server: Just Prompt
設定
依存関係をインストールします:
make installAPI キーの設定:
cp .env.template .env必要に応じて
.envを更新します。.gitignoreは、資格情報の誤ったコミットを防ぐために.env無視するように設定されています。
必要に応じて、LLM および MCP サーバーの設定
llm_mcp_config.json5を構成します。MCP サーバーの構成ファイル形式は、 Claude for Desktopと同じ構造に従いますが、1 つの違いがあります。キー名
mcpServersは、JSON 構成ファイルで一般的に使用される snake_case 規則に従うためにmcp_serversに変更されています。ファイル形式はJSON5で、コメントと末尾のコンマが許可されます。
形式はさらに拡張され、
${...}表記が対応する環境変数の値に置き換えられます。すべての資格情報と個人情報を
.envファイルに保存し、必要に応じて${...}表記で参照します。
使用法
アプリを実行します:
make start初回実行時には多少時間がかかります。
詳細モードで実行:
make start-vコマンドラインオプションを参照してください:
make start-hプロンプトで Enter キーを押すだけで、MCP サーバー ツールの呼び出しを実行するサンプル クエリを使用できます。
クエリの例はllm_mcp_config.json5で設定できます。
Available Tools
2 toolsget-alertsC
Get weather alerts for a US state
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | Two-letter US state code (e.g. CA, NY) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry full behavioral transparency. It only states the basic action without disclosing traits like read-only nature, authentication requirements, rate limits, or what type of alerts are returned. This is insufficient for an agent to understand the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, achieving conciseness. It is appropriately front-loaded with the verb and resource. However, it lacks structure such as prerequisites or return format, but it remains efficient for its length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (one required parameter, no output schema, no annotations), the description should provide more context, such as what the alerts contain or that it is a read operation. The minimal description leaves gaps for an agent to understand the tool's full context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for the 'state' parameter, so the baseline is 3. The description does not add any additional meaning beyond the schema; it simply restates the parameter's role without further context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('weather alerts') with a specific scope ('for a US state'). It distinguishes itself from the sibling 'get-forecast' by focusing on alerts, not forecasts, though it does not explicitly mention the sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'get-forecast'. The description does not include any prerequisites, context, or exclusions, leaving the agent to infer usage from tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-forecastB
Get weather forecast for a location in the US
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Latitude of the location | |
| longitude | Yes | Longitude of the location |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose any behavioral traits such as data source, update frequency, or limitations of the forecast. The description only states the basic purpose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that immediately communicates the tool's purpose. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with two parameters and no output schema, the description is minimal but covers the core purpose. However, it lacks usage guidance and behavioral details that would help an AI agent use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with both parameters described. The description adds no additional meaning beyond the schema; the mention of 'in the US' is a location constraint but not parameter-specific. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Get', the resource 'weather forecast', and the scope 'for a location in the US'. It distinguishes from the sibling tool 'get-alerts' which likely deals with alerts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description does not indicate when to prefer this over 'get-alerts' or any other context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.3.2- First observed
get-alerts - First observed
get-forecast
TDQS
Scored across 2 tools
The tools get-alerts and get-forecast have clearly distinct purposes: one provides weather alerts, the other gives forecasts. No overlap.
Both tool names follow the consistent pattern 'get-<resource>', using lowercase and hyphens, which is predictable.
With only 2 tools, the server feels too sparse for a weather domain. Typically, more operations like current conditions or radar would be expected.
The tool set only covers alerts and forecasts, missing common weather operations like current conditions, location search, or severe weather warnings, resulting in significant gaps.
Maintenance
Related MCP Connectors
AI routing, memory, guardrails, and governance. Routes across Claude, GPT, Gemini.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Furgonetka MCP Server is an extension for LLMs (such as Claude) that integrates AI assistants with Poland's most popular courier brokerage platform. The server enables models to interact directly with services from various couriers (including InPost, DPD, DHL, UPS, and Poczta Polska) through a single, unified interface. With this integration, your AI stops just "writing about logistics" and starts actually managing it.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceThis server provides an API to query Large Language Models using context from local files, supporting various models and file types for context-aware responses.1-
- FlicenseBqualityDmaintenanceA lightweight MCP server that provides a unified interface to various LLM providers including OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama.6738-
- AlicenseNot gradedqualityDmaintenanceA simple server that acts as a Master Control Program (MCP) for unified interaction with OpenAI and Anthropic (Claude) AI models through a single API endpoint.23 npmMIT
- FlicenseNot gradedqualityDmaintenanceA unified API server that enables interaction with multiple AI model providers like Anthropic and OpenAI through a consistent interface, supporting chat completions, tool calling, and context handling.-