MCP Chat CLI
Provides tools for working with Markdown documents, including reformatting content to Markdown format and processing Markdown-based documents through the MCP server's resource and prompt system.
Enables Python-based implementation of the MCP server with tools for document management, resource handling, and prompt execution within a Python runtime environment.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Chat CLI format the quarterly report in markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Chat CLI
A command-line chat interface that connects to an MCP server using the Anthropic API. Built while working through Anthropic's Introduction to Model Context Protocol course, extended with custom tools, resources, and prompts.
What this is
MCP (Model Context Protocol) is an open standard for connecting AI models to external tools and data sources. This project implements both sides of that connection — a FastMCP server that exposes documents as resources and defines tools for reading and editing them, and a client that connects to the server and makes those capabilities available inside a chat interface.
The server defines:
Tools — read and edit documents
Resources — list all documents or fetch a specific one by URI
Prompts — reformat a document to markdown, or summarize its contents
The client implements the full MCP client session, including tool calls, resource reads, prompt retrieval, and command autocompletion.
Related MCP server: MCP Chat
What I worked through
Starting from a course starter pack, I implemented the missing pieces on both sides:
read_resource,list_prompts, andget_prompton the clientResource endpoints (
docs://documentsanddocs://documents/{doc_id}) on the serverTwo prompts (
formatandsummarize) that instruct the model to use the available tools
The main thing this project made concrete for me is the separation between the server (which defines what's available) and the client (which knows how to call it) — and how prompts are just structured messages that give the model a starting context, not magic.
Prerequisites
Python 3.9+
Anthropic API key
Setup
Clone the repo and navigate into the project folder.
Create a virtual environment and activate it:
uv venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Mac/LinuxInstall dependencies:
uv pip install -e .Create a
.envfile in the project root:
ANTHROPIC_API_KEY="your-key-here"Run the app:
uv run main.pyUsage
Type a message to chat. Use @doc_id to include a document in your query, and /command to trigger a prompt. Tab autocompletes available commands.
> Tell me about @deposition.md
> /summarize report.pdf
> /format plan.mdTo add your own documents, edit the docs dictionary in mcp_server.py.
Testing the server directly
mcp dev mcp_server.pyThis opens the MCP Inspector in your browser where you can test tools, resources, and prompts without the chat interface.
Project structure
mcp_chat_cli/
├── main.py # entrypoint
├── mcp_server.py # FastMCP server — tools, resources, prompts
├── mcp_client.py # MCP client session wrapper
├── core/
│ ├── chat.py # chat loop logic
│ ├── claude.py # Anthropic API integration
│ ├── cli.py # CLI setup and input handling
│ ├── cli_chat.py # connects CLI and chat
│ └── tools.py # tool call handling
├── .env # API key (not committed)
└── pyproject.toml # dependenciesAvailable Tools
2 toolsedit_documentA
Edit a document by replacing a string in the documents content with a new string.
Inputs: doc_id (required), old_str (required), new_str (required).
read_doc_contentsA
Read the contents of a document and return it as a string.
Inputs: doc_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one reads document contents, the other edits by replacing text. There is no functional overlap.
Both tool names follow the verb_noun pattern (edit_document, read_doc_contents), with consistent snake_case and clear action-object structure.
With only two tools, the server feels thin for a document utility, though it could be a minimal implementation. It falls into the borderline category (1-2 tools).
The server lacks basic CRUD operations like create and delete documents. While read and edit are provided, agents cannot create new documents or remove them, which are significant gaps.
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Build your own tools from chat: design, test and host them on a shareable MCP server URL.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA command-line interface application for interactive chat with AI models via the Anthropic API. It supports document retrieval, command-based prompts, and extensible tool integrations through the MCP architecture.-
- FlicenseNot gradedqualityDmaintenanceA command-line interface application that enables interactive chat with AI models via the Anthropic API, supporting document retrieval and command-based prompts through the MCP architecture.-
- FlicenseAqualityCmaintenanceEnables interactive chat with a local LLM using MCP architecture for document management, including tools to read, edit, and format documents.2-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides document management capabilities including reading, editing, and summarizing documents through a CLI chat interface powered by Claude AI.-