mcp-doc-chat
MCP Chat
MCP Chat — это приложение с интерфейсом командной строки, которое обеспечивает возможности интерактивного чата с моделями ИИ через API Anthropic. Приложение поддерживает поиск по документам, подсказки на основе команд и расширяемую интеграцию инструментов через архитектуру MCP (Model Control Protocol).
Предварительные требования
Python 3.9+
Ключ API Anthropic
Related MCP server: MCP Chat
Настройка
Шаг 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.mdКоманды будут автоматически дополняться при нажатии клавиши Tab.
Разработка
Добавление новых документов
Отредактируйте файл mcp_server.py, чтобы добавить новые документы в словарь docs.
Реализация функций MCP
Чтобы полностью реализовать функции MCP:
Выполните TODO в
mcp_server.pyРеализуйте недостающую функциональность в
mcp_client.py
Линтинг и проверка типов
Линтинг и проверка типов не реализованы.
Available Tools
2 toolsedit_doc_contentC
Edits the content of a document based on the provided new content.
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ID of the document to edit. | |
| old_str | Yes | The string to be replaced. Must match exactly, including whitespace. | |
| new_str | Yes | The new string to replace the old string. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose important behaviors. It states 'Edits' implying mutation, but fails to mention that the operation is a find-and-replace, that it modifies data destructively, or any error conditions (e.g., if old_str is not found). The description is insufficient for safe invocation.
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 short sentence, which is concise but lacks structure. It repeats the tool name and does not prioritize key information. Every sentence should add value, and this one merely paraphrases the name without providing critical details.
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 no output schema, no annotations, and three required parameters, the description should explain the return format, error behavior, and the find-and-replace process. It provides none of these, making the tool incomplete for an agent to use confidently.
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 clear descriptions for all three parameters. The tool description adds no additional semantic value beyond the schema; it merely restates that editing occurs. Since the schema already covers full meaning, a score 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?
Description states 'Edits the content of a document', clearly indicating the verb and resource. It distinguishes from sibling 'read_doc_content' which is a read operation. However, it does not specify that the edit is a find-and-replace, which could lead to ambiguity about the exact editing mechanism.
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 its sibling or other alternatives. The description does not mention prerequisites, context, or limitations, leaving the agent to infer usage from the name and schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_doc_contentA
Reads the content of a document and returns 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?
No annotations are provided, and the description gives minimal behavioral context. It does not mention read-only status, access requirements, or any constraints like size limits.
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 with no unnecessary words. It effectively communicates the tool's purpose.
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 tool's simplicity (1 parameter, no output schema) and the description's inclusion of return type as string, it is mostly complete. Could mention that the document must exist, but not critical.
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 a clear parameter description. The description adds no extra meaning beyond the schema's doc_id field, so baseline score 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 it reads document content and returns a string, with a clear verb and resource. It distinguishes from the sibling tool edit_doc_content which modifies.
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 explicit when-to-use or when-not-to-use guidance. The sibling tool edit_doc_content is listed, but the description does not provide usage context or alternatives.
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_doc_content - First observed
read_doc_content
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one reads document content, the other edits it. There is no overlap or ambiguity.
Both tool names follow a consistent verb_noun pattern (read_doc_content, edit_doc_content), making them predictable and easy to understand.
With only two tools, the server is minimal but reasonably scoped for a chat-based document interaction context. It's slightly thin but not inappropriate.
The tools cover reading and editing existing documents, but lack essential operations like creating, deleting, or listing documents. This is a significant gap for a document-focused server.
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables interactive CLI chat with AI using Anthropic API, supporting document retrieval and command-based prompts via MCP tools.2-
- FlicenseCqualityCmaintenanceEnables interactive chat with AI models via Anthropic API, supporting document retrieval and command-based prompts through the MCP architecture.3-
- FlicenseNot gradedqualityCmaintenanceEnables interactive chat with AI models via the Anthropic API, supporting document retrieval, slash commands, and extensible MCP-based tool integrations.-
- FlicenseAqualityCmaintenanceEnables interactive chat with AI models through the Anthropic API, supporting document retrieval, command-based prompts, and extensible tool integrations via the MCP architecture.2-