这是一个通过Ollama分析语义冲突并更新README.md文件的MCP服务器,能够有效处理内容添加时的冲突问题,确保文档内容的一致性和准确性。
README.md文件添加内容。llama3模型)分析与现有内容的语义冲突。ollama pull llama3
git clone https://github.com/nCrom/readme-updater-mcp.git
cd readme-updater-mcp
npm install
npm run build
需要在正在使用的MCP客户端(如Cline、Claude Desktop等)的配置文件中注册此服务器。
%APPDATA%/Claude/claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.jsonc:/Users/[用户名]/AppData/Roaming/Windsurf/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json(路径可能会有所变化)在配置文件的mcpServers对象中添加以下内容,args中的路径需修改为实际安装服务器代码的位置。
{
"mcpServers": {
// ... 其他服务器配置 ...
"readme-updater-mcp": {
"command": "node",
"args": [
// 示例: "C:/path/to/downloaded/readme-updater-mcp/build/index.js"
// 请将其修改为实际服务器build/index.js文件的完整路径。
"/full/path/to/readme-updater-mcp/build/index.js"
],
"env": {
// 设置本地Ollama API地址(若与默认值相同可省略)
"OLLAMA_HOST": "http://127.0.0.1:11434"
},
"disabled": false,
"autoApprove": [] // 根据需要添加自动批准的工具
}
}
}
注意:需要重新启动MCP客户端,配置更改才能生效。
通过MCP客户端(如Cline)调用update_readme工具。
filePath(必填):要更新的README.md文件的绝对路径(字符串)contentToAppend(必填):要添加到README文件的内容(字符串)commitMessage(可选):提交消息(默认值:"Update README.md")branchName(可选):分支名称(默认值:"main")update_readme --filePath ./README.md --contentToAppend "# New Section\n## 内容添加\n这部分是自动添加的。"
Success: README.md更新完成
Commit Message: Update README.md
Branch Name: main