Skip to main content
Glama

MCP Chat

MCP Chat is a command-line interface application that enables interactive chat capabilities with AI models through the Anthropic API. The application supports document retrieval, command-based prompts, and extensible tool integrations via the MCP (Model Control Protocol) architecture.

Prerequisites

  • Python 3.9+

  • Anthropic API Key

Related MCP server: MCP Chat

Setup

Step 1: Configure the environment variables

  1. Create or edit the .env file in the project root and verify that the following variables are set correctly:

ANTHROPIC_API_KEY=""  # Enter your Anthropic API secret key

Step 2: Install dependencies

uv is a fast Python package installer and resolver.

  1. Install uv, if not already installed:

pip install uv
  1. Create and activate a virtual environment:

uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:

uv pip install -e .
  1. Run the project

uv run main.py

Option 2: Setup without uv

  1. Create and activate a virtual environment:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:

pip install anthropic python-dotenv prompt-toolkit "mcp[cli]==1.8.0"
  1. Run the project

python main.py

Usage

Basic Interaction

Simply type your message and press Enter to chat with the model.

Document Retrieval

Use the @ symbol followed by a document ID to include document content in your query:

> Tell me about @deposition.md

Commands

Use the / prefix to execute commands defined in the MCP server:

> /summarize deposition.md

Commands will auto-complete when you press Tab.

Development

Adding New Documents

Edit the mcp_server.py file to add new documents to the docs dictionary.

Implementing MCP Features

To fully implement the MCP features:

  1. Complete the TODOs in mcp_server.py

  2. Implement the missing functionality in mcp_client.py

Linting and Typing Check

There are no lint or type checks implemented.

Available Tools

2 tools
edit_documentC

Edit a document by replacing a string in document's content with 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

C2.7/5.0
Behavior1/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 fails to mention whether the edit is in-place, what happens if 'old_str' is not found or matched multiple times, whether the operation is destructive/reversible, or what permissions are needed. The description only restates the basic operation.

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

Conciseness5/5

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

The description is a single, well-structured sentence that front-loads the action and resource. It is concise with no wasted words.

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 mutation tool with no annotations and no output schema, the description is incomplete. It omits critical behavioral details such as matching rules, potential failures, and side effects, leaving the agent under-informed about how to invoke it correctly.

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 coverage is 100%, so the baseline of 3 applies. The description adds no parameter details beyond what the schema already provides (e.g., exact match requirement is in the schema). It doesn't clarify matching semantics or error cases.

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

Purpose4/5

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

The description clearly states the verb ('Edit') and resource ('a document') and specifies the mechanism: replacing a string with a new string. This distinguishes it from the sibling 'read_doc_contents', which is a read operation. However, it doesn't explicitly name the alternative, so it falls short of a 5.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus alternatives. The sibling tool 'read_doc_contents' implies a read-vs-write distinction, but the description doesn't state when editing is appropriate or any prerequisites (e.g., document must exist, permissions).

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 as a string.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesID of the document to read.

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It states that the operation is a read and that it returns a string, which is useful given the lack of an output schema, but it omits permissions, error behavior, and handling of large or binary documents.

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

Conciseness5/5

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

The description is a single front-loaded sentence with no wasted words. It states the operation and the return type directly.

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

Completeness4/5

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

For a simple one-parameter read tool with complete schema coverage and no output schema, the description is nearly sufficient: it identifies the action and the return format. It could be more complete by routing the agent relative to edit_document, but the remaining gap is minor.

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%, so the doc_id parameter is already documented in the schema. The description adds no additional meaning such as ID format or accepted values, matching the baseline of 3 when the schema does the heavy lifting.

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

Purpose4/5

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 a document's contents and return it as a string. It is clear what the tool does, though it does not explicitly distinguish itself from the sibling edit_document.

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

Usage Guidelines2/5

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

No when-to-use guidance is provided. It does not mention the sibling edit_document or any conditions under which reading should be preferred over editing. The operation is implied by the tool name, but the description itself offers no routing advice.

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.2/5.0

Scored across 2 tools

Disambiguation5/5

read_doc_contents and edit_document target clearly different operations: reading content versus replacing content. There is no practical overlap or ambiguity between them.

Naming Consistency4/5

Both names use snake_case with a verb_noun structure, which is mostly predictable. However, 'read_doc_contents' uses abbreviated 'doc' while 'edit_document' uses the full word 'document', a minor inconsistency.

Tool Count3/5

Two tools is thin for document manipulation, especially under a server named MCP Chat. The set is minimal but not obviously excessive or mismatched. It feels borderline under-scoped rather than clearly appropriate.

Completeness3/5

The surface covers reading and string-replacement editing, but lacks create, delete, append, list, or metadata operations. These are notable gaps for a document lifecycle, though basic read/edit workflows are possible.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers