MCP-guide
A guide for setting up an MCP server using a Python virtual environment and integrating it with the Cline VS Code extension.
🔧 venv を使った MCP サーバと Cline の連携手順書
✅ 概要
この手順書では、GitHub 上の MCP サンプルプロジェクトを活用し、Python の仮想環境(venv)で MCP サーバを構築し、VS Code 拡張「Cline」と連携して利用する方法を説明します。MCP Inspector による動作確認も行います。
1. MCP プロジェクトの取得
📦 1.1 GitHub リポジトリをクローン
git clone https://github.com/m-hikichi/MCP-guide.git
cd MCP-guide
✅
${PROJECT_DIR}=MCP-guideのフルパス(例:C:/Users/yourname/Documents/MCP-guide)
2. Python 仮想環境の構築
🐍 2.1 仮想環境を作成
python -m venv venv
🔁 2.2 仮想環境を有効化
-
コマンドプロンプト:
.\venv\Scripts\activate.bat -
PowerShell:
.\venv\Scripts\activate.ps1
3. 依存パッケージのインストール(requirements.txt を使用)
仮想環境を有効化したまま、クローンしたプロジェクトに含まれる requirements.txt を用いてインストールを実行します:
pip install -r requirements.txt
✅
mcp[cli]など必要なパッケージがすべて含まれています。
4. MCP サーバの起動と Inspector による動作確認
🧪 4.1 MCP Inspector の起動
以下のコマンドを実行して MCP Inspector を起動します:
mcp dev mcp_server.py
成功するとブラウザが自動的に開き、MCP Inspector が表示されます。
Toolsタブでadd関数などをテストできますResourcesタブではリソースアクセスの確認が可能です
5. Cline 拡張機能との連携
⚙️ 5.1 cline_mcp_settings.json の編集
VS Code でコマンドパレットを開き、
> Cline: Configure MCP Servers を実行し、以下の設定を追加します:
{
"mcpServers": {
"local_mcp_server": {
"command": "${PROJECT_DIR}/venv/Scripts/mcp.exe",
"args": [
"dev",
"${PROJECT_DIR}/mcp_server.py"
]
}
}
}
✅
${PROJECT_DIR}は MCP-guide ディレクトリのフルパスに置き換えてください
❌ パスに空白は不可
✅ パスに日本語は使用可能
6. Cline 上での使用
- VS Code のチャットビューを開く
- MCPサーバを
local_mcp_serverに切り替える add(a=2, b=3)のようなツール呼び出しを行い、正しく動作するか確認します
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
mcp-server template
A template for creating MCP (ModelContextProvider) servers, configurable via environment variables.
System Diagnostics
An MCP server for system diagnostics and monitoring on Ubuntu using common command-line tools.
repomemory
Persistent, structured memory for AI coding agents. Your repo never forgets.
oclif MCP Server Plugin
An oclif CLI plugin that automatically discovers and serves commands via the Model Context Protocol (MCP).
BoostSecurity
BoostSecurity MCP acts as a safeguard preventing agents from adding vulnerable packages into projects. It analyzes every package an AI agent introduces, flags unsafe dependencies, and recommends secure, maintained alternatives to keep projects protected.
AI Development Assistant MCP Server
An AI assistant for development tasks, including taking screenshots, architecting solutions, and performing code reviews.
MCP Toolbox
A toolkit for enhancing LLM capabilities by providing tools to interact with external services and APIs via the Model Context Protocol (MCP).
Algorand
A comprehensive MCP server for tooling interactions(40+) and resource accessibility(60+) plus many useful prompts to interact with Algorand Blockchain.
Volatility MCP
Integrates Volatility 3 memory analysis with FastAPI and MCP, exposing memory forensics plugins via REST APIs.
Authless Remote MCP Server
An example of a remote MCP server without authentication, deployable on Cloudflare Workers or runnable locally.