About Sample MCP Server in Go.
A Go MCP server that runs a Python environment to execute code generated by an LLM, including code for web scraping. It is intended for developers testing MCP tool use with an MCP host and uses Podman as its container engine.
Key features
- 01Run a Python environment on tool calls
- 02Execute LLM-generated code
- 03Support web-scraping tasks
- 04Use Podman as the container engine
- 05Build with Go 1.23+
Use cases
- 01Run generated Python code through an MCP host
- 02Scrape web content with an LLM-generated script
MCP support
The server exposes a Python code execution tool to MCP clients. The README demonstrates configuring it in `mcphost` as `python-repl`.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMESample MCP Server in Go.
This MCP server runs a Python environment when called that can be used to execute the code generated by an LLM. It can be useful for scraping web content.
This project is based on this demo on YouTube with a few slight mods.
This demo uses Podman as the container engine instead of Docker.
Build the project
This project requires Go 1.23+. To build locally:
$ go mod tidy && go install
Testing with a lab host
For testing use mcphost: https://github.com/mark3labs/mcphost
Configure the MCP server
Edit the ~/.mcp.json file adding the following content:
{
"mcpServers": {
"python-repl": {
"command": "python-mcp-server"
}
}
}
This configuration tells the mcphost to run the python-mcp-server command aliased as python-repl.
Running mcphost
This example uses Claude-3.5 Sonnet as the defaul LLM. This allows testing without a local GPU.
Export the Anthropic key:
$ export ANTHROPIC_API_KEY='your-api-key'
Execute the host
$ mcphost
It should prompt something like this:
$ mcphost
2025/04/28 21:44:32 INFO Model loaded provider=anthropic model=claude-3-5-sonnet-latest
2025/04/28 21:44:32 INFO Initializing server... name=python-repl
2025/04/28 21:44:32 INFO Server connected name=python-repl
2025/04/28 21:44:32 INFO Tools loaded server=python-repl count=1
Enter your prompt (Type /help for commands, Ctrl+C to quit)
From now on it is possible to prompt requests that imply a web scraping to see the MCP server in action.
Enter your prompt (Type /help for commands, Ctrl+C to quit)
Show me the most starred repositories on github
Assistant:
I'll create a script to fetch the most starred repositories from GitHub using their API:
2025/04/28 22:14:16 INFO 🔧 Using tool name=python-repl__execute-python
2025/04/28 22:14:16 INFO Usage statistics input_tokens=1665 output_tokens=309 total_tokens=1974
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.