Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • MCP Server for ArangoDB
  • mcp-v8
  • Phrases MCP Server
  • Image Processor MCP Server
  • mcp-server-data-exploration
Back to MCP Servers
MCP Python Tutorial

MCP Python Tutorial

Public
jhj0517/mcp-python-tutorial

A Python-based Model Context Protocol server tutorial featuring core MCP concepts with resource retrieval, creation tools, and reusable LLM prompts, designed for seamless integration with Claude Desktop and local database mocking.

python
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with MCP Python Tutorial

MCP Server

Unlock the full potential of MCP Python Tutorial through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

MCP Python Tutorial

Tutorial app for MCP in Python with simple local DB with mocking data

Installation & Run

Installing via Smithery

To install Python MCP Tutorial Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @jhj0517/mcp-python-tutorial --client claude

Manual Installation

  1. Clone this repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Run MCP server as dev mode:
mcp dev localdb_app.py
  1. Default port for MCP server is 5173. Access to http://localhost:5173.

MCP Features

This tutorial app demonstrates core MCP concepts. You can check annotation-per-role in tutorial_app/mcp_server.py:

@mcp.resource

Basically, this annotation is about the agent "getting" the resource, just like GET in the RESTAPI.

  • users://all - Get all users
  • users://{user_id}/profile - Get a user's profile
  • posts://all - Get all posts
  • posts://{post_id} - Get a post by ID

@mcp.tool

This is about the agent "generating" the new resource, just like POST in the RESTAPI.

  • create_user - Create a new user
  • create_post - Create a new post
  • search_posts - Search posts by title or content

@mcp.prompt

This is just a reusable template to interact with LLM conveniently.

  • user_profile_analysis - Generate analysis of a user's profile
  • post_feedback - Interactive prompt for post feedback

[!NOTE] For more annotations, please read : https://github.com/modelcontextprotocol/python-sdk?tab=readme-ov-file#core-concepts

Connecting to Client

Once you've set up the MCP server, you need an LLM client that will use your MCP server to build your agent. The following guide will help you connect with Claude Desktop as your client.

  1. Claude Desktop uses uv to install MCP server dependencies. First, install uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Install MCP server dependencies using uv:
# Create virtual environment and activate it uv venv .venv\Scripts\activate uv pip install -r requirements.txt
  1. Download Claude Desktop from:
  • https://claude.ai/download
  1. Locate or create the claude_desktop_config.json file. The location varies by OS:
  • Windows:
C:\Users\%USER%\AppData\Roaming\Claude\claude_desktop_config.json
  • MacOS/Linux:
~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add the mcpServers attribute to your claude_desktop_config.json:
{ "mcpServers": { "local_db": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather", "run", "localdb_app.py" ] } } }

Note: You can deploy multiple MCP servers, each with its own dedicated concerns and expertise. This separation of concerns is better than implementing everything in a single MCP server.

  1. Restart Claude Desktop.
Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • MCP Server for ArangoDB
    MCP Server for ArangoDB

    Model Context Protocol server enabling seamless interaction with ArangoDB through core database oper...

    7 tools
    Added May 30, 2025
  • mcp-v8
    mcp-v8

    Rust-based Model Context Protocol server offering secure V8 JavaScript execution with persistent hea...

    Added May 30, 2025
  • Phrases MCP Server
    Phrases MCP Server

    Efficient MCP (Model Context Protocol) server for managing inspirational phrases with full CRUD capa...

    6 tools
    Added May 30, 2025
  • Image Processor MCP Server
    Image Processor MCP Server

    A TypeScript-based Model Context Protocol server enabling creation, access, and summarization of tex...

    2 tools
    Added May 30, 2025
  • mcp-server-data-exploration
    mcp-server-data-exploration

    Interactive Model Context Protocol server enabling seamless data exploration by loading CSV datasets...

    2 tools
    Added May 30, 2025