Skip to main content
Glama

MCP Chat

MCP Chat — это интерфейс командной строки, который обеспечивает интерактивное общение с моделями ИИ через API Anthropic. Приложение поддерживает извлечение документов, подсказки на основе команд и расширяемые интеграции инструментов через архитектуру MCP (Model Control Protocol).

Предварительные требования

  • Python 3.9+

  • Ключ API Anthropic

Related MCP server: MCP Chat

Настройка

Шаг 1: Настройка переменных окружения

  1. Создайте или отредактируйте файл .env в корне проекта и убедитесь, что следующие переменные заданы корректно:

ANTHROPIC_API_KEY=""  # Enter your Anthropic API secret key

Шаг 2: Установка зависимостей

Вариант 1: Настройка с помощью uv (рекомендуется)

uv — это быстрый установщик и менеджер пакетов Python.

  1. Установите uv, если он ещё не установлен:

pip install uv
  1. Создайте и активируйте виртуальное окружение:

uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Установите зависимости:

uv pip install -e .
  1. Запустите проект

uv run main.py

Вариант 2: Настройка без uv

  1. Создайте и активируйте виртуальное окружение:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Установите зависимости:

pip install anthropic python-dotenv prompt-toolkit "mcp[cli]==1.8.0"
  1. Запустите проект

python main.py

Использование

Базовое взаимодействие

Просто введите сообщение и нажмите Enter, чтобы начать общение с моделью.

Извлечение документов

Используйте символ @, за которым следует идентификатор документа, чтобы включить содержимое документа в ваш запрос:

> Tell me about @deposition.md

Команды

Используйте префикс / для выполнения команд, определённых в MCP-сервере:

> /summarize deposition.md

Команды будут автоматически дополняться при нажатии клавиши Tab.

Разработка

Добавление новых документов

Отредактируйте файл mcp_server.py, чтобы добавить новые документы в словарь docs.

Реализация функций MCP

Для полной реализации функций MCP:

  1. Завершите задачи TODO в mcp_server.py

  2. Реализуйте недостающую функциональность в mcp_client.py

Проверка lint и типов

Проверки lint и типов не реализованы.

Available Tools

2 tools
edit-documentB

Edit a document by replacing a string in the documents content with a new string

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesId of the document that will be edited
new_strYesThe new text to insert in place of the old text
old_strYesThe text to replace, Must match exactly, including whitespace

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It indicates a mutation operation ('Edit') but does not state whether changes are permanent, whether write permissions are required, or what happens if the old string is not found. It also leaves ambiguous whether all occurrences are replaced or just the first. This 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the main action. It is efficient and to the point, though it has a minor grammatical issue ('documents content'). It earns a 4 because it is appropriately sized and immediately understandable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple replace operation with fully described parameters, the description is fairly minimal. But it lacks critical behavioral details: it does not specify whether replacement is global or first-occurrence, what the return value is, or error handling when the old string is absent. Since there is no output schema and no annotations, these gaps make the tool incomplete for an agent to predict behavior accurately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with each parameter described (doc_id, old_str, new_str). The description does not add any semantic value beyond what the schema already provides, so it stays at the baseline of 3. The schema handles the parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Edit') and resource ('document') with a specific action ('replacing a string... with a new string'). It distinguishes from the sibling read_doc_contents, which is a read operation, so an agent can easily tell them apart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage (you edit when you need to replace text), but it provides no explicit guidance on when to use this tool versus the sibling read_doc_contents, nor any exclusion criteria or prerequisites. The context is clear enough for a simple tool, but explicit 'when not' guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_doc_contentsB

Read the contents of a document and return it a string.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesId of the document to read

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must bear the full burden of behavioral disclosure. It only states that the contents are returned as a string and does not mention permissions, read-only behavior, error cases, or what happens with missing or malformed document IDs. For a read operation, this is a notable gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that communicates the core action immediately. The minor grammatical error ('return it a string' instead of 'return it as a string') slightly detracts from polish but does not harm clarity significantly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter read tool, the description is mostly adequate: it names the action and the return type. However, with no annotations and no output schema, it could better describe return value details, potential errors, or the scope of content returned (e.g., full document vs. excerpt).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'doc_id' already described as 'Id of the document to read'. The tool description adds no additional parameter-level meaning, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Read') with a clear resource ('contents of a document') and even specifies the return type ('a string'). This clearly distinguishes it from the sibling tool '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.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage is implied by the tool's purpose: use it when you need to view a document's contents. However, there is no explicit guidance on when not to use it or which sibling alternative to choose, though the sibling name 'edit-document' hints at the distinction.

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.

  1. 2 tool updatesv0.1.0
    • First observededit-document
    • First observedread_doc_contents

TDQS

B3.3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one reads a document's contents, the other edits it by replacing strings. There is no overlap or ambiguity, making selection straightforward.

Naming Consistency2/5

The tool names use inconsistent naming conventions: 'read_doc_contents' follows snake_case, while 'edit-document' uses kebab-case. This inconsistency could confuse agents expecting a uniform pattern.

Tool Count3/5

With only 2 tools, the server feels minimal. While it might be intentionally scoped to read/edit operations, the low count borders on thin for a document manipulation server, though not entirely unreasonable.

Completeness2/5

The server only provides read and edit capabilities. Obvious lifecycle operations like create, delete, or list documents are missing, leaving significant gaps that would require external tools to complete basic document workflows.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A command-line interface application that enables interactive chat with AI models through the Anthropic API, supporting document retrieval, command-based prompts, and extensible tool integrations.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A command-line interface application that enables interactive chat with AI models through the Anthropic API, supporting document retrieval, command-based prompts, and extensible tool integrations.
    -
  • F
    license
    B
    quality
    D
    maintenance
    A command-line interface application that enables interactive chat with AI models through the Anthropic API, supporting document retrieval, command-based prompts, and extensible tool integrations.
    2
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A command-line interface application that enables interactive chat with AI models through the Anthropic API, supporting document retrieval, command-based prompts, and extensible tool integrations.
    -