Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/cli/internal/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ func runMCPGo(projectDir string, manifest *manifest.ProjectManifest) error {

if noInspector {
// Run the server directly
fmt.Printf("Running server directly: go run main.go\n")
fmt.Printf("Running server directly: go run cmd/server/main.go\n")
fmt.Printf("Server is running and waiting for MCP protocol input on stdin...\n")
fmt.Printf("Press Ctrl+C to stop the server\n")

serverCmd := exec.Command("go", "run", "main.go")
serverCmd := exec.Command("go", "run", "cmd/server/main.go")
serverCmd.Dir = projectDir
serverCmd.Stdout = os.Stdout
serverCmd.Stderr = os.Stderr
Expand All @@ -183,7 +183,7 @@ func runMCPGo(projectDir string, manifest *manifest.ProjectManifest) error {
// Create server configuration for inspector
serverConfig := map[string]interface{}{
"command": "go",
"args": []string{"run", "main.go"},
"args": []string{"run", "cmd/server/main.go"},
}

// Create MCP inspector config
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/internal/frameworks/golang/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (g *Generator) GenerateTool(projectroot string, config templates.ToolConfig
fmt.Printf("\nNext steps:\n")
fmt.Printf("1. Edit internal/tools/%s.go to implement your tool logic\n", toolNameSnakeCase)
fmt.Printf("2. Configure any required environment variables in kmcp.yaml\n")
fmt.Printf("3. Run 'go run main.go' to start the server\n")
fmt.Printf("3. Run 'go run cmd/server/main.go' to start the server\n")

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/internal/frameworks/golang/templates/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This project was generated with [`kmcp`](https://github.com/kagent-dev/kmcp).

2. **Run the server:**
```bash
go run main.go
go run cmd/server/main.go
```

### Building the Docker Image
Expand Down Expand Up @@ -51,4 +51,4 @@ To add a new tool to your project, use the `kmcp add-tool` command:
kmcp add-tool <tool-name>
```

This will generate a new Go file in the `tools/` directory with a template for your new tool. You will need to add the new tool to the `main.go` file.
This will generate a new Go file in the `internal/tools/` directory with a template for your new tool. You will need to add the new tool to the `main.go` file.
Loading