Skip to main content
Glama

Intro-to-MCP

First MCP Server project built with Python and Claude

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 Server

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_documentB

Edit the content of a document by replacing a string in the 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.2/5.0
Behavior2/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It only states the basic operation, omitting important details like potential side effects (e.g., whether the change is persisted), failure conditions (e.g., old_str not found), or required permissions. This is insufficient 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, concise sentence that directly conveys the tool's purpose without unnecessary words or repetition. It is well-structured and easily scannable.

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?

The tool lacks an output schema, and the description does not explain what the function returns (e.g., success status, updated document) or how errors are handled. Given the absence of annotations and the need for the description to cover return/error behavior, the information is incomplete.

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 fully documents all three parameters (doc_id, old_str, new_str) with descriptions, achieving 100% schema coverage. The description does not add additional semantic value beyond the overall operation, so a baseline score 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 clearly states the tool's function: editing a document's content by replacing a string with a new string. It specifies the action (replace), the resource (document), and the mechanism (string replacement), effectively distinguishing it from the read-only sibling tool read_doc_contents.

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?

The description provides no explicit guidance on when to use this tool versus alternatives, such as read_doc_contents. While the distinction is implied by the sibling's read-only nature, there is no direct statement of usage context or exclusions.

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_idYesid 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 transparency burden. It discloses that the operation is a read and returns a string, but it does not mention error behavior, permissions, or side effects. The word 'read' implies a non-mutating operation, which is helpful, but additional context is missing.

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 with no wasted words. It is front-loaded with the core action and result, adhering to conciseness.

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 read tool with one parameter and no output schema, the description provides adequate context: it states what it does and the return type. However, it omits details like error conditions or pagination limits, which a comprehensive description might include. Still, within the tool's simplicity, it is largely complete.

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 schema covers the only parameter 'doc_id' with a description ('id of the document to read'), giving 100% coverage. The description adds no extra meaning beyond the schema, 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') and a specific resource ('document') and clearly states the output format ('return it as a string'). It distinguishes itself from the sibling tool 'edit_document' by focusing on read vs. modify behavior.

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 by contrasting with the sibling 'edit_document' (read vs. edit), but it does not explicitly state when to use this tool or provide exclusions/alternatives. The context is clear but not explicit, so it falls under 'implied usage'.

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. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observededit_document
    • First observedread_doc_contents

TDQS

B3.4/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one reads document contents, the other edits them. There is no ambiguity or overlap between them.

Naming Consistency4/5

Both tools follow a verb_noun pattern, but the nouns differ slightly ('doc_contents' vs 'document'). This is a minor inconsistency that does not significantly harm readability.

Tool Count3/5

With only two tools, the server feels thin, but for a narrow document manipulation purpose it is not unreasonable. It is borderline and lacks the richness of a more complete toolkit.

Completeness2/5

The domain appears to be document manipulation, but read and edit are the only operations available. There is no create, delete, or list functionality, leading to significant gaps in basic lifecycle coverage.

Maintenance

ActivityInactive
ResponsivenessNo issues

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/inissaka/Intro-to-MCP'

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