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-doc-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

See if u have python installed Step 1 — Get an API key:

Go to console.anthropic.com Sign in (or create an account) Go to API Keys in the left sidebar Click Create Key, give it a name, and copy it Step 2 — Paste it in .env open the .env file at /Users/akritiagrawal/Downloads/cli_project/.env and replace the empty quotes on line 2 with your key. It should look like: env:\ANTHROPIC_API_KEY="sk-ant-api03-xxxxxxxxxxxxx"

Step 2: Install dependencies

uv is a fast Python package installer and resolver.

  1. Install uv, if not already installed:

brew install uv
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.

To run MCP Inspector server: run

mcp dev mcp_server.py

The mcp dev command launches the MCP Inspector — a web-based testing UI where you can interact with your MCP server without needing API credits. It lets you test your tools, resources, and prompts visually.

To run it:

uv run mcp dev mcp_server.py

Note the uv run prefix — you need it so the dependencies are available.

This will open a browser UI (usually at http://localhost:5173) where you can:

See all your tools and call them manually Browse your resources Test your prompts

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_documentA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the document to edit.
new_stringYesThe new string to replace the old string with.
old_stringYesThe string to be replaced in the document.

TDQS

A3.6/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 only states the replace action without explaining what happens if old_string is not found, whether all occurrences are replaced, or side effects. 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.

Conciseness5/5

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

The description is a single sentence that directly states the function with no wasted words. It is front-loaded with the primary action and appropriate for a simple tool.

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?

This is a mutation tool with no annotations and no output schema, so the description must explain behavior on its own. It lacks critical details such as error handling, replacement scope (first vs. all occurrences), and reversibility, making it incomplete for confident invocation.

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 provides complete descriptions for all three parameters (doc_id, old_string, new_string) at 100% coverage. The description adds no additional semantic detail beyond what the schema already states, meeting the baseline for high schema coverage.

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 ('Edit') and names the resource (document) plus the action (replacing a string), which clearly distinguishes it from the sibling read_doc_contents. This is a precise, non-tautological statement of purpose.

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

Usage Guidelines4/5

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

The description implies usage for modifying document content (as opposed to reading), providing clear context. However, it does not explicitly mention exclusions or name the alternative read_doc_contents, so it stops short of full explicit guidance.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the document to read.

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool reads and returns a string, which is a non-mutating operation. However, it omits behaviors such as error handling if the document is missing, access requirements, or any size limitations. This is adequate but lacks detail.

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 clear sentence that directly states the purpose and return type. No unnecessary words or repetition, making it highly concise and front-loaded.

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 tool with one parameter and no output schema, the description covers the core behavior (read and return string) and the schema covers the parameter. It is mostly complete, though it would be slightly better with error-handling context. The simplicity of the tool lowers the burden, so a 4 is justified.

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 already provides a description and example for 'doc_id' (100% coverage). The description does not add additional semantic meaning beyond the schema, so the baseline of 3 is appropriate.

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') and resource ('document') and clearly states the return type ('string'). It distinguishes from the sibling tool 'edit_document' by indicating a read-only operation, so the purpose is unambiguous.

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 when one wants to view a document's contents, and the sibling name 'edit_document' suggests the alternative when modification is needed. However, there is no explicit when/when-not guidance or mention of alternatives, so the guidance is implied rather than stated.

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

TDQS

A3.7/5.0
Disambiguation5/5

Each tool handles a distinct operation: one reads document contents, the other edits by replacing a string. There is no overlap or ambiguity, so an agent can easily choose the correct tool based on the desired action.

Naming Consistency4/5

Both tools follow a verb_noun pattern with snake_case (read_doc_contents, edit_document), which is consistent. However, one uses the abbreviation 'doc' while the other uses the full word 'document', creating a minor inconsistency in naming style.

Tool Count3/5

With only two tools, the server feels very thin. The tools are fundamental but the count is borderline, offering minimal functionality for a document-focused server.

Completeness3/5

The set covers read and edit operations, but lacks create, delete, list, or search capabilities. These are notable gaps that could prevent agents from completing common document management workflows.

Maintenance

ActivitySlowing
ResponsivenessSyncing

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

Related MCP Servers

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/akritiAgrawal27/mcp_cli_chatbot'

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