SVN MCP Server

SVN MCP Server

A complete Model Context Protocol server for Subversion (SVN) integration, designed to allow AI agents to efficiently manage SVN repositories.

Category
访问服务器

Tools

svn_health_check

Verificar el estado de salud del sistema SVN y working copy

svn_info

Obtener información detallada del working copy o archivo específico

svn_status

Ver el estado de archivos en el working copy

svn_log

Ver historial de commits del repositorio

svn_diff

Ver diferencias entre versiones de archivos

svn_checkout

Hacer checkout de un repositorio SVN

svn_update

Actualizar working copy desde el repositorio

svn_add

Añadir archivos al control de versiones

svn_commit

Confirmar cambios al repositorio

svn_delete

Eliminar archivos del control de versiones

svn_revert

Revertir cambios locales en archivos

svn_cleanup

Limpiar working copy de operaciones interrumpidas

README

SVN MCP Server

Un servidor MCP (Model Context Protocol) completo para integración con Subversion (SVN), diseñado para permitir a agentes de IA gestionar repositorios SVN de manera eficiente.

🎯 Características

  • Operaciones básicas de repositorio: info, status, log, diff, checkout, update
  • Gestión de archivos: add, commit, delete, revert
  • Herramientas de mantenimiento: cleanup
  • 🔄 Gestión de ramas: (En desarrollo)
  • 🔄 Operaciones avanzadas: merge, switch, properties (En desarrollo)
  • 🔄 Herramientas de análisis: blame, conflict detection (En desarrollo)
  • 🔄 Operaciones en lote: (En desarrollo)

📋 Requisitos

  • Node.js >= 18.0.0
  • Subversion (SVN) instalado y disponible en PATH
  • TypeScript (para desarrollo)

🔍 Detectar instalación de SVN

Verificar si SVN está instalado

# Comando básico para verificar SVN
svn --version

# Verificar ruta completa del ejecutable
where svn        # Windows
which svn        # Linux/Mac

# Verificar cliente SVN completo
svn --version --verbose

Salida esperada si SVN está correctamente instalado:

svn, version 1.14.x (r1876290)
   compiled Apr 13 2023, 17:22:07 on x86_64-pc-mingw32

Copyright (C) 2023 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

❌ Errores comunes si SVN NO está instalado:

# Windows
'svn' is not recognized as an internal or external command

# Linux/Mac  
svn: command not found
bash: svn: command not found

🛠️ Diagnóstico avanzado

# Verificar PATH del sistema
echo $PATH                    # Linux/Mac
echo %PATH%                   # Windows CMD
$env:PATH                     # Windows PowerShell

# Buscar executables SVN en el sistema
find / -name "svn" 2>/dev/null           # Linux
Get-ChildItem -Path C:\ -Name "svn.exe" -Recurse -ErrorAction SilentlyContinue  # Windows PowerShell

# Verificar versión específica del cliente
svn --version | head -1       # Obtener solo la primera línea con la versión

💾 Instalar SVN en Windows

Opción 1: Gestores de paquetes

# Usando Chocolatey (Recomendado)
choco install subversion

# Usando winget
winget install CollabNet.Subversion

# Usando Scoop
scoop install subversion

Opción 2: Instaladores oficiales

  1. TortoiseSVN (incluye cliente de línea de comandos):

    https://tortoisesvn.net/downloads.html
    ✅ Incluye cliente GUI y CLI
    ✅ Integración con Windows Explorer
    
  2. SlikSVN (solo línea de comandos):

    https://sliksvn.com/download/
    ✅ Ligero (solo CLI)
    ✅ Ideal para automatización
    
  3. CollabNet Subversion:

    https://www.collab.net/downloads/subversion
    ✅ Versión empresarial
    ✅ Soporte comercial disponible
    

Opción 3: Visual Studio o Git for Windows

# Si tienes Git for Windows instalado, puede incluir SVN
git svn --version

