本地MCP客户端

Local MCP Client是一个跨平台的网络和API接口,用于通过自然语言与可配置的MCP服务器交互,支持结构化工具执行和动态代理行为。

  • by mytechnotalent
  • Python
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 mytechnotalent/Local_MCP_Client

使用说明

本地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 = "<your-binja-api-token>"
uv run local_mcp_client.py

步骤5b:运行MCP客户端-Windows

$env:BNJLAT = "<your-binja-api-token>"
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

许可证

Apache许可证,版本2.0