LLM Chat MCP server
llm-chat-mcp
Continue.dev の config.yaml で設定された LLM モデルと対話するための MCP サーバー。
機能
エージェントが設定済みのモデルを確認し、チャットリクエストを送信できる 4 つのツールを公開します:
llm_chat_list_models— 設定内のすべてのモデルを名前と ID とともに一覧表示しますllm_chat_get_model_params— 任意のモデルのパラメータ(temperature、topP など)を確認しますllm_chat_get_model_prompt— モデルに設定されたシステムプロンプトを読み取りますllm_chat_send_request— モデルとチャットし、必要に応じてパラメータを上書きしたり、ファイルからプロンプトを読み込んだりします
Related MCP server: Polybrain MCP Server
インストール
pip install -e .または、インストールせずにソースから直接実行できます。
CLI の使用方法
python -m llm_chat_mcp --default-model "GLM-5.2-FP8"
python -m llm_chat_mcp --config /path/to/config.yaml --default-model "ModelName"
python -m llm_chat_mcp --help引数 | 説明 | デフォルト |
| config.yaml へのパス |
|
| send_request のデフォルトモデル | (なし) |
| リクエストのタイムアウト(秒) |
|
| 相対出力ファイルパスを解決するためのベースディレクトリ | (プロセスカレントディレクトリ) |
| レスポンスが | (OS の一時ディレクトリ) |
設定
設定はリクエストごとに再読み込みされます — 再起動は不要です
認証には config.yaml の各モデルエントリの
apiKeyを使用しますモデルが指定されていない場合(CLI でもツール呼び出しでもない場合)、エラーが設定方法を示します
llm_chat_send_request のパラメータ
メインツールです。LLM にチャット完了リクエストを送信し、レスポンスを返します。
入力パラメータ
パラメータ | 型 | デフォルト | 説明 |
| str | (CLI デフォルト) | config.yaml のモデル名または ID |
| str | (なし) | 送信するプロンプトテキスト |
| list | (なし) | ファイル仕様のリスト(文字列パスまたは |
| bool |
| 各ファイル行の先頭に |
| str | (設定から) | システムメッセージを上書きします。 |
| float | (設定から) | サンプリングパラメータ |
| int/float | (設定から) | 生成パラメータ |
| dict | (なし) | API リクエストにマージされる追加のボディプロパティ |
| bool |
| レスポンスに推論/思考コンテンツを含めます |
| float | (CLI デフォルト) | リクエストごとのタイムアウトの上書き |
| str | (なし) | 完全なレスポンスをこのファイルに書き込みます(相対パスは |
| bool |
|
|
| int |
| インラインで返されるコンテンツの最大文字数。プレビューはファイルが書き込まれる場合のみ適用されます |
| int |
|
|
レスポンス構造
常に JSON として返されます:
{
"content": "<preview, full content, or empty>",
"truncated": true,
"metadata": {
"model_name": "...",
"model": "...",
"elapsed_seconds": 1.23,
"request_sent": {...},
"response_headers": {...},
"response_chars": 1234,
"output_file": "...",
"auto_output_file": "...",
"created_dirs": [...],
"appended_line_start": 201,
"appended_line_end": 250
}
}出力戦略
ツールはパラメータとレスポンスサイズに基づいて、次の 3 つの戦略のいずれかを選択します:
明示ファイル(
output_file_path設定時): 完全なレスポンスがファイルに書き込まれます。append=trueの場合、レスポンスは追記され、appended_line_start/appended_line_end(1 始まり、両端含む)が返されるため、呼び出し元はextract_linesで追記部分のみを読み取れます。自動ファイル(
output_file_pathなし、auto_file_threshold > 0、response_chars > threshold): 完全なレスポンスが--auto-output-dir(または OS の一時ディレクトリ)に自動生成されたファイルに書き込まれます。ファイル名形式:llm_output_<YYYYMMDD_HHMMSS>_<6-char-uuid>.jsonインラインのみ(ファイル書き込みなし): 完全なコンテンツが
contentフィールドに返されます。
インラインプレビュー
ファイルが書き込まれる場合(明示または自動)、content フィールドにはレスポンスのプレビューが含まれます:
inline_preview_chars > 0かつlen(content) > inline_preview_charsの場合: 末尾に[truncated, full response in <file_path>]を付けた切り詰めプレビュー。inline_preview_chars > 0かつlen(content) <= inline_preview_charsの場合: 完全なコンテンツ(プレビューに収まる)。inline_preview_chars == 0の場合:contentは空(ファイルに完全なレスポンスが含まれる)。
ファイルが書き込まれない場合、inline_preview_chars に関係なく完全なコンテンツがインラインで返されます。これによりデータ損失を防ぎます。
Continue.dev との統合
.continue/mcpServers/llm-chat.yaml に追加:
name: LLM Chat MCP server
version: 0.2.0
schema: v1
mcpServers:
- name: LLM Chat MCP server
command: python
args:
- "-m"
- "llm_chat_mcp"
- "--default-model"
- "GLM-5.2-FP8"
- "--timeout"
- "570"
- "--relative_paths_base"
- "/path/to/your/workspace"
- "--auto-output-dir"
- "/path/to/your/workspace/.continue/skills/large-tasks/tmp-outputs"
env:
PYTHONPATH: "/path/to/llm-chat-mcp"その後、Continue.dev をリロードします。
プロジェクト構造
llm-chat-mcp/
├── pyproject.toml # Dependencies: mcp, pyyaml, httpx
├── README.md # This file
├── llm_chat_mcp/
│ ├── __init__.py
│ ├── __main__.py # CLI entry point + tool registration
│ ├── config.py # Config loading, model resolution
│ └── api.py # API client, error handling
└── tests/
└── test_output_strategies.py # Tests for append, inline_preview, auto_fileテスト
python tests/test_output_strategies.pyテストは API 呼び出しをモックし、ファイル書き込みとレスポンス組み立てロジックを検証します。output_file_path、append、inline_preview_chars、auto_file_threshold のすべての組み合わせをカバーします。
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Messaging tools for AI agents: send messages, manage chats, groups and channels.
Manage portable AI agent playbooks, Agent Skills, MCP configurations, personas, and memory.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with locally running Ollama models through chat, generation, and model management operations. Supports listing, downloading, and deleting models while maintaining conversation history for interactive sessions.359 npmMIT
- AlicenseAqualityDmaintenanceEnables AI agents to connect to and chat with multiple LLM models (OpenAI, OpenRouter, custom endpoints) with conversation history management and model switching capabilities.314 npm2MIT
- AlicenseNot gradedqualityDmaintenanceProvides tools to interact with OpenAI API including chat completions, embeddings, content moderation, and file management through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceEnables local task execution using the user's NVIDIA NIM API quota, with tools to process file contents through LLMs, send chat prompts, and list available models.189 npmMIT