quick-mcp-example

quick-mcp-example

3.3

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs, offering a unified framework for LLM-based applications to connect to data sources, get context, use tools, and execute standard prompts.

MCP Servers are a crucial component of the Model Context Protocol ecosystem, designed to handle tool availability, tool execution, static content as resources, and preset prompts. They form the foundation of the protocol by exposing standardized capabilities through well-defined interfaces. This modular architecture allows different components to be developed independently while maintaining interoperability, enabling users to create MCP servers for various LLM-related functionalities. MCP Servers are commonly used to integrate service APIs and tools or connect to local data sources. The actual implementation and user experience are flexible, allowing developers to choose between command line interfaces, graphical applications, or embedding within larger systems. This guide focuses on building an example MCP server with core capabilities, demonstrating interaction patterns with a simple client implementation.

Features

  • Tool Availability: Exposes available functions for LLMs to invoke.
  • Tool Execution: Executes functions when requested by LLMs.
  • Static Content as Resources: Provides data that can be referenced by LLMs.
  • Preset Prompts: Offers standardized templates for common tasks.
  • Modular Architecture: Allows independent development of components while maintaining interoperability.

Usage with Different Platforms

setup_and_installation

bash
git clone https://github.com/ALucek/quick-mcp-example.git
cd quick-mcp-example

# Create the ChromaDB Database
# Follow instructions in MCP_setup.ipynb

# Create the Virtual Environment and Install Packages
uv venv
source .venv/bin/activate  # On macOS/Linux
# OR
.venv\Scripts\activate     # On Windows

# Install dependencies
uv sync

# Run the Client & Server
python client.py mcp_server.py