gibRun MCP Server
MCP server for end-to-end API testing with PostgreSQL integration, HTTP requests, Go build automation, and debugging support.
README
gibRun MCP Server
MCP Server untuk membantu backend programmer dalam proses end-to-end API testing dengan integrasi PostgreSQL, HTTP requests, dan Go build automation.
Fitur
Tools yang Tersedia:
-
postgres_query - Execute PostgreSQL queries
- Mendapatkan UID dari database
- Verifikasi hasil API di database
- Query data untuk testing
-
http_request - Test API endpoints (seperti curl)
- Support semua HTTP methods (GET, POST, PUT, PATCH, DELETE)
- Custom headers dan body
- Tracking response time
-
build_go_project - Build Go project
- Compile Go code dengan build flags
- Output binary ke path tertentu
- Error reporting yang detail
-
run_go_command - Execute Go commands
- Run tests (
go test) - Run aplikasi (
go run) - Manage dependencies (
go mod tidy)
- Run tests (
-
read_source_file - Baca source code
- Examine code sebelum fixing
- Debug issues
-
write_source_file - Write/update source code
- Fix code issues
- Update implementation
-
execute_shell_command - Execute arbitrary shell commands
- Custom operations
- Cleanup tasks
- Run custom scripts
-
dap_restart - Restart VSCode debugger session 🔥 NEW
- Hot reload setelah fix code
- Auto rebuild before restart
- Seamless debugging workflow
- Works dengan VSCode Go debugger
-
dap_send_command - Send custom DAP commands
- Advanced debugger control
- Set breakpoints programmatically
- Evaluate expressions
- Custom DAP operations
Debugger Tools (mirror external/mcp-go-debugger)
gibRun sekarang otomatis menjalankan proxy MCP untuk external/mcp-go-debugger, sehingga semua tool debugger Delve tersedia langsung di server ini:
- launch – Jalankan binary Go dengan Delve dan mulai sesi debugging baru.
- attach – Attach ke proses Go yang sudah berjalan berdasarkan PID.
- debug – Compile & debug file Go tertentu (mirip
dlv debug path/to/file.go). - debug_test – Build serta debug fungsi test tertentu dengan flag tambahan.
- set_breakpoint – Pasang breakpoint pada file + nomor baris.
- list_breakpoints – Lihat semua breakpoint yang aktif beserta statusnya.
- remove_breakpoint – Hapus breakpoint berdasarkan ID Delve.
- continue – Lanjutkan eksekusi sampai breakpoint berikutnya atau proses berakhir.
- step – Step into baris atau fungsi berikutnya.
- step_over – Step over ke baris berikut tanpa masuk ke fungsi.
- step_out – Step keluar dari fungsi saat ini.
- eval_variable – Evaluasi ekspresi/variable dengan kedalaman custom.
- get_debugger_output – Ambil STDOUT/STDERR yang ditangkap oleh Delve beserta konteks eksekusi.
- close – Tutup sesi debugging aktif dan hentikan server Delve internal.
Instalasi
Prerequisites
- Node.js 18+
- PostgreSQL (untuk database testing)
- Go 1.20+ (untuk build automation dan agar proxy debugger bisa menjalankan Delve)
- Delve (
dlv) + dependencies dariexternal/mcp-go-debugger
Install Dependencies
npm install
Build
npm run build
Konfigurasi
Menambahkan ke Claude Desktop
Edit file konfigurasi Claude Desktop:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Tambahkan konfigurasi berikut:
{
"mcpServers": {
"gibrun": {
"command": "node",
"args": ["/path/to/gibRun/build/index.js"]
}
}
}
Atau menggunakan npx (setelah publish):
{
"mcpServers": {
"gibrun": {
"command": "npx",
"args": ["-y", "gibrun-mcp-server"]
}
}
}
Konfigurasi untuk Cursor
Jika menggunakan Cursor, tambahkan di .cursor/mcp_config.json:
{
"mcpServers": {
"gibrun": {
"command": "node",
"args": ["/Users/iturban/development/mcp/gibRun/build/index.js"]
}
}
}
Environment Variables untuk PostgreSQL
Anda dapat menyimpan kredensial database langsung di konfigurasi agen MCP sehingga tidak perlu mengetik connection_string setiap kali memanggil postgres_query. Server akan mencoba urutan berikut:
- Nilai argumen
connection_string(jika tetap diberikan). - Environment variable
POSTGRES_CONNECTION_STRING. - Kombinasi
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_HOST(defaultlocalhost),POSTGRES_PORT(default5432), danPOSTGRES_DB.
Contoh konfigurasi Claude/Cursor:
"environment": {
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "postgres",
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_DB": "hairkatz_0_0_1"
}
Setelah environment di-set, cukup kirim query:
Tool: postgres_query
Args:
query: "SELECT * FROM users LIMIT 5"
Jika butuh database lain, override dengan connection_string langsung pada tool call.
Konfigurasi Go Debugger Proxy
Debugger tools di atas dijalankan oleh proses mcp-go-debugger yang dipanggil otomatis:
- gibRun mencoba menjalankan binary
mcp-go-debuggeryang tersedia di$PATH. - Jika tidak ditemukan, server fallback ke
go run ./cmd/mcp-go-debuggerdi folderexternal/mcp-go-debugger(pastikan Anda sudah menjalankango mod downloaddi sana minimal sekali).
Anda dapat mengoverride perilaku tersebut via environment variable pada konfigurasi MCP client:
"environment": {
"GIBRUN_GO_DEBUGGER_COMMAND": "/abs/path/to/mcp-go-debugger",
"GIBRUN_GO_DEBUGGER_ARGS": "--log --log-output=rpc",
"GIBRUN_GO_DEBUGGER_CWD": "/Users/you/Development/mcp/gibrun/external/mcp-go-debugger"
}
GIBRUN_GO_DEBUGGER_COMMAND— Path ke executable alternatif (misalnya hasilgo install).GIBRUN_GO_DEBUGGER_ARGS— Argumen tambahan yang akan diparsing dengan pemisah spasi sederhana.GIBRUN_GO_DEBUGGER_CWD— Working directory paksa untuk proses debugger.
Jika proxy gagal start (misalnya Go belum terinstall), gibRun akan tetap berjalan tetapi hanya menampilkan tools lokal.
Contoh Penggunaan
Workflow End-to-End Testing
Scenario: Testing user registration API
- Query database untuk get UID yang tersedia
Tool: postgres_query
Args:
connection_string: "postgresql://user:pass@localhost:5432/mydb"
query: "SELECT id FROM users WHERE email = $1"
params: ["test@example.com"]
- Test API endpoint
Tool: http_request
Args:
url: "http://localhost:8080/api/users"
method: "POST"
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer token123"
}
body: {
"email": "newuser@example.com",
"name": "Test User"
}
- Verify hasil di database
Tool: postgres_query
Args:
connection_string: "postgresql://user:pass@localhost:5432/mydb"
query: "SELECT * FROM users WHERE email = $1"
params: ["newuser@example.com"]
- Jika ada error, read source code
Tool: read_source_file
Args:
file_path: "/path/to/project/handlers/user.go"
- Fix code
Tool: write_source_file
Args:
file_path: "/path/to/project/handlers/user.go"
content: "package handlers\n\n// Fixed code here..."
- Rebuild project
Tool: build_go_project
Args:
project_path: "/path/to/project"
build_flags: "-v"
- Test lagi (ulangi step 2-3)
Testing dengan Multiple Assertions
AI dapat melakukan workflow otomatis:
- Query database untuk prepare test data
- Call API endpoint
- Verify response status dan data
- Check database untuk confirm changes
- Jika gagal, analyze error, fix code, rebuild, dan test ulang
- Loop sampai test pass
API Reference
postgres_query
Execute PostgreSQL query.
Parameters:
connection_string(required): PostgreSQL connection stringquery(required): SQL queryparams(optional): Query parameters array
Returns:
{
"success": true,
"rowCount": 1,
"rows": [...],
"fields": [...]
}
http_request
Make HTTP request.
Parameters:
url(required): Target URLmethod(optional): HTTP method (GET, POST, PUT, PATCH, DELETE)headers(optional): HTTP headers objectbody(optional): Request body objecttimeout(optional): Timeout in milliseconds
Returns:
{
"success": true,
"status": 200,
"statusText": "OK",
"headers": {...},
"data": {...},
"duration_ms": 123
}
build_go_project
Build Go project.
Parameters:
project_path(required): Path to Go projectbuild_flags(optional): Additional build flagsoutput_path(optional): Output binary path
Returns:
{
"success": true,
"stdout": "...",
"stderr": "...",
"message": "Build completed successfully"
}
run_go_command
Execute Go command.
Parameters:
project_path(required): Path to Go projectcommand(required): Go command (e.g., "test ./...", "run main.go")
Returns:
{
"success": true,
"stdout": "...",
"stderr": "...",
"command": "go test ./..."
}
read_source_file
Read source code file.
Parameters:
file_path(required): Path to file
Returns:
{
"success": true,
"file_path": "...",
"content": "...",
"size": 1234
}
write_source_file
Write source code file.
Parameters:
file_path(required): Path to filecontent(required): File content
Returns:
{
"success": true,
"file_path": "...",
"size": 1234,
"message": "File written successfully"
}
execute_shell_command
Execute shell command.
Parameters:
command(required): Shell commandworking_dir(optional): Working directory
Returns:
{
"success": true,
"command": "...",
"stdout": "...",
"stderr": "..."
}
dap_restart
Restart VSCode debugger session via Debug Adapter Protocol.
Parameters:
port(optional): DAP server port (lihat di VSCode debug console: "DAP server listening at: 127.0.0.1:PORT"). Jika dikosongkan, gibRun akan mencari port otomatis memakailsof -i -P -n | grep "dlv.*LISTEN"dan memverifikasi prosesdlv dap.host(optional): DAP server host (default: "127.0.0.1"). Ikut terdeteksi otomatis jikaportdikosongkan.rebuild_first(optional): Rebuild project before restart (default: true)project_path(required if rebuild_first=true): Path to Go project
Returns:
{
"success": true,
"message": "Debugger restarted successfully",
"dap_response": {...},
"build_result": {...},
"dap_server": "127.0.0.1:49279"
}
Example Usage:
AI Prompt: "Fix the bug di user_handler.go line 45,
rebuild, dan restart debugger di port 49279"
AI akan:
1. Read source file
2. Identify bug
3. Write fixed code
4. Use dap_restart dengan port 49279
(automatically rebuilds dan restarts debugger)
Auto-detecting DAP Address:
- Tidak perlu mengisi
portjika hanya ada satu prosesdlv dapyang LISTEN — gibRun akan menjalankan perintah berikut dan memakai host/port yang ditemukan:lsof -i -P -n | grep "dlv.*LISTEN" | while read line; do pid=$(echo "$line" | awk '{print $2}') if ps -p $pid -o command= 2>/dev/null | grep -q "dlv dap"; then echo "$line" | awk '{print "Port:", $9, "PID:", $2}' fi done - Jika lebih dari satu proses ditemukan, gibRun akan menampilkan daftar port tersebut dan meminta kamu memilih dengan mengisi
port(dan opsionalhost). - Manual fallback: jalankan debugger VSCode (F5), buka Debug Console, lalu cari pesan
DAP server listening at: 127.0.0.1:XXXXXdan masukkan port tersebut.
dap_send_command
Send custom DAP command for advanced debugger control.
Parameters:
port(optional): DAP server port. Kosongkan untuk auto-detect seperti di atas.command(required): DAP command name (e.g., "restart", "disconnect", "evaluate")host(optional): DAP server host (default: "127.0.0.1"). Ikut terdeteksi otomatis jikaporttidak diisi.arguments(optional): Command arguments as object
Returns:
{
"success": true,
"command": "evaluate",
"response": {...},
"dap_server": "127.0.0.1:49279"
}
Example Commands:
restart- Restart debugging sessiondisconnect- Stop debuggingevaluate- Evaluate expressionsetBreakpoints- Set breakpoints programmatically
Development
Watch mode untuk development
npm run dev
Testing MCP Server
Gunakan MCP Inspector untuk testing:
npx @modelcontextprotocol/inspector node build/index.js
Keuntungan Menggunakan gibRun
- Automated Testing Workflow: AI dapat menjalankan complete test cycle secara otomatis
- Database Integration: Direct access ke PostgreSQL untuk verify data
- Quick Iteration: Auto-rebuild dan re-test ketika menemukan errors
- Seamless Development: Integrated dengan VSCode debugger workflow
- Smart Error Handling: AI dapat analyze errors dan propose fixes
Troubleshooting
Database Connection Issues
Pastikan PostgreSQL running dan connection string benar:
postgresql://username:password@host:port/database
Build Failures
Cek Go installation:
go version
Pastikan semua dependencies tersedia:
go mod download
Permission Issues
Pastikan file permissions correct untuk read/write operations.
License
MIT
Contributing
Contributions welcome! Please submit issues atau pull requests.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.