From ac3a18bb6bf3d9643ba6e34b80660124e7fd6487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E8=88=92=E5=95=B8?= Date: Tue, 18 Nov 2025 13:28:56 +0000 Subject: [PATCH] Initial commit --- .continue/mcpServers/mcp.json | 16 +++++++++ .cursor/mcp.json | 16 +++++++++ .gitea/workflows/code-review.yml | 21 +++++++++++ .vscode/mcp.json | 31 ++++++++++++++++ README.md | 62 ++++++++++++++++++++++++++++++++ 5 files changed, 146 insertions(+) create mode 100644 .continue/mcpServers/mcp.json create mode 100644 .cursor/mcp.json create mode 100644 .gitea/workflows/code-review.yml create mode 100644 .vscode/mcp.json create mode 100644 README.md diff --git a/.continue/mcpServers/mcp.json b/.continue/mcpServers/mcp.json new file mode 100644 index 0000000..70d1f05 --- /dev/null +++ b/.continue/mcpServers/mcp.json @@ -0,0 +1,16 @@ +{ + "mcpServers": { + "gitea": { + "command": "gitea-mcp", + "args": [ + "-t", + "stdio", + "--host", + "https://gitea.com" //your host + ], + "env": { + "GITEA_ACCESS_TOKEN": "" + } + } + } +} \ No newline at end of file diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 0000000..f512497 --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,16 @@ +{ + "mcpServers": { + "gitea": { + "command": "gitea-mcp", + "args": [ + "-t", + "stdio", + "--host", + "" + ], + "env": { + "GITEA_ACCESS_TOKEN": "" + } + } + } +} \ No newline at end of file diff --git a/.gitea/workflows/code-review.yml b/.gitea/workflows/code-review.yml new file mode 100644 index 0000000..2ec965a --- /dev/null +++ b/.gitea/workflows/code-review.yml @@ -0,0 +1,21 @@ +name: ai-reviews + +on: + pull_request: + types: [opened, synchronize] + +jobs: + review: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Review code + uses: kekxv/AiReviewPR@v0.0.6 + with: + model: ${{ vars.MODEL }} + host: ${{ vars.OLLAMA_HOST }} + REVIEW_PULL_REQUEST: false \ No newline at end of file diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 0000000..08d7c1f --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,31 @@ +{ + "mcp": { + "inputs": [ + { + "type": "promptString", + "id": "gitea_token", + "description": "Gitea 个人访问令牌", + "password": true + } + ], + "servers": { + "gitea-mcp": { + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "-e", + "GITEA_HOST", + "-e", + "GITEA_ACCESS_TOKEN", + "docker.gitea.com/gitea-mcp-server" + ], + "env": { + "GITEA_HOST": "--host https://devstar.cn", + "GITEA_ACCESS_TOKEN": "" + } + } + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..82ff149 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# Devstar MCP + +devstar mcp 工程项目模板 + +### 1.安装mcp + +``` +git clone https://gitea.com/gitea/gitea-mcp.git +``` + +构建前请先安装: + +- make +- Golang (Go 1.24 or later recommended) + +``` +make install +``` + +安装后,将 gitea-mcp 可执行文件复制到系统 PATH 目录(例如: /usr/local/bin/) + +``` +cp gitea-mcp /usr/local/bin/ +``` + + + +### 2.配置本地大模型 + + + +``` +curl -fsSL https://ollama.com/install.sh | sh + +ollama pull //eg:deepseek-r1:1.5b +``` + +#### 解决Ollama只能本地访问的问题 + +a. 编辑systemd服务配置,添加环境变量OLLAMA_HOST=0.0.0.0和OLLAMA_ORIGINS=*。 + +``` +sudo nano /etc/systemd/system/ollama.service +``` + + + +并在 `[Service]` 区块中添加: + +``` +Environment=OLLAMA_HOST=0.0.0.0 +Environment=OLLAMA_ORIGINS=* +``` + + + +b. 重新加载systemd并重启Ollama服务‌。 +``` +sudo systemctl daemon-reexec +sudo systemctl daemon-reload +sudo systemctl restart ollama +``` \ No newline at end of file