| 1 | # Agent Forge MCP |
| 2 | |
| 3 | |
| 4 | |
| 5 | MCP-сервер для [Agent Forge](../README.md): repos, issues, merge requests, Forge Lens — из чата. |
| 6 | |
| 7 | |
| 8 | |
| 9 | ## Стек |
| 10 | |
| 11 | |
| 12 | |
| 13 | - C#, .NET 10, self-contained exe. |
| 14 | |
| 15 | - HTTP к forge API (`FORGE_BASE_URL`, по умолчанию `http://127.0.0.1:8770`). |
| 16 | |
| 17 | |
| 18 | |
| 19 | ## Сборка |
| 20 | |
| 21 | |
| 22 | |
| 23 | ```powershell |
| 24 | |
| 25 | dotnet publish mcp/AgentForge.Mcp/AgentForge.Mcp.csproj -c Release -o publish/mcp |
| 26 | |
| 27 | ``` |
| 28 | |
| 29 | |
| 30 | |
| 31 | ## Cursor (`mcp.json`) |
| 32 | |
| 33 | |
| 34 | |
| 35 | См. [mcp-exe.example.json](../mcp/AgentForge.Mcp/mcp-exe.example.json). Forge API должен быть запущен. |
| 36 | |
| 37 | |
| 38 | |
| 39 | | Переменная | Значение | |
| 40 | |
| 41 | |------------|----------| |
| 42 | |
| 43 | | `FORGE_BASE_URL` | Базовый URL API (без `/api/v1`) | |
| 44 | |
| 45 | |
| 46 | |
| 47 | ## Тулы |
| 48 | |
| 49 | |
| 50 | |
| 51 | | Имя | API | |
| 52 | |
| 53 | |-----|-----| |
| 54 | |
| 55 | | `list_repos` | `GET /api/v1/repos` | |
| 56 | |
| 57 | | `create_repo` | `POST /api/v1/repos` | |
| 58 | |
| 59 | | `get_repo` | `GET /api/v1/repos/{name}` | |
| 60 | |
| 61 | | `create_issue` | `POST /api/v1/repos/{name}/issues` (+ optional `anchors`) | |
| 62 | |
| 63 | | `get_issue` | `GET /api/v1/repos/{name}/issues/{n}` | |
| 64 | |
| 65 | | `list_issues` | `GET /api/v1/repos/{name}/issues` (+ optional `q`) | |
| 66 | |
| 67 | | `search_issues` | `GET /api/v1/repos/{name}/issues?q=` | |
| 68 | |
| 69 | | `update_issue` | `PATCH /api/v1/repos/{name}/issues/{n}` | |
| 70 | |
| 71 | | `add_issue_comment` | `POST /api/v1/repos/{name}/issues/{n}/comments` | |
| 72 | |
| 73 | | `link_issue_anchors` | `POST /api/v1/repos/{name}/issues/{n}/anchors` | |
| 74 | |
| 75 | | `get_forge_lens` | `GET /api/v1/repos/{name}/lens?file=` | |
| 76 | |
| 77 | | `create_merge_request` | `POST /api/v1/repos/{name}/merge-requests` | |
| 78 | |
| 79 | | `get_merge_request` | `GET /api/v1/repos/{name}/merge-requests/{n}` | |
| 80 | |
| 81 | | `list_merge_requests` | `GET /api/v1/repos/{name}/merge-requests` | |
| 82 | |
| 83 | | `get_ci_status` | `GET /api/v1/repos/{name}/merge-requests/{n}/ci` | |
| 84 | |
| 85 | |
| 86 | |
| 87 | ### Anchors (Forge Lens) |
| 88 | |
| 89 | |
| 90 | |
| 91 | Массив в `create_issue`, `link_issue_anchors`, `create_merge_request`: |
| 92 | |
| 93 | |
| 94 | |
| 95 | ```json |
| 96 | |
| 97 | "anchors": [ |
| 98 | |
| 99 | { "file": "src/Foo.cs", "line_start": 12, "line_end": 48, "member_key": "Foo.Bar" } |
| 100 | |
| 101 | ] |
| 102 | |
| 103 | ``` |
| 104 | |
| 105 | |
| 106 | |
| 107 | Схема совместима с CIDE `CodeAnchor` (FORGE-ADR-0003). |
| 108 | |
| 109 | |
| 110 | |
| 111 | Ответы — JSON API (camelCase): `issueUrl`, `mrUrl`, `anchors`. |
| 112 | |
| 113 | |