mcp_starter_project

mcp_starter_project

This MCP server powers a chat CLI for Claude or Gemini, letting users reference local documents by ID and execute MCP prompts through natural language.

Category
Visit Server

README

MCP Chat

mcp_starter_project is a command-line chat application built around a local MCP server. The project supports two usage modes:

  • Anthropic Claude mode using main.py
  • Google Gemini / GenAI mode using genai_main.py

Both modes share the same MCP server implementation and document tooling in mcp_server.py, but use different model adapters and entrypoints.

Runtime modes

Mode Entry point Model adapter Required env vars Notes
Claude main.py core/claude.py ANTHROPIC_API_KEY, CLAUDE_MODEL Uses Anthropic Claude and the Claude CLI flow
Gemini / GenAI genai_main.py core/gemini.py GOOGLE_API_KEY, GEMINI_MODEL Uses Google Gemini and the GenAI CLI flow

Prerequisites

  • Python 3.10+
  • Either Anthropic or Google Gemini credentials
  • Optional: uv if you want to run the MCP server with uv run

Setup

1. Configure environment variables

Create a .env file in the project root with the values for the mode you want to use.

Claude mode

ANTHROPIC_API_KEY="your_api_key_here"
CLAUDE_MODEL="claude-3.5-mini"

Gemini / GenAI mode

GOOGLE_API_KEY="your_google_api_key"
GEMINI_MODEL="gemini-3.1-flash-lite"

Optionally set USE_UV=1 if you want main.py to launch mcp_server.py through uv run instead of the current Python interpreter.

2. Install dependencies

Use the provided pyproject.toml dependencies.

Recommended:

python -m venv .venv
source .venv/bin/activate
pip install -e .

If you do not want to install editable mode:

pip install anthropic python-dotenv prompt-toolkit "mcp[cli]>=1.8.0"

Running the application

Choose one of the two supported runtime modes.

Claude mode

python main.py

If you set USE_UV=1, main.py will start mcp_server.py through uv run.

You can also pass additional MCP server scripts to main.py:

python main.py another_server.py

Gemini / GenAI mode

python genai_main.py

This path uses the Google Gemini adapter and the GenAI-specific CLI.

How it works

  • main.py starts the CLI app and launches mcp_server.py as a local MCP server.
  • mcp_client.py manages the MCP session and exposes methods for listing tools, prompts, and reading resources.
  • mcp_server.py defines documents, MCP tools, resources, and a prompt that can be executed through the MCP protocol.
  • core/cli.py provides the interactive prompt with / command completion and @ document ID completion.

Usage

Basic chat

Type a question and press Enter.

Reference documents

Use @<document_id> to include a document into your query. For example:

> Tell me about @deposition.md

The CLI will fetch the referenced document content from the MCP server and include it in the model prompt.

Commands

Use / followed by a prompt name to run a server-side prompt. For example, if the MCP server defines a prompt named format, type:

> /format deposition.md

Tab completion is available for prompt names and document IDs.

Project structure

  • main.py - application entry point for Anthropic Claude usage
  • mcp_client.py - MCP client session wrapper for Claude mode
  • genai_main.py - application entry point for Google Gemini / GenAI usage
  • genai_mcp_client.py - MCP client session wrapper for GenAI mode
  • mcp_server.py - local MCP server with documents, tools, and resources shared by both modes
  • core/cli.py - prompt UI with completions and key bindings for Claude mode
  • core/cli_chat.py - chat flow, document injection, and MCP prompts for Claude mode
  • core/chat.py - general chat orchestration and model invocation for Claude mode
  • core/claude.py - Anthropic Claude client wrapper
  • core/gemini.py - Gemini model adapter for the GenAI flow
  • core/genai_cli.py - CLI prompt UI with completions for GenAI mode
  • core/genai_cli_chat.py - GenAI CLI chat flow with MCP-backed resources
  • core/genai_chat.py - GenAI chat orchestration and tool loop handling

Development notes

  • Add or update documents in the docs dictionary inside mcp_server.py.
  • Add new MCP prompts and tools in mcp_server.py to extend the CLI capabilities.
  • mcp_client.py already includes MCP session helpers; you can expand it to expose more server operations.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured