PharoAgent is a lightweight TCP server for Pharo that lets external tools send Smalltalk snippets for evaluation and trigger browser navigation commands.
To install stable version of PharoAgent in your image you can use:
Metacello new
githubUser: 'pharo-llm' project: 'pharo-agent' commitish: 'X.X.X' path: 'src';
baseline: 'LLMPharoAgent';
loadFor development version install it with this:
Metacello new
githubUser: 'pharo-llm' project: 'pharo-agent' commitish: 'main' path: 'src';
baseline: 'LLMPharoAgent';
load.In the Playground, run:
PharoAgent startTo use a custom port:
PharoAgent startOn: 4044If you reloaded the class and want a fresh restart, run:
PharoAgent stop.
PharoAgent resetDefault.
PharoAgent startecho "3 + 4" | nc localhost 4044Expected output:
7
echo "OPEN_CLASS_BROWSER String" | nc localhost 4044PharoAgent ships with an MCP server (LLM-Pharo-MCP) that exposes the running
image over HTTP so CLI agents like Claude Code,
Codex, or Qwen Code can talk directly to it — evaluate Smalltalk, open browsers,
read class and method source — without spawning a fresh headless Pharo per call.
In a Playground:
PharoAgent startMcp.
"or on a custom port"
PharoAgent startMcpOn: 4046.The server listens on http://localhost:4046/mcp by default. Override with the
PHARO_MCP_PORT environment variable before launching the image.
To stop it:
PharoAgent stopMcp.The repo ships a ready-to-use .mcp.json at the root:
{
"mcpServers": {
"pharo": {
"type": "http",
"url": "http://localhost:4046/mcp"
}
}
}Claude Code picks it up automatically when started from the repo root. For Codex, Qwen or any other MCP-speaking client, point its MCP config at the same URL.
| Tool | Description |
|---|---|
pharo_eval |
Evaluate a Smalltalk expression, returns its printString |
pharo_open_class_browser |
Open a System Browser on the given class |
pharo_open_method_browser |
Open a System Browser on ClassName>>selector |
pharo_class_source |
Return the class definition and its selector list |
pharo_method_source |
Return the source of a single method |
| URI | Description |
|---|---|
pharo://system/info |
Pharo version, package count, image path |
pharo://class/{className} |
Class definition + method list |
pharo://method/{className}/{selector} |
Source of a single method |