本地MCP客户端
本地MCP客户端是一个跨平台的web和API接口,用于使用自然语言与可配置的MCP服务器交互,由Ollama和任何选择的本地LLM提供支持,实现结构化工具执行和动态代理行为。
步骤1a:创建虚拟环境和安装要求-MAC/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
cd Local_MCP_Client
uv init .
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt步骤1b:创建虚拟环境和安装要求-Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
cd Local_MCP_Client
uv init .
uv venv
.venv\Scripts\activate
uv pip install -r requirements.txt步骤2a:安装Ollama并拔出LLM模型-MAC
brew install ollama
ollama serve
ollama pull llama3:8b步骤2b:安装Ollama并拉取LLM模型-Linux
curl -fsSL https://ollama.com/install.sh | sh
ollama serve
ollama pull llama3:8b步骤2c:安装Ollama并拉动LLM模型-Windows
下载Ollama 这里
ollama serve
ollama pull llama3:8b步骤3a:克隆MCP服务器-MAC/Linux
cd ~/Documents
git clone https://github.com/mytechnotalent/MalwareBazaar_MCP.git
git clone https://github.com/Invoke-RE/binja-lattice-mcp步骤3b:克隆MCP服务器-Windows
cd "$HOME\Documents"
git clone https://github.com/mytechnotalent/MalwareBazaar_MCP.git
git clone https://github.com/Invoke-RE/binja-lattice-mcp第四步:跑Ollama
ollama serve步骤5a:运行MCP客户端-MAC/Linux
export BNJLAT = ""
uv run local_mcp_client.py步骤5b:运行MCP客户端-Windows
$env:BNJLAT = ""
uv run local_mcp_client.py步骤6:运行测试
python -m unittest discover -s tests
uv pip install coverage==7.8.0
coverage run --branch -m unittest discover -s tests
coverage report -m
coverage html
open htmlcov/index.html # MAC
xdg-open htmlcov/index.html # Linux
start htmlcov\index.html # Windows
coverage erase