Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model Context Protocol (MCP)

Overview

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP like a USB-C port for AI applications - providing a standardized way to connect AI models to different data sources and tools.

Key Features

  • Standardized Integration: Connect LLMs to various data sources and tools using a common protocol
  • Tool Execution: Enable LLMs to perform actions through your server
  • Resources Access: Expose data and content from your servers to LLMs
  • Prompts Management: Create reusable prompt templates and workflows
  • Sampling: Allow servers to request completions from LLMs
  • Secure Communication: Built-in transport mechanisms for reliable data exchange

Components

  • MCP Host: Programs like Claude Desktop, IDEs, or AI tools that want to access data through MCP
  • MCP Client: Protocol clients that maintain 1:1 connections with servers
  • MCP Server: Lightweight programs that expose specific capabilities through the standardized Model Context Protocol

Transport Types

MCP includes two standard transport implementations:

Standard Input/Output (stdio)

  • Enables communication through standard input and output streams
  • Useful for local integrations and command-line tools
  • Ideal for: building command-line tools, implementing local integrations, simple process communication, working with shell scripts

Server-Sent Events (SSE)

  • Enables server-to-client streaming with HTTP POST requests for client-to-server communication
  • Useful when: only server-to-client streaming is needed, working with restricted networks, implementing simple updates
  • Security Warning: SSE transports can be vulnerable to DNS rebinding attacks if not properly secured

Getting Started

Building MCP Server from scratch

  1. Create project folder:
uv init mcpcrashcourse
  1. Create server directory and files:
mkdir server
touch server/weather.py
  1. Create virtualenv:
uv venv
  1. Install MCP dependencies:
uv add "mcp[cli]"
  1. Run your server:
uv run mcp dev server/weather.py

Integration Examples

Integrating with Claude Desktop

uv run mcp install server/weather.py

Integrating with LLMs

Create a client file and integrate using libraries like langchain-groq.

Docker Setup

A Dockerfile is provided to containerize your MCP server.

Resources

Third-Party Resources

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages