Skip to main content
Glama

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 — モデルとチャットし、必要に応じてパラメータを上書きしたり、ファイルからプロンプトを読み込んだりします

インストール

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 PATH

config.yaml へのパス

~/.continue/config.yaml

--default-model NAME

send_request のデフォルトモデル

(なし)

--timeout SECONDS

リクエストのタイムアウト(秒)

19

--relative_paths_base PATH

相対出力ファイルパスを解決するためのベースディレクトリ

(プロセスカレントディレクトリ)

--auto-output-dir PATH

レスポンスが auto_file_threshold を超え、output_file_path が設定されていない場合に自動生成される出力ファイルのディレクトリ

(OS の一時ディレクトリ)

設定

  • 設定はリクエストごとに再読み込みされます — 再起動は不要です

  • 認証には config.yaml の各モデルエントリの apiKey を使用します

  • モデルが指定されていない場合(CLI でもツール呼び出しでもない場合)、エラーが設定方法を示します

llm_chat_send_request のパラメータ

メインツールです。LLM にチャット完了リクエストを送信し、レスポンスを返します。

入力パラメータ

パラメータ

デフォルト

説明

model_selector

str

(CLI デフォルト)

config.yaml のモデル名または ID

prompt_text

str

(なし)

送信するプロンプトテキスト

prompt_files

list

(なし)

ファイル仕様のリスト(文字列パスまたは {path, start_line, end_line} ディクショナリ)

include_line_numbers

bool

true

各ファイル行の先頭に N: を付加します

system_prompt

str

(設定から)

システムメッセージを上書きします。"" で完全に抑制します

temperature, topP, topK, minP

float

(設定から)

サンプリングパラメータ

maxTokens, presencePenalty, frequencyPenalty

int/float

(設定から)

生成パラメータ

extraParams

dict

(なし)

API リクエストにマージされる追加のボディプロパティ

details

bool

false

レスポンスに推論/思考コンテンツを含めます

timeout

float

(CLI デフォルト)

リクエストごとのタイムアウトの上書き

output_file_path

str

(なし)

完全なレスポンスをこのファイルに書き込みます(相対パスは --relative_paths_base に対して解決されます)

append

bool

false

output_file_path に上書きではなく追記します。appended_line_start/appended_line_end を返します

inline_preview_chars

int

500

インラインで返されるコンテンツの最大文字数。プレビューはファイルが書き込まれる場合のみ適用されます

auto_file_threshold

int

8000

response_chars がこれを超え、output_file_path が設定されていない場合にレスポンスをファイルに自動書き込みします。0 で無効

レスポンス構造

常に 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 つの戦略のいずれかを選択します:

  1. 明示ファイルoutput_file_path 設定時): 完全なレスポンスがファイルに書き込まれます。append=true の場合、レスポンスは追記され、appended_line_start/appended_line_end(1 始まり、両端含む)が返されるため、呼び出し元は extract_lines で追記部分のみを読み取れます。

  2. 自動ファイルoutput_file_path なし、auto_file_threshold > 0response_chars > threshold): 完全なレスポンスが --auto-output-dir(または OS の一時ディレクトリ)に自動生成されたファイルに書き込まれます。ファイル名形式: llm_output_<YYYYMMDD_HHMMSS>_<6-char-uuid>.json

  3. インラインのみ(ファイル書き込みなし): 完全なコンテンツが 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_pathappendinline_preview_charsauto_file_threshold のすべての組み合わせをカバーします。

-
license - not tested
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • LLM chat, text summarization and AI image generation

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolay-martynov/mcp-llm-chat'

If you have feedback or need assistance with the MCP directory API, please join our Discord server