# Visual Studio también puede incluir SVN
# Ir a: Visual Studio Installer > Modify > Individual Components > Subversion

🐧 Instalar SVN en Linux

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install subversion

# CentOS/RHEL/Fedora
sudo yum install subversion        # CentOS 7
sudo dnf install subversion        # CentOS 8/Fedora

# Arch Linux
sudo pacman -S subversion

# Alpine Linux
sudo apk add subversion

🍎 Instalar SVN en macOS

# Homebrew (Recomendado)
brew install subversion

# MacPorts
sudo port install subversion

# Desde Xcode Command Line Tools (puede estar incluido)
xcode-select --install

🔧 Configurar SVN después de la instalación

Verificar configuración global

# Ver configuración actual
svn config --list

# Configurar usuario global
svn config --global auth:username tu_usuario

# Configurar editor por defecto
svn config --global editor "code --wait"     # VS Code
svn config --global editor "notepad"         # Windows Notepad
svn config --global editor "nano"            # Linux/Mac nano

Verificar acceso a repositorios

# Probar conexión a repositorio (sin hacer checkout)
svn list https://svn.ejemplo.com/repo/trunk

# Probar con credenciales específicas
svn list https://svn.ejemplo.com/repo/trunk --username usuario --password contraseña

🚀 Instalación

Desde NPM

npm install -g @grec0/mcp-svn

Desarrollo Local

git clone https://github.com/gcorroto/mcp-svn.git
cd mcp-svn
npm install
npm run build

⚙️ Configuración

Variables de Entorno

Variable Descripción Por Defecto
SVN_PATH Ruta del ejecutable SVN svn
SVN_WORKING_DIRECTORY Directorio de trabajo process.cwd()
SVN_USERNAME Usuario para autenticación -
SVN_PASSWORD Contraseña para autenticación -
SVN_TIMEOUT Timeout en milisegundos 30000

Ejemplo de configuración MCP

{
  "mcpServers": {
    "svn": {
      "command": "npx",
      "args": ["@grec0/mcp-svn"],
      "env": {
        "SVN_PATH": "svn",
        "SVN_WORKING_DIRECTORY": "/path/to/working/copy",
        "SVN_USERNAME": "tu_usuario",
        "SVN_PASSWORD": "tu_contraseña"
      }
    }
  }
}

🛠️ Herramientas Disponibles

Operaciones Básicas

svn_health_check

Verificar el estado de salud del sistema SVN y working copy.

svn_health_check()

svn_info

Obtener información detallada del working copy o archivo específico.

svn_info(path?: string)

svn_status

Ver el estado de archivos en el working copy.

svn_status(path?: string, showAll?: boolean)

svn_log

Ver historial de commits del repositorio.

svn_log(path?: string, limit?: number, revision?: string)

svn_diff

Ver diferencias entre versiones de archivos.

svn_diff(path?: string, oldRevision?: string, newRevision?: string)

Operaciones de Repositorio

svn_checkout

Hacer checkout de un repositorio SVN.

svn_checkout(
  url: string,
  path?: string,
  revision?: number | "HEAD",
  depth?: "empty" | "files" | "immediates" | "infinity",
  force?: boolean,
  ignoreExternals?: boolean
)

svn_update

Actualizar working copy desde el repositorio.

svn_update(
  path?: string,
  revision?: number | "HEAD" | "BASE" | "COMMITTED" | "PREV",
  force?: boolean,
  ignoreExternals?: boolean,
  acceptConflicts?: "postpone" | "base" | "mine-conflict" | "theirs-conflict" | "mine-full" | "theirs-full"
)

Gestión de Archivos

svn_add

Añadir archivos al control de versiones.

svn_add(
  paths: string | string[],
  force?: boolean,
  noIgnore?: boolean,
  parents?: boolean,
  autoProps?: boolean,
  noAutoProps?: boolean
)

svn_commit

Confirmar cambios al repositorio.

svn_commit(
  message: string,
  paths?: string[],
  file?: string,
  force?: boolean,
  keepLocks?: boolean,
  noUnlock?: boolean
)

svn_delete

Eliminar archivos del control de versiones.

svn_delete(
  paths: string | string[],
  message?: string,
  force?: boolean,
  keepLocal?: boolean
)

svn_revert

Revertir cambios locales en archivos.

svn_revert(paths: string | string[])

Herramientas de Mantenimiento

svn_cleanup

Limpiar working copy de operaciones interrumpidas.

svn_cleanup(path?: string)

📖 Ejemplos de Uso

Verificar estado del sistema

// Verificar que SVN esté disponible y el working copy sea válido
const healthCheck = await svn_health_check();

Obtener información del repositorio

// Información general del working copy
const info = await svn_info();

// Información de un archivo específico
const fileInfo = await svn_info("src/main.js");

Ver estado de archivos

// Estado de todos los archivos
const status = await svn_status();

// Estado con información remota
const fullStatus = await svn_status(null, true);

Hacer checkout de un repositorio

const checkout = await svn_checkout(
  "https://svn.example.com/repo/trunk",
  "local-copy",
  "HEAD",
  "infinity",
  false,
  false
);

Confirmar cambios

// Añadir archivos
await svn_add(["src/new-file.js", "docs/readme.md"], { parents: true });

// Hacer commit
await svn_commit(
  "Add new feature and documentation",
  ["src/new-file.js", "docs/readme.md"]
);

🧪 Testing

# Ejecutar tests
npm test

# Tests con cobertura
npm run test -- --coverage

# Tests en modo watch
npm run test -- --watch

🏗️ Desarrollo

Scripts disponibles

# Compilar TypeScript
npm run build

# Modo desarrollo
npm run dev

# Modo watch
npm run watch

# Inspector MCP
npm run inspector

# Tests
npm test

# Publicar nueva versión
npm run release:patch
npm run release:minor
npm run release:major

Estructura del proyecto

svn-mcp/
├── package.json
├── tsconfig.json
├── jest.config.js
├── index.ts
├── common/
│   ├── types.ts      # Tipos TypeScript
│   ├── utils.ts      # Utilidades para SVN
│   └── version.ts    # Versión del paquete
├── tools/
│   └── svn-service.ts # Servicio principal SVN
├── tests/
│   └── integration.test.ts # Tests de integración
└── README.md

📊 Estado del Desarrollo

Ver el archivo SVN_MCP_IMPLEMENTATION.md para el checklist completo de implementación.

Progreso actual: Etapa 1 completada (Operaciones Básicas) ✅

Próximas etapas:

  • Gestión de ramas (branching)
  • Operaciones avanzadas (merge, switch)
  • Herramientas de análisis
  • Operaciones en lote

🐛 Troubleshooting

SVN no encontrado

Error: SVN is not available in the system PATH

Solución: Instalar SVN y asegurarse de que esté en el PATH del sistema.

No es un working copy

Error: Failed to get SVN info: svn: warning: W155007: '.' is not a working copy

Solución: Navegar a un directorio que sea un working copy de SVN o hacer checkout primero.

Problemas de autenticación

Error: svn: E170001: Authentication failed

Solución: Configurar las variables de entorno SVN_USERNAME y SVN_PASSWORD.

Timeout en operaciones largas

Error: Command timeout after 30000ms

Solución: Incrementar el valor de SVN_TIMEOUT.

📄 Licencia

MIT License - ver LICENSE para más detalles.

🤝 Contribuir

  1. Fork el proyecto
  2. Crear una rama feature (git checkout -b feature/nueva-caracteristica)
  3. Commit los cambios (git commit -am 'Add nueva caracteristica')
  4. Push a la rama (git push origin feature/nueva-caracteristica)
  5. Crear un Pull Request

📞 Soporte

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选