Skip to main content
Glama

Serena MCP Server

by lin2000wl
install_serena.ps13.91 kB
# Serena MCP 服务器安装脚本 # 适用于 Windows 环境 Write-Host "=== Serena MCP 服务器安装脚本 ===" -ForegroundColor Green # 检查 Python 版本 Write-Host "检查 Python 环境..." -ForegroundColor Yellow try { $pythonVersion = python --version 2>&1 Write-Host "发现 Python: $pythonVersion" -ForegroundColor Green # 检查是否为 Python 3.11 if ($pythonVersion -match "Python 3\.11") { Write-Host "✅ Python 版本符合要求 (3.11.x)" -ForegroundColor Green } else { Write-Host "⚠️ 警告: 建议使用 Python 3.11,当前版本可能不兼容" -ForegroundColor Yellow } } catch { Write-Host "❌ 未找到 Python,请先安装 Python 3.11" -ForegroundColor Red Write-Host "建议从官网下载: https://www.python.org/downloads/" -ForegroundColor Yellow exit 1 } # 检查 pip 配置 Write-Host "`n检查 pip 镜像源配置..." -ForegroundColor Yellow $pipConfPath = "$env:USERPROFILE\.pip\pip.conf" if (Test-Path $pipConfPath) { Write-Host "✅ pip 镜像源已配置" -ForegroundColor Green } else { Write-Host "配置 pip 镜像源..." -ForegroundColor Yellow New-Item -Path "$env:USERPROFILE\.pip" -ItemType Directory -Force | Out-Null @" [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn [install] trusted-host = pypi.tuna.tsinghua.edu.cn "@ | Out-File -FilePath $pipConfPath -Encoding UTF8 Write-Host "✅ pip 镜像源配置完成" -ForegroundColor Green } # 安装 uv Write-Host "`n安装 uv 包管理器..." -ForegroundColor Yellow try { $uvVersion = uv --version 2>&1 Write-Host "✅ uv 已安装: $uvVersion" -ForegroundColor Green } catch { Write-Host "正在安装 uv..." -ForegroundColor Yellow pip install uv -i https://pypi.tuna.tsinghua.edu.cn/simple if ($LASTEXITCODE -eq 0) { Write-Host "✅ uv 安装成功" -ForegroundColor Green } else { Write-Host "❌ uv 安装失败" -ForegroundColor Red exit 1 } } # 安装项目依赖 Write-Host "`n安装 Serena 依赖..." -ForegroundColor Yellow try { # 配置 uv 使用国内镜像源 $env:UV_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple" uv sync if ($LASTEXITCODE -eq 0) { Write-Host "✅ 依赖安装成功" -ForegroundColor Green } else { Write-Host "❌ 依赖安装失败,尝试备用方法..." -ForegroundColor Yellow uv pip install -e . } } catch { Write-Host "❌ 安装过程出现错误" -ForegroundColor Red Write-Host "请检查网络连接和 Python 环境" -ForegroundColor Yellow } # 创建配置文件 Write-Host "`n创建 Serena 配置文件..." -ForegroundColor Yellow $configTemplate = "src/serena/resources/serena_config.template.yml" if (Test-Path $configTemplate) { if (-not (Test-Path "serena_config.yml")) { Copy-Item $configTemplate "serena_config.yml" Write-Host "✅ 配置文件已创建: serena_config.yml" -ForegroundColor Green } else { Write-Host "✅ 配置文件已存在" -ForegroundColor Green } } else { Write-Host "⚠️ 配置模板文件未找到,将使用默认配置" -ForegroundColor Yellow } # 测试安装 Write-Host "`n测试 Serena 安装..." -ForegroundColor Yellow try { $testResult = uv run serena-mcp-server --help 2>&1 if ($testResult -match "usage:") { Write-Host "✅ Serena MCP 服务器安装成功!" -ForegroundColor Green } else { Write-Host "⚠️ 安装可能有问题,请检查输出信息" -ForegroundColor Yellow } } catch { Write-Host "❌ 测试失败,请检查安装" -ForegroundColor Red } Write-Host "`n=== 安装完成 ===" -ForegroundColor Green Write-Host "下一步:配置 Claude Desktop 集成" -ForegroundColor Yellow Write-Host "启动命令: uv run serena-mcp-server" -ForegroundColor Cyan

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lin2000wl/Serena-cursor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server