hrsano645
MCP Serverhrsano645public

python mcp example

一个使用 Python 编写的 MCP SDK 示例,展示如何运行和配置。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

About This Server

一个使用 Python 编写的 MCP SDK 示例,展示如何运行和配置。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

MCP Python SDK Example

試したところ

transportTypeはstdioにしてます。

  • uv run mcp run server.pyを実行したまま
  • cline_mcp_settings.jsonを設定
  • その後task上で python-mcp-example-stdio を認識できるかとか聞くと使い方を教えてくれる。
  • 実行例
    • add 1 2 と入れる -> 実行確認が出てくるから、Approveすると結果を返してくれる

    • 自然言語でやりたいことを言うと自動的にadd toolを使ってくれる

      では addツールを使って、 4つの数字を合計して
      10, 20, 30, 40
      

cline_mcp_settings.jsonの例

commandのuvはフルパスがいいっぽいです。ここでは/opt/homebrew/bin/uvにしています。

{
  "mcpServers": {
    "python-mcp-example-stdio": {
      "disabled": false,
      "timeout": 60,
      "command": "/opt/homebrew/bin/uv", 
      "args": [
        "--directory",
        "/path/to/server.py/",
        "run",
        "mcp",
        "run",
        "server.py"
      ],
      "transportType": "stdio"
    }
  }
}

まだわかってない/やっていないこと

  • SSEの使い方
  • MCP Inspectorの使い方
  • 外部のAPIを使う

参考

MCP Python SDK を使って、echoするだけのMCPサーバを作ってみた - メモ的な思考的な

Quick Start

1

Clone the repository

git clone https://github.com/hrsano645/python-mcp-example
2

Install dependencies

cd python-mcp-example
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerhrsano645
Repopython-mcp-example
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation