### Setup Go Project Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Template for setting up new Go projects with module initialization and standard structure. Requires project_name and module_path arguments. Returns guided workflow for creating directories and initializing Go modules following best practices. ```json { "name": "prompts/get", "params": { "name": "setup-go-project", "arguments": { "project_name": "myapp", "module_path": "github.com/username/myapp" } } } ``` -------------------------------- ### Extract Go Package Examples Source: https://context7.com/inja-online/golang-mcp/llms.txt Extracts and returns code examples from the documentation of a specified Go package. It provides practical usage patterns for learning and implementation. Requires package name and optionally a version. ```json { "name": "go_pkg_examples", "arguments": { "package": "encoding/json", "version": "" } } ``` -------------------------------- ### POST prompts/get (setup-go-project) Source: https://context7.com/inja-online/golang-mcp/llms.txt Provides a guided workflow for setting up a new Go project with module initialization, standard directory structure, and best practices. ```APIDOC ## POST prompts/get ### Description Provides a guided workflow for setting up a new Go project with module initialization, standard directory structure, and best practices. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("setup-go-project"). - **arguments** (object) - Required - Arguments for the prompt. - **project_name** (string) - Required - Name of the new project. - **module_path** (string) - Required - Go module path (e.g., "github.com/username/myapp"). ### Request Example { "name": "prompts/get", "params": { "name": "setup-go-project", "arguments": { "project_name": "myapp", "module_path": "github.com/username/myapp" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success (e.g., "ok"). - **details** (object) - Information about the created project. ### Response Example { "status": "ok", "details": { "project_name": "myapp", "module_path": "github.com/username/myapp" } } ``` -------------------------------- ### POST prompts/get (go-server-deployment) Source: https://context7.com/inja-online/golang-mcp/llms.txt Complete guide for building and deploying Go servers including cross-compilation, optimization, security, and production best practices. ```APIDOC ## POST prompts/get ### Description Complete guide for building and deploying Go servers including cross‑compilation, optimization, security, and production best practices. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("go-server-deployment"). - **arguments** (object) - Required - Arguments for the prompt. - **target_os** (string) - Required - Target operating system (e.g., "linux"). - **target_arch** (string) - Required - Target architecture (e.g., "arm64"). ### Request Example { "name": "prompts/get", "params": { "name": "go-server-deployment", "arguments": { "target_os": "linux", "target_arch": "arm64" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **deployment_steps** (string) - Instructions for building and deploying. ### Response Example { "status": "ok", "deployment_steps": "1. GOOS=linux GOARCH=arm64 go build -o myapp ..." } ``` -------------------------------- ### POST prompts/get (optimize-go-performance) Source: https://context7.com/inja-online/golang-mcp/llms.txt Comprehensive guide for profiling and optimizing Go code performance using pprof, benchmarks, and race detection. ```APIDOC ## POST prompts/get ### Description Comprehensive guide for profiling and optimizing Go code performance using pprof, benchmarks, and race detection with specific focus areas. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("optimize-go-performance"). - **arguments** (object) - Required - Arguments for the prompt. - **package_path** (string) - Required - Path to the Go package. - **optimization_goal** (string) - Required - Goal of optimization (e.g., "cpu"). ### Request Example { "name": "prompts/get", "params": { "name": "optimize-go-performance", "arguments": { "package_path": "./internal/service", "optimization_goal": "cpu" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **optimization_plan** (string) - Steps and commands for optimization. ### Response Example { "status": "ok", "optimization_plan": "1. run go test -bench=. ..." } ``` -------------------------------- ### POST prompts/get (add-go-dependency) Source: https://context7.com/inja-online/golang-mcp/llms.txt Step-by-step guide for adding and managing Go dependencies using go mod with version pinning and best practices. ```APIDOC ## POST prompts/get ### Description Step‑by‑step guide for adding and managing Go dependencies using go mod with version pinning and best practices. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("add-go-dependency"). - **arguments** (object) - Required - Arguments for the prompt. - **package_path** (string) - Required - Dependency module path. - **version** (string) - Required - Version to pin (e.g., "v1.9.1"). ### Request Example { "name": "prompts/get", "params": { "name": "add-go-dependency", "arguments": { "package_path": "github.com/gin-gonic/gin", "version": "v1.9.1" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **dependency_added** (object) - Details of the added dependency. ### Response Example { "status": "ok", "dependency_added": { "module": "github.com/gin-gonic/gin", "version": "v1.9.1" } } ``` -------------------------------- ### Go Server Deployment Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Complete guide for building and deploying Go servers to production environments. Handles cross-compilation, optimization, and security configurations. Requires target_os and target_arch parameters for proper binary compilation. ```json { "name": "prompts/get", "params": { "name": "go-server-deployment", "arguments": { "target_os": "linux", "target_arch": "arm64" } } } ``` -------------------------------- ### Fetch Go Package Documentation Source: https://context7.com/inja-online/golang-mcp/llms.txt Fetches comprehensive documentation for a specified Go package from pkg.go.dev. It returns the package overview, functions, types, and examples, with an optional version parameter. Dependencies include network access to pkg.go.dev. ```json { "name": "go_pkg_docs", "arguments": { "package": "github.com/gin-gonic/gin", "version": "v1.9.1" } } ``` -------------------------------- ### GET go://workspace Source: https://context7.com/inja-online/golang-mcp/llms.txt Returns the Go workspace structure and configuration, including module information and workspace files. ```APIDOC ## GET go://workspace ### Description Returns the Go workspace structure and configuration including module information and workspace files. ### Method GET ### Endpoint go://workspace ### Parameters #### Query Parameters - **uri** (string) - Required - Must be set to "go://workspace" ### Request Example { "method": "resources/read", "params": { "uri": "go://workspace" } } ### Response #### Success Response (200) - **working_directory** (string) - Absolute path to the project root. - **has_go_mod** (boolean) - Indicates presence of go.mod file. - **has_go_work** (boolean) - Indicates presence of go.work file. - **modules** (array[string]) - List of module paths. ### Response Example { "working_directory": "/path/to/project", "has_go_mod": true, "has_go_work": false, "modules": ["github.com/example/project"] } ``` -------------------------------- ### Add Go Dependency Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Step-by-step guide for adding and managing Go dependencies using go mod commands. Supports version pinning with package_path and version inputs. Follows Go module best practices for dependency management. ```json { "name": "prompts/get", "params": { "name": "add-go-dependency", "arguments": { "package_path": "github.com/gin-gonic/gin", "version": "v1.9.1" } } } ``` -------------------------------- ### go_mod - Manage Go Modules Source: https://context7.com/inja-online/golang-mcp/llms.txt Manages Go modules with support for init, tidy, download, vendor, and get operations. ```APIDOC ## POST /go_mod ### Description Manages Go modules with support for init, tidy, download, vendor, and get operations. Critical for dependency management and module initialization. ### Method POST ### Endpoint /go_mod #### Parameters ##### Request Body - **operation** (string) - Required - The module operation to perform (e.g., `init`, `tidy`, `download`, `vendor`, `get`). - **module_path** (string) - Optional - The module path for `init` operation. - **packages** (array[string]) - Optional - A list of packages for `get` operation. - **working_dir** (string) - Optional - The working directory for the module operation. ### Request Example ```json { "name": "go_mod", "arguments": { "operation": "get", "module_path": "github.com/example/myproject", "packages": ["github.com/gin-gonic/gin@v1.9.1", "github.com/stretchr/testify@latest"], "working_dir": "/path/to/project" } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the module operation. - **Duration** (string) - The duration of the operation. - **STDOUT** (string) - The standard output of the operation. - **STDERR** (string) - The standard error of the operation. #### Response Example ``` Exit Code: 0 Duration: 2.345s STDOUT: go: downloading github.com/gin-gonic/gin v1.9.1 go: added github.com/gin-gonic/gin v1.9.1 STDERR: ``` ``` -------------------------------- ### Optimize Go Performance Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Guide for profiling and optimizing Go code performance using pprof, benchmarks, and race detection. Accepts package_path and optimization_goal parameters targeting CPU or memory bottlenecks. Provides specific focus areas for improvement. ```json { "name": "prompts/get", "params": { "name": "optimize-go-performance", "arguments": { "package_path": "./internal/service", "optimization_goal": "cpu" } } } ``` -------------------------------- ### Start LSP Session Source: https://context7.com/inja-online/golang-mcp/llms.txt Initiates a Language Server Protocol (LSP) session for a given workspace. It requires the root URI of the workspace, the path to the Go Language Server (gopls), and optional arguments and environment variables. ```json { "name": "lsp_start_session", "arguments": { "root_uri": "file:///path/to/project", "gopls_path": "/usr/local/bin/gopls", "args": ["-mode=stdio"], "env": { "GOPATH": "/home/user/go" } } } ``` -------------------------------- ### Go Module Management API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for managing Go modules including init, tidy, download, vendor, and get operations. Critical for dependency management and module initialization. ```json { "name": "go_mod", "arguments": { "operation": "get", "module_path": "github.com/example/myproject", "packages": ["github.com/gin-gonic/gin@v1.9.1", "github.com/stretchr/testify@latest"], "working_dir": "/path/to/project" } } ``` -------------------------------- ### Get Go Server Status Source: https://context7.com/inja-online/golang-mcp/llms.txt Retrieves detailed status of a background Go server, including its PID, uptime, command, and exit code if it has stopped. Requires a server ID as input. ```json { "name": "go_server_status", "arguments": { "id": "api-server-1" } } ``` -------------------------------- ### POST prompts/get (write-go-tests) Source: https://context7.com/inja-online/golang-mcp/llms.txt Template for writing comprehensive Go tests including unit tests, benchmarks, table-driven tests, and integration tests. ```APIDOC ## POST prompts/get ### Description Template for writing comprehensive Go tests including unit tests, benchmarks, table‑driven tests, and integration tests. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("write-go-tests"). - **arguments** (object) - Required - Arguments for the prompt. - **package_path** (string) - Required - Path to the Go package. - **test_type** (string) - Required - Type of tests to generate (e.g., "unit"). ### Request Example { "name": "prompts/get", "params": { "name": "write-go-tests", "arguments": { "package_path": "./internal/service", "test_type": "unit" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **test_template** (string) - Generated test code. ### Response Example { "status": "ok", "test_template": "package service_test\n\nfunc TestExample(t *testing.T) { /* ... */ }" } ``` -------------------------------- ### POST prompts/get (go-code-review) Source: https://context7.com/inja-online/golang-mcp/llms.txt Comprehensive checklist for reviewing Go code including style, performance, security, concurrency, testing, and documentation standards. ```APIDOC ## POST prompts/get ### Description Comprehensive checklist for reviewing Go code including style, performance, security, concurrency, testing, and documentation standards. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("go-code-review"). - **arguments** (object) - Required - Arguments for the prompt. - **package_path** (string) - Required - Path or pattern to the Go packages to review. ### Request Example { "name": "prompts/get", "params": { "name": "go-code-review", "arguments": { "package_path": "./..." } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **review_report** (string) - Summarized review checklist and findings. ### Response Example { "status": "ok", "review_report": "- Formatting: OK\n- Concurrency: Potential data race in XYZ..." } ``` -------------------------------- ### Write Go Tests Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Template for generating comprehensive Go tests including unit, benchmark, table-driven, and integration tests. Takes package_path and test_type as inputs. Provides patterns and best practices for thorough test coverage. ```json { "name": "prompts/get", "params": { "name": "write-go-tests", "arguments": { "package_path": "./internal/service", "test_type": "unit" } } } ``` -------------------------------- ### Go Code Review Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Comprehensive checklist for reviewing Go code including style, performance, security, concurrency, testing, and documentation standards. Takes package_path as input to define review scope. Ensures consistent code quality. ```json { "name": "prompts/get", "params": { "name": "go-code-review", "arguments": { "package_path": "./..." } } } ``` -------------------------------- ### Search Go Packages Source: https://context7.com/inja-online/golang-mcp/llms.txt Searches for Go packages on go.dev based on a query string and returns a list of matching package paths. This is useful for discovering relevant packages for specific functionalities. Input is a search query. ```json { "name": "go_pkg_search", "arguments": { "query": "http router" } } ``` -------------------------------- ### go_run - Execute Go Files Directly Source: https://context7.com/inja-online/golang-mcp/llms.txt Executes a Go file using `go run` with optional arguments and environment variables. Ideal for quick testing and script execution. ```APIDOC ## POST /go_run ### Description Executes a Go file using `go run` with optional arguments and environment variables. This tool compiles and runs the specified Go file in a single step, making it ideal for quick testing and script execution. ### Method POST ### Endpoint /go_run #### Parameters ##### Request Body - **file** (string) - Required - The path to the Go file to execute. - **args** (array[string]) - Optional - Command-line arguments to pass to the Go program. - **working_dir** (string) - Optional - The working directory for the execution. - **env_vars** (object) - Optional - A map of environment variables to set for the execution. - **key** (string) - The environment variable name. - **value** (string) - The environment variable value. ### Request Example ```json { "name": "go_run", "arguments": { "file": "main.go", "args": ["--port", "8080", "--verbose"], "working_dir": "/path/to/project", "env_vars": { "DEBUG": "true", "API_KEY": "secret123" } } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the executed process. - **Duration** (string) - The duration of the execution. - **STDOUT** (string) - The standard output of the executed process. - **STDERR** (string) - The standard error of the executed process. #### Response Example ``` Exit Code: 0 Duration: 1.234s STDOUT: Server started on port 8080 Ready to accept connections STDERR: 2025-11-12 10:00:00 INFO: Initialization complete ``` ``` -------------------------------- ### Read Go Test Files Resource Source: https://context7.com/inja-online/golang-mcp/llms.txt Lists all Go test files and benchmark files discovered within the project. This resource is useful for identifying testable components and benchmarks. ```json { "method": "resources/read", "params": { "uri": "go://tests" } } ``` -------------------------------- ### go_test - Run Go Tests Source: https://context7.com/inja-online/golang-mcp/llms.txt Runs Go tests with support for coverage reporting, benchmarks, race detection, and verbose output. ```APIDOC ## POST /go_test ### Description Runs Go tests with support for coverage reporting, benchmarks, race detection, and verbose output. Essential for validating code correctness and measuring test coverage. ### Method POST ### Endpoint /go_test #### Parameters ##### Request Body - **package** (string) - Required - The Go package(s) to test (e.g., `./...`). - **cover** (boolean) - Optional - Enable coverage reporting. - **cover_pkg** (string) - Optional - Specify packages for coverage reporting. - **bench** (boolean) - Optional - Run benchmarks. - **race** (boolean) - Optional - Enable the race detector. - **verbose** (boolean) - Optional - Enable verbose test output. - **timeout** (string) - Optional - Set a test timeout (e.g., `10m`). - **working_dir** (string) - Optional - The working directory for the test execution. ### Request Example ```json { "name": "go_test", "arguments": { "package": "./...", "cover": true, "cover_pkg": "./internal/...", "bench": false, "race": true, "verbose": true, "timeout": "10m", "working_dir": "/path/to/project" } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the test execution. - **Duration** (string) - The duration of the test execution. - **STDOUT** (string) - The standard output of the test execution. - **STDERR** (string) - The standard error of the test execution. #### Response Example ``` Exit Code: 0 Duration: 5.678s STDOUT: === RUN TestUserService === RUN TestUserService/CreateUser === RUN TestUserService/GetUser --- PASS: TestUserService (0.05s) --- PASS: TestUserService/CreateUser (0.02s) --- PASS: TestUserService/GetUser (0.03s) PASS coverage: 85.2% of statements in ./internal/... ok github.com/example/project/internal/service 5.678s ``` ``` -------------------------------- ### go_build - Build Go Packages Source: https://context7.com/inja-online/golang-mcp/llms.txt Builds Go packages and dependencies with support for various build flags for reproducible builds. ```APIDOC ## POST /go_build ### Description Builds Go packages and dependencies with support for various build flags including race detection, build tags, linker flags, and trimpath for reproducible builds. ### Method POST ### Endpoint /go_build #### Parameters ##### Request Body - **package** (string) - Required - The Go package to build (e.g., `./cmd/server`). - **output** (string) - Optional - The output path for the compiled binary. - **race** (boolean) - Optional - Enable the race detector. - **tags** (array[string]) - Optional - Build tags to include. - **ldflags** (string) - Optional - Linker flags. - **trimpath** (boolean) - Optional - Remove file paths from the executable. - **working_dir** (string) - Optional - The working directory for the build. ### Request Example ```json { "name": "go_build", "arguments": { "package": "./cmd/server", "output": "bin/server", "race": false, "tags": ["production", "mysql"], "ldflags": "-X main.version=1.0.0 -X main.build=2025-11-12", "trimpath": true, "working_dir": "/path/to/project" } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the build process. - **Duration** (string) - The duration of the build. - **STDOUT** (string) - The standard output of the build process. - **STDERR** (string) - The standard error of the build process. #### Response Example ``` Exit Code: 0 Duration: 3.456s STDOUT: STDERR: ``` ``` -------------------------------- ### Read Go Build Tags Resource Source: https://context7.com/inja-online/golang-mcp/llms.txt Discovers and returns build tags and constraints present in the Go project by scanning the source files. It lists the identified tags and the files where they are defined. ```json { "method": "resources/read", "params": { "uri": "go://build-tags" } } ``` -------------------------------- ### POST prompts/get (debug-go-issue) Source: https://context7.com/inja-online/golang-mcp/llms.txt Systematic approach to debugging Go programs including race conditions, panics, deadlocks, and performance issues. ```APIDOC ## POST prompts/get ### Description Systematic approach to debugging Go programs including race conditions, panics, deadlocks, and performance issues with targeted strategies. ### Method POST ### Endpoint prompts/get ### Parameters #### Request Body - **name** (string) - Required - Must be "prompts/get". - **params** (object) - Required - Contains prompt details. - **name** (string) - Required - Prompt identifier ("debug-go-issue"). - **arguments** (object) - Required - Arguments for the prompt. - **issue_type** (string) - Required - Type of issue (e.g., "race"). - **package_path** (string) - Required - Path to the affected package. ### Request Example { "name": "prompts/get", "params": { "name": "debug-go-issue", "arguments": { "issue_type": "race", "package_path": "./internal/handler" } } } ### Response #### Success Response (200) - **status** (string) - Indicates success. - **debug_steps** (string) - Recommended debugging steps. ### Response Example { "status": "ok", "debug_steps": "1. run go test -race ..." } ``` -------------------------------- ### Read Go Modules Resource Source: https://context7.com/inja-online/golang-mcp/llms.txt Reads the Go modules and their dependencies within the current workspace by parsing the `go.mod` file. This resource provides information about the project's module path, Go version, and direct dependencies. ```json { "method": "resources/read", "params": { "uri": "go://modules" } } ``` -------------------------------- ### Debug Go Issue Prompt Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Systematic approach to debugging Go programs including race conditions, panics, deadlocks, and performance issues. Requires issue_type and package_path as inputs. Provides targeted debugging strategies and tool recommendations. ```json { "name": "prompts/get", "params": { "name": "debug-go-issue", "arguments": { "issue_type": "race", "package_path": "./internal/handler" } } } ``` -------------------------------- ### Go Build Operations API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for building Go packages with support for race detection, build tags, linker flags, and reproducible builds. Includes package specification and output configuration. ```json { "name": "go_build", "arguments": { "package": "./cmd/server", "output": "bin/server", "race": false, "tags": ["production", "mysql"], "ldflags": "-X main.version=1.0.0 -X main.build=2025-11-12", "trimpath": true, "working_dir": "/path/to/project" } } ``` -------------------------------- ### Read Go Workspace Resource Usage Source: https://context7.com/inja-online/golang-mcp/llms.txt Shows how to call the workspace resource via MCP protocol. Takes method and params with uri as input. Returns workspace structure and module information. Requires MCP client implementation and only provides read-only access to workspace data. ```json { "method": "resources/read", "params": { "uri": "go://workspace" } } ``` -------------------------------- ### Go Code Execution API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for executing Go files directly with optional arguments and environment variables. Includes configuration for working directory and custom environment variables. ```json { "name": "go_run", "arguments": { "file": "main.go", "args": ["--port", "8080", "--verbose"], "working_dir": "/path/to/project", "env_vars": { "DEBUG": "true", "API_KEY": "secret123" } } } ``` -------------------------------- ### go_fmt - Format Go Code Source: https://context7.com/inja-online/golang-mcp/llms.txt Formats Go code using the standard `go fmt` tool to ensure consistent code style. ```APIDOC ## POST /go_fmt ### Description Formats Go code using the standard `go fmt` tool. Ensures consistent code style across the project by applying Go's official formatting rules. ### Method POST ### Endpoint /go_fmt #### Parameters ##### Request Body - **paths** (array[string]) - Required - A list of paths (files or directories) to format. - **working_dir** (string) - Optional - The working directory for formatting. ### Request Example ```json { "name": "go_fmt", "arguments": { "paths": ["./cmd/...", "./internal/..."], "working_dir": "/path/to/project" } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the formatting process. - **Duration** (string) - The duration of the formatting. - **STDOUT** (string) - The standard output, listing formatted files. - **STDERR** (string) - The standard error, if any. #### Response Example ``` Exit Code: 0 Duration: 0.234s STDOUT: internal/service/user.go internal/handler/http.go STDERR: ``` ``` -------------------------------- ### go_lint - Lint Go Code Source: https://context7.com/inja-online/golang-mcp/llms.txt Lints Go code using golangci-lint (if available) or go vet to identify potential issues and style violations. ```APIDOC ## POST /go_lint ### Description Lints Go code using golangci-lint (if available) or go vet. Identifies potential issues, code smells, and style violations. ### Method POST ### Endpoint /go_lint #### Parameters ##### Request Body - **package** (string) - Required - The Go package(s) to lint (e.g., `./...`). - **linter** (string) - Optional - The linter to use (`golangci-lint` or `go vet`). Defaults to `golangci-lint` if available. - **working_dir** (string) - Optional - The working directory for the linting process. ### Request Example ```json { "name": "go_lint", "arguments": { "package": "./...", "linter": "golangci-lint", "working_dir": "/path/to/project" } } ``` ### Response #### Success Response (200) - **Exit Code** (integer) - The exit code of the linting process. - **Duration** (string) - The duration of the linting. - **STDOUT** (string) - The standard output, which is typically empty for linters. - **STDERR** (string) - The standard error, containing linting errors and warnings. #### Response Example ``` Exit Code: 0 Duration: 4.567s STDOUT: STDERR: internal/service/user.go:45:2: `userID` is unused (deadcode) internal/handler/http.go:123:1: function `handleRequest` is too complex (gocyclo) ``` ``` -------------------------------- ### Go Code Formatting API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for formatting Go code using the standard go fmt tool. Ensures consistent code style by applying Go's official formatting rules across specified paths. ```json { "name": "go_fmt", "arguments": { "paths": ["./cmd/...", "./internal/..."], "working_dir": "/path/to/project" } } ``` -------------------------------- ### Go Testing Operations API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for running Go tests with coverage reporting, benchmarks, race detection, and verbose output. Supports package specification and timeout configuration. ```json { "name": "go_test", "arguments": { "package": "./...", "cover": true, "cover_pkg": "./internal/...", "bench": false, "race": true, "verbose": true, "timeout": "10m", "working_dir": "/path/to/project" } } ``` -------------------------------- ### Go Tool Operations Response Formats Source: https://context7.com/inja-online/golang-mcp/llms.txt Standardized response format for all Go tool operations including exit codes, duration, and separate stdout/stderr streams. Provides consistent output across different tools. ```text Exit Code: 0 Duration: 1.234s STDOUT: Server started on port 8080 Ready to accept connections STDERR: 2025-11-12 10:00:00 INFO: Initialization complete ``` ```text Exit Code: 0 Duration: 5.678s STDOUT: === RUN TestUserService === RUN TestUserService/CreateUser === RUN TestUserService/GetUser --- PASS: TestUserService (0.05s) --- PASS: TestUserService/CreateUser (0.02s) --- PASS: TestUserService/GetUser (0.03s) PASS coverage: 85.2% of statements in ./internal/... ok github.com/example/project/internal/service 5.678s ``` ```text Exit Code: 0 Duration: 4.567s STDOUT: STDERR: internal/service/user.go:45:2: `userID` is unused (deadcode) internal/handler/http.go:123:1: function `handleRequest` is too complex (gocyclo) ``` -------------------------------- ### Go Workspace Resource Response Schema Source: https://context7.com/inja-online/golang-mcp/llms.txt Defines the response structure from the workspace resource. Contains working directory path, Go module status flags, and discovered module list. Used for parsing and validating MCP server responses in client applications. ```json { "working_directory": "/path/to/project", "has_go_mod": true, "has_go_work": false, "modules": ["github.com/example/project"] } ``` -------------------------------- ### Send LSP Request Source: https://context7.com/inja-online/golang-mcp/llms.txt Sends various Language Server Protocol (LSP) requests to an active session, such as for code completion, finding definitions, or locating references. Requires the workspace root URI, the LSP method, and specific parameters for the request. ```json { "name": "lsp_request", "arguments": { "root_uri": "file:///path/to/project", "method": "textDocument/definition", "params": { "textDocument": {"uri": "file:///path/to/project/main.go"}, "position": {"line": 10, "character": 15} } } } ``` -------------------------------- ### Go Code Linting API Calls Source: https://context7.com/inja-online/golang-mcp/llms.txt JSON-RPC API calls for linting Go code using golangci-lint or go vet. Identifies potential issues, code smells, and style violations in specified packages. ```json { "name": "go_lint", "arguments": { "package": "./...", "linter": "golangci-lint", "working_dir": "/path/to/project" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.