d8be2209ad
Build & Release / Build & Release Pipeline (push) Failing after 29s
Changelog Validation / Validate CHANGELOG.md (push) Failing after 3s
Deploy to Demo Server (SFTP) / Verify Deployment Permission (push) Successful in 1s
MCP Build & Validate / build (20) (push) Failing after 11s
MCP Build & Validate / build (22) (push) Failing after 12s
MCP Tool Inventory / inventory (push) Failing after 3s
Standards Compliance / Secret Scanning (push) Successful in 2s
Standards Compliance / License Header Validation (push) Failing after 2s
Standards Compliance / Repository Structure Validation (push) Failing after 2s
Standards Compliance / Coding Standards Check (push) Failing after 2s
MCP Release / Build, Validate & Release (push) Failing after 43s
Standards Compliance / Workflow Configuration Check (push) Failing after 2s
Standards Compliance / Documentation Quality Check (push) Failing after 3s
Standards Compliance / README Completeness Check (push) Failing after 2s
Standards Compliance / Git Repository Hygiene (push) Successful in 3s
Standards Compliance / Script Integrity Validation (push) Successful in 3s
Standards Compliance / Line Length Check (push) Failing after 3s
Standards Compliance / File Naming Standards (push) Successful in 3s
Standards Compliance / Insecure Code Pattern Detection (push) Successful in 2s
Standards Compliance / Version Consistency Check (push) Successful in 32s
CodeQL Security Scanning / Analyze (actions) (push) Failing after 1m13s
CodeQL Security Scanning / Analyze (javascript) (push) Failing after 1m13s
Standards Compliance / Dead Code Detection (push) Successful in 4s
Standards Compliance / File Size Limits (push) Successful in 3s
Standards Compliance / Binary File Detection (push) Successful in 3s
Standards Compliance / TODO/FIXME Tracking (push) Successful in 3s
Standards Compliance / Code Complexity Analysis (push) Successful in 35s
Standards Compliance / Broken Link Detection (push) Successful in 2s
Standards Compliance / Code Duplication Detection (push) Successful in 35s
Standards Compliance / API Documentation Coverage (push) Successful in 2s
Standards Compliance / Accessibility Check (push) Successful in 3s
Standards Compliance / Performance Metrics (push) Successful in 3s
Standards Compliance / Unused Dependencies Check (push) Successful in 37s
Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 39s
Standards Compliance / Terraform Configuration Validation (push) Successful in 5s
Deploy to Demo Server (SFTP) / SFTP Deploy → Demo (push) Successful in 4s
CodeQL Security Scanning / Security Scan Summary (push) Successful in 1s
Standards Compliance / Enterprise Readiness Check (push) Successful in 33s
Standards Compliance / Repository Health Check (push) Successful in 32s
Sync Version from README / Propagate README version (push) Failing after 27s
Standards Compliance / Compliance Summary (push) Failing after 1s
TypeScript MCP server exposing Gitea REST API v1 as AI assistant tools. Covers repos, files, branches, commits, issues, labels, milestones, pull requests (create/merge/review), releases, tags, actions, orgs, users, webhooks, wiki, notifications, and raw API passthrough. Multi-connection support with interactive setup wizard. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
2.0 KiB
JavaScript
41 lines
2.0 KiB
JavaScript
#!/usr/bin/env node
|
|
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
* BRIEF: Interactive setup — prompts for Gitea connection details
|
|
*/
|
|
import { createInterface } from 'node:readline/promises';
|
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
import { resolve } from 'node:path';
|
|
import { homedir } from 'node:os';
|
|
|
|
const CONFIG_PATH = resolve(homedir(), '.gitea-api-mcp.json');
|
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
|
|
async function prompt(q, d) { const a = await rl.question(`${q}${d ? ` [${d}]` : ''}: `); return a.trim() || d || ''; }
|
|
async function promptRequired(q) { let a = ''; while (!a) { a = (await rl.question(`${q}: `)).trim(); if (!a) console.log(' Required.'); } return a; }
|
|
|
|
async function main() {
|
|
console.log('\n=== gitea-api-mcp Setup ===\n');
|
|
let existing = null;
|
|
try { existing = JSON.parse(await readFile(CONFIG_PATH, 'utf-8')); console.log(`Existing: ${Object.keys(existing.connections).join(', ')}\n`); } catch {}
|
|
|
|
const name = await prompt('Connection name', 'moko');
|
|
const baseUrl = await promptRequired('Gitea URL (e.g. https://git.mokoconsulting.tech)');
|
|
const token = await promptRequired('Access token (Settings > Applications > Generate Token)');
|
|
const insecure = (await prompt('Skip TLS verification? (y/N)', 'N')).toLowerCase() === 'y';
|
|
|
|
const conn = { baseUrl: baseUrl.replace(/\/+$/, ''), token };
|
|
if (insecure) conn.insecure = true;
|
|
|
|
const config = existing ?? { defaultConnection: name, connections: {} };
|
|
config.connections[name] = conn;
|
|
if (!existing) config.defaultConnection = name;
|
|
else if ((await prompt(`Set "${name}" as default? (y/N)`, 'N')).toLowerCase() === 'y') config.defaultConnection = name;
|
|
|
|
await writeFile(CONFIG_PATH, JSON.stringify(config, null, '\t') + '\n', 'utf-8');
|
|
console.log(`\nConfig written to ${CONFIG_PATH}\n`);
|
|
rl.close();
|
|
}
|
|
|
|
main().catch(e => { console.error(e.message); rl.close(); process.exit(1); });
|