MCP Chat
MCP Chat
MCP Chat は、Anthropic API を通じて AI モデルとの対話型チャット機能を実現するコマンドラインインターフェースアプリケーションです。このアプリケーションは、ドキュメント取得、コマンドベースのプロンプト、および MCP (Model Control Protocol) アーキテクチャによる拡張可能なツール統合をサポートしています。
前提条件
Python 3.9+
Anthropic API Key
Related MCP server: mcp_starter_project
セットアップ
ステップ 1: 環境変数の設定
プロジェクトルートにある
.envファイルを作成または編集し、以下の変数が正しく設定されていることを確認します:
ANTHROPIC_API_KEY="" # Enter your Anthropic API secret keyステップ 2: 依存関係のインストール
オプション 1: uv を使用したセットアップ (推奨)
uv は高速な Python パッケージインストーラー兼リゾルバーです。
uv がまだインストールされていない場合は、インストールします:
pip install uv仮想環境を作成して有効化します:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate依存関係をインストールします:
uv pip install -e .プロジェクトを実行します
uv run main.pyオプション 2: uv を使用しないセットアップ
仮想環境を作成して有効化します:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate依存関係をインストールします:
pip install anthropic python-dotenv prompt-toolkit "mcp[cli]==1.8.0"プロジェクトを実行します
python main.py使用方法
基本的な対話
メッセージを入力して Enter キーを押すだけで、モデルとチャットできます。
ドキュメント取得
@ 記号の後にドキュメント ID を続けて使用すると、クエリにドキュメントの内容を含めることができます:
> Tell me about @deposition.mdコマンド
/ プレフィックスを使用して、MCP サーバーで定義されたコマンドを実行します:
> /summarize deposition.mdTab キーを押すとコマンドが自動補完されます。
開発
新しいドキュメントの追加
mcp_server.py ファイルを編集して、docs ディクショナリに新しいドキュメントを追加します。
MCP 機能の実装
MCP 機能を完全に実装するには:
mcp_server.pyの TODO を完了しますmcp_client.pyの不足している機能を実装します
リンターと型チェック
リンターや型チェックは実装されていません。
Available Tools
2 toolsedit_documentA
Edit a document by replacing a string in the documents content with a new string
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Id of the document that will be edited | |
| new_str | Yes | The new text to insert in place of the old text | |
| old_str | Yes | The text to replace. Must match exactly, including whitespace |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It states that a string is replaced, but does not clarify whether all occurrences are replaced or only the first, nor does it mention that the edit is permanent/mutating, any side effects, or error conditions. This ambiguity is a significant gap for a mutation tool.
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, compact sentence with no filler or redundant restatement of the tool name. It is front-loaded with the action and resource, and every word contributes meaning.
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 3-parameter tool, the description plus full schema coverage is mostly sufficient for an agent to make a call. However, the missing occurrence behavior (all vs. first match) and the absence of an output schema leave some uncertainty about the tool's actual effect and return value, making it minimally complete rather than fully contextualized.
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 covers 100% of the parameters with clear descriptions. The tool description essentially paraphrases the schema (old_str replaced by new_str) without adding new semantic meaning, such as constraints or examples. Baseline 3 is appropriate because the schema carries the burden.
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 uses a specific verb ('Edit'), names the exact resource ('a document'), and specifies the mechanism ('replacing a string ... with a new string'). This clearly distinguishes it from the sibling read_doc_contents, which is a read operation.
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?
The description implies usage: when a document's content must be modified via string replacement. However, it provides no explicit guidance about when NOT to use it or when to prefer the sibling read_doc_contents instead. The alternative is only inferable from the tool name, not the description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_doc_contentsA
Read the contents of a document and return it as a string.
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Id of the document to read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It does state the output behavior ('return it as a string'), but does not mention error handling, permissions, or what happens when the document does not exist. For a simple read operation, this is adequate but not rich.
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, front-loaded sentence with no wasted words. It efficiently conveys both the operation and the return format.
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?
This is a simple tool with one parameter, full schema coverage, and no output schema. The description is largely complete for a read operation, especially since it explicitly states the return type. It could be slightly stronger with error or permission context, but nothing essential is missing for basic invocation.
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 schema already fully documents the only parameter, doc_id, as 'Id of the document to read', so schema coverage is 100%. The description adds no additional parameter meaning beyond the schema, matching the baseline score.
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 states a specific verb and resource: 'Read the contents of a document' and explicitly notes the return type as a string. This clearly distinguishes it from the sibling 'edit_document', which implies modification rather than reading.
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?
The verb 'Read' establishes a clear context for when this tool is appropriate, and its contrast with 'edit_document' implies read-only usage. However, it does not explicitly state when not to use it or name the alternative.
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.1.0- First observed
edit_document - First observed
read_doc_contents
TDQS
Scored across 2 tools
The two tools are clearly distinct: one reads document contents, the other modifies them. There is no overlap or ambiguity between the operations.
Both tools use a verb_noun pattern and snake_case, but one uses 'doc_contents' and the other uses 'document', which is a minor inconsistency. A more consistent pair would be read_document/edit_document.
Two tools is a thin surface and falls at the borderline for a useful server. The tools are focused, but the count feels minimal for a standalone document-related MCP server.
The tool surface covers reading and editing documents but lacks create, delete, list, and search capabilities. This leaves significant lifecycle gaps that agents may need to work around.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnterprise-grade MCP server integrating Claude AI capabilities, enabling AI-powered conversations, file operations, and system tools via the Model Context Protocol.1Apache 2.0
- FlicenseNot gradedqualityCmaintenanceThis MCP server powers a chat CLI for Claude or Gemini, letting users reference local documents by ID and execute MCP prompts through natural language.-
- FlicenseBqualityCmaintenanceAn MCP server that manages documents, enabling retrieval and command-based operations within AI chat interfaces using the Anthropic API.2-
- FlicenseNot gradedqualityCmaintenanceA command-line interface MCP server that enables interactive chat with Anthropic AI models, supporting document retrieval and extensible command-based tools.-