Skip to content

waanvar/mcp-python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Python Example

This example shows how to implement a Model Context Protocol (MCP) in Python and integrate with different LLM backends:

  • OpenAI via SDK v1.x (OpenAI(api_key).chat.completions.create())
  • Local LLaMA via llama-cpp-python

Setup

  1. Create a virtual environment and activate:

    python3 -m venv venv
    source venv/bin/activate    # Linux/Mac
    venv\\Scripts\\activate   # Windows
    
  2. Install lib

    pip install -r requirements.txt
  3. Run server

    uvicorn server:app --reload
  4. Run client

    python client.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages