Skip to main content
Glama
samber

Go Playground MCP Server

by samber

Go Playground MCP Server

A Model Context Protocol (MCP) server that integrates with the Go Playground API to execute Go code and generate shareable URLs.

tag Build Status Coverage npm License

πŸ§™ Features

  • Run Go Code: Execute Go code in the Go Playground sandbox

  • Share Code: Generate shareable URLs for Go code snippets

  • Run and Share: Execute code and get both results and share URL in one operation

  • Read from URL: Read Go code from existing Go Playground URLs

  • Execute from URL: Execute Go code from existing Go Playground URLs

  • MCP Integration: Full Model Context Protocol compliance

Related MCP server: godoc-mcp

πŸƒβ€β™‚οΈ Usage

The server can be used with any MCP-compatible client. The server provides five tools:

  1. run_go_code - Execute Go code and return results

  2. share_go_code - Share Go code and get a URL

  3. run_and_share_go_code - Execute code and get both results and share URL

  4. read_go_playground_url - Read Go code from an existing Go Playground URL

  5. execute_go_playground_url - Execute Go code from an existing Go Playground URL

Add this to your MCP client configuration:

{
  "mcpServers": {
    "go-playground": {
      "command": "npx",
      "args": ["-y", "go-playground-mcp"]
    }
  }
}

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
});

URL Formats Supported

The new URL-based tools support these Go Playground URL formats:

  • https://go.dev/play/<snippet-id>

  • https://go.dev/play/p/<snippet-id>

  • https://play.golang.org/p/<snippet-id>

🀝 Contributing

Don't hesitate ;)

Install

  1. Clone this repository:

git clone https://github.com/samber/go-playground-mcp.git
cd go-playground-mcp
  1. Install dependencies:

npm install
  1. Build the project:

npm run build

Running the Server

# Development mode
npm run dev

# Production mode
npm run build
npm start

Add this to your MCP client configuration:

{
  "mcpServers": {
    "go-playground": {
      "command": "node",
      "args": ["dist/index.js"]
    }
  }
}

πŸ‘€ Contributors

Contributors

πŸ’« Show your support

Give a ⭐️ if this project helped you!

GitHub Sponsors

πŸ“ License

Copyright Β© 2025 Samuel Berthe.

This project is MIT licensed.

Available Tools

5 tools
execute_go_playground_urlC

Execute Go code from an existing Go Playground URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe Go Playground URL to execute code from (e.g., https://go.dev/play/abc123 or https://play.golang.org/p/abc123)
withVetNoWhether to run go vet on the code (default: true)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavioral traits. It only says 'execute' but does not explain side effects, network requirements, or whether the execution is remote and has latency. The agent is left guessing about key behaviors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no unnecessary words. It is appropriately sized for the simple function, though a bit more detail could improve it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description should complete the picture. It fails to indicate the return value (e.g., whether it returns output, errors, or status). This is a significant gap for a tool that executes code.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters fully (100%), so baseline is 3. The description adds no extra context about the parameters beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (execute Go code) and the resource (existing Go Playground URL). It distinguishes from siblings like 'read' or 'share' by specifying execution from a URL. However, it does not mention what the tool returns, leaving some ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not specify prerequisites, limitations, or situations where another sibling tool (e.g., run_go_code without a URL) is more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_go_playground_urlA

Read Go code from an existing Go Playground URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe Go Playground URL to read code from (e.g., https://go.dev/play/abc123 or https://play.golang.org/p/abc123)

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool reads code, implying a non-destructive operation, but fails to mention network calls, authentication requirements, rate limits, or error handling. This is insufficient for a tool that makes external requests.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no redundant information. Every word contributes to the purpose, making it concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and no output schema, the description minimally covers the operation. However, it does not specify what the output is (e.g., returns the Go code as a string) or mention error scenarios, leaving some gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'url', which includes examples. The description adds no extra meaning beyond what the schema already provides, qualifying for the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads Go code from a URL, distinguishing it from siblings like execute_go_playground_url (which executes code) and share_go_code (which shares code). The verb 'Read' and resource 'Go code from an existing Go Playground URL' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a URL and want to retrieve code, but it does not explicitly state when to use this tool versus siblings. No comparisons or exclusions are provided, so guidance is only implied by the tool name and context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_and_share_go_codeB

Run Go code and get both execution results and a shareable URL

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesThe Go code to execute and share
withVetNoWhether to run go vet on the code (default: true)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose any behavioral traits beyond basic execution and sharing. Important details like side effects, security considerations, or network dependency are omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that immediately conveys the dual purpose (run and share). Concise but not overly terse; the sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that executes arbitrary Go code and generates a shareable URL, the description lacks critical context such as execution environment, output format, URL nature, security warnings, and behavior of the withVet parameter. No output schema is provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema covers 100% of parameters, so baseline is 3. The description adds no extra meaning beyond what the schema already provides for 'code' and 'withVet'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs Go code and provides both execution results and a shareable URL, which distinguishes it from siblings like run_go_code (only runs) and share_go_code (only shares).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as run_go_code or share_go_code. The description does not mention exclusions or context for using the combined functionality.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_go_codeB

Run Go code in the Go Playground and return execution results

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesThe Go code to execute
withVetNoWhether to run go vet on the code (default: true)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behaviors like sandbox limitations, error handling, or side effects, but only states 'return execution results'β€”failing to mention that the code runs in a restricted environment or what happens on failure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundancy. However, it could incorporate brief parameter or behavior details without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite low complexity and no output schema, the description fails to specify output format (e.g., stdout, stderr) or mention sibling differentiation, leaving the agent with incomplete information for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no extra meaning beyond the parameter names and defaults. It aligns with the code parameter but offers no additional context like the effect of 'withVet'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Run Go code in the Go Playground' with a specific verb and resource, and distinguishes this tool from siblings like 'execute_go_playground_url' and 'run_and_share_go_code' by focusing on execution alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives from the sibling list (e.g., 'run_and_share_go_code' or 'execute_go_playground_url'), leaving the agent to infer usage without comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

share_go_codeB

Share Go code and get a shareable URL

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesThe Go code to share

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It states it shares code and returns a URL, but omits details such as whether the code is executed, if there are side effects, authentication needs, or rate limits. This is insufficient for a mutation-like operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at one sentence, but it is too minimal to be considered well-structured. It lacks necessary context, making it less helpful despite its brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema or further details are provided. The description mentions a 'shareable URL' but does not specify its format or content. Given the presence of sibling tools with overlapping functionality, more context is needed for complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already covers the single parameter 'code' with a description. The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool shares Go code and returns a shareable URL. It is specific about the verb ('Share') and resource ('Go code'), and it naturally distinguishes from siblings like run_go_code (executes without sharing) and run_and_share_go_code (does both).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description does not indicate when to use this tool versus siblings like run_and_share_go_code or execute_go_playground_url, nor does it specify prerequisites or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.0
    • Addedexecute_go_playground_url
    • Addedread_go_playground_url
  2. 3 tool updates
    • First observedrun_and_share_go_code
    • First observedrun_go_code
    • First observedshare_go_code

TDQS

B3.2/5.0
Disambiguation3/5

The tools have overlapping purposes that could cause confusion, especially between run_go_code and run_and_share_go_code, where the latter seems to combine the former with share_go_code. However, the descriptions clarify the distinctions, such as execute_go_playground_url focusing on existing URLs versus run_go_code for direct code execution.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern with underscores, such as execute_go_playground_url and run_go_code. There is a minor deviation with run_and_share_go_code, which uses 'and' in the name, but overall the pattern is clear and predictable.

Tool Count4/5

With 5 tools, the count is reasonable for a Go Playground server, covering execution, reading, and sharing functionalities. It is slightly over-scoped as some tools could be merged (e.g., run_go_code and run_and_share_go_code), but it remains well within an appropriate range.

Completeness4/5

The toolset covers core operations for a Go Playground domain: executing code from URLs, reading code, running code directly, and sharing results. A minor gap exists in update or delete operations for shared URLs, but agents can work around this, and the surface supports typical workflows effectively.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables execution of code in a sandbox environment with integrated web search capabilities. Provides a basic framework for running code safely, primarily designed for AI agents and research applications.
    13
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time access to Go package documentation, function signatures, and type definitions directly from pkg.go.dev. It enables LLMs to search for packages, retrieve specific versions, and access code examples from the official Go module ecosystem.
    19
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables secure cloud-based execution of code across 14+ programming languages within a sandboxed environment. It supports file management, standard input/output handling, and automatic generation of visual artifacts like plots and charts.
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Execute code in 8 programming languages via gVisor-sandboxed Docker containers. Supports Python, JS, TS, Go, Java, C++, C, and Bash.
    2
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samber/go-playground-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server