Python MCP server examples and tutorial repository

Python MCP server examples and tutorial repository

mcp-code-guidance•byjavapentesters

A Python learning project providing example MCP servers using FastMCP, including a minimal tools-only server, a weather query server, and a stock query server, alongside MCP and A2A tutorials.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a minimal MCP server containing only tools.
  • •Includes a weather-query MCP server and a stock-query MCP server.
  • •Built with Python and FastMCP, with tutorial content for learning MCP and A2A protocols.

BEST FOR

  • •Developers learning to build MCP servers in Python from scratch.
  • •Those wanting concrete examples of tool-style MCP servers for weather or stock queries.

ABOUT MCP-CODE-GUIDANCE

Python MCP server examples and tutorial repository is cataloged as an MCP server attributed to javapentesters. A Python learning project providing example MCP servers using FastMCP, including a minimal tools-only server, a weather query server, and a stock query server, alongside MCP and A2A tutorials. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Python MCP server examples and tutorial repository are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What MCP capabilities does the tutorial cover?

It covers the three main MCP capabilities: Tool, Resource and Prompt.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 0213119a02cb · 采集于 2026-11-13 11:43:47 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

mcp-code-guidance

介绍

mcp-code-guidance是一个使用 Python 语言从 0 到 1 学习 MCP 与 A2A 协议的教程。 MCP(Model-Context Protocol,)和A2A(Agent-to-Agent)是大模型应用中两个重要的协议,分别侧重于智能体与外部工具的交互以及智能体之间的协作。

MCP 协议是一种用于模型与外部环境交互的协议,它允许模型通过 API 与外部环境进行通信,并获取外部环境的信息。MCP 协议的主要特点是:

  • 标准化: 开发者只需遵循MCP标准,即可快速接入多种AI模型和服务;
  • 安全性: 提供多层次的安全机制,包括数据加密、身份验证和权限控制等;
  • 灵活性: 无论是数据库、文件还是 API,MCP 都能提供支持;
  • 跨平台: MCP 适用于任何系统和编程语言(如Python、TypeScript、Go)

MCP(Model Context Protocol)提供了三种主要能力:Tool、Resource 和 Prompt

  • Tool 通过 Tool,LLM 可以直接调用暴露的函数,从而实现对功能的主动控制。例如,查询数据库、发送消息、调用 API 或执行特定逻辑的任务。
  • Resource Resource 可用于为 LLM 提供上下文信息,帮助其更好地理解和响应用户需求。
  • Prompt Prompt 是由服务器定义的可重用指令或者模板,用户可以通过选择提示词来引导或标准化与 LLM 的交互过程,使其更精确和标准化输出。

官方地址: https://modelcontextprotocol.io/introduction

项目结构

mcp-code-guidance/
├── LICENSE
├── README.md
├── README_ZH.md
├── mcp-server-01quickstart # 最简单 MCP 服务只包含 tools
├── mcp-server-02weather # 查询天气 MCP 服务
├── mcp-server-03stock # 查询股票 MCP 服务
├── my-project
└── tutorial #  MCP与A2A 开发教程

环境需要

  • python 3.10+
  • FastMCP

安装步骤

1.安装uv

  • 安装 uv 命令
 curl -LsSf https://astral.sh/uv/install.sh | sh

install.sh 脚本执行时从 github.com 下载 uv-aarch64-apple-darwin.tar.gz 文件并解压后再安装。众所周之 github.com 网络不稳定。这里提供一个简单的解决方法,手动下载到install.sh 后,再下载目录启动本地 python http 临时服务用于支持脚本下载文件,同时修改install.sh 脚本中的下载地址为本地服务地址。

python -m http.server 8181

调整后的shell 脚本可以参考: 修改后的uv-install.sh

  • 添加用户本地bin目录到PATH
vi ~/.bash_profile
export PATH="$HOME/.local/bin:$PATH"
source ~/.bash_profile

2.cd mcp-code-guidance 初始化项目,以mcp-server-01quickstart 为例

# Create a new directory for our project
uv init  mcp-server-01quickstart -p3.11 
cd mcp-server-01quickstart

# Create virtual environment and activate it
uv venv
source .venv/bin/activate

# Install dependencies
uv add "mcp[cli]" httpx

# Create our server file
touch mcp-server-01quickstart.py

贡献

  • 通过 UV 管理工具为每个功能创建独立的目录。目录名称使用小写字母,README.md文件用于说明项目的主要功能以及详细的安装步骤
  • "turorial/"目录下提供使用 Python 语言从 0 到 1 学习 MCP 与 A2A 协议的详细教程

开源许可

mcp-code-guidance 基于 MIT License 协议

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Python MCP server examples and tutorial repository from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-code-guidance)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools