- Home
- MCP servers
- Go Playground
Go Playground
- typescript
5
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"samber-go-playground-mcp": {
"command": "npx",
"args": [
"-y",
"go-playground-mcp"
]
}
}
}You have an MCP server that integrates with the Go Playground to run Go code, read from, and execute code using Go Playground URLs. It exposes five tools to your MCP clients: run code, share code as a URL, run and share in one move, read code from a Playground URL, and execute code from a Playground URL. This enables you to build applications that seamlessly execute Go inside a sandbox and share results or snippets with others.
How to use
You can use this server with any MCP-compatible client to perform five core actions: run Go code and retrieve results, generate a shareable Go Playground URL for a snippet, run code and get both results and a share URL, read Go code directly from an existing Go Playground URL, and execute code from a Playground URL. To start a client that communicates with this server, reference the MCP entry named go-playground and use the provided runtime commands.
How to install
Prerequisites you need before installing:
- Node.js and npm (or npm-compatible tooling)
- Access to a terminal or shell
- A text editor for configuration and testing
Follow these commands to set up and run the server locally:
Install dependencies
npm install
Build the project for production
npm run build
Run in development mode
npm run dev
Start for production
npm start
If you plan to run the MCP server from the built distribution via a local runtime, you can configure your client to start the server with a local node process using the compiled entry point:
{ "mcpServers": { "go-playground": { "command": "node", "args": ["dist/index.js"] } } }
These commands assume you are operating in the root of the project and that you have network access to install npm packages.
Configuration and usage notes
MCP clients can use two distinct wiring approaches for this server:
- Local runtime via npm/npx: Use the following MCP client config to launch the server in your environment:
{ "mcpServers": { "go-playground": { "command": "npx", "args": ["-y", "go-playground-mcp"] } } }
This starts the server using npx and the go-playground-mcp package.
Examples
Reading code from a Go Playground URL
// Read code from https://go.dev/play/xyz123 const result = await mcpClient.callTool("read_go_playground_url", { url: "https://go.dev/play/xyz123" });
Executing code from a Go Playground URL
// Execute code from https://go.dev/play/xyz123 const result = await mcpClient.callTool("execute_go_playground_url", { url: "https://go.dev/play/xyz123", withVet: true });
Supported URL formats include:
- https://go.dev/play/<snippet-id>
- https://go.dev/play/p/<snippet-id>
- https://play.golang.org/p/<snippet-id>" ,
Notes
This server adheres to MCP standards and exposes five tools that map directly to common Go Playground workflows. Use the provided tool names exactly as shown to ensure proper routing and handling of Go code in the sandbox.
Available tools
run_go_code
Execute Go code in the Go Playground sandbox and return results.
share_go_code
Share Go code by generating a URL that points to the snippet in the Go Playground.
run_and_share_go_code
Execute Go code and return both the execution results and a share URL for the snippet.
read_go_playground_url
Read Go code from an existing Go Playground URL without executing it.
execute_go_playground_url
Execute Go code directly from an existing Go Playground URL, with optional vetting.