MCP服务器部署
基于Python的mcp服务器
步骤1:克隆仓库和
git clone
cd
conda create -n myenv python=3.11
conda activate myenv
pip install -r requirements.txt第二步:运行mcpo
mcpo --port 8001 --host 192.168.0.3 -- python mcp-server.py基于TypeScript的mcp服务器
步骤1:克隆仓库并构建
git clone
cd
npm ci
npm install
npm run build ps:
rm -rf build
rm -f node_modules/.bin/tsc
npm install --save-dev --force typescript # ensures latest + correct permissions
npm run build第二步:运行mcpo
mcpo --port 8086 --host 192.168.0.2 -- node build/index.js步骤3:测试 允许端口通过防火墙
sudo ufw allow 8087curl -X 'POST' \
'http://localhost:8086/papers-search-basic' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"query": "cancer",
"limit": 10
}'从远程服务器复制文件:
cp -r ~/Desktop/MCP-Servers/PubMed-MCP-Server/* ~/Desktop/MCP-Servers/rdiscovery/
# OR
rsync -av --exclude='__pycache__' ~/Desktop/MCP-Servers/PubMed-MCP-Server/ ~/Desktop/MCP-Servers/rdiscovery/