Pharo Smalltalk Interop Mcp Server

by mumez

199 downloads
Not rated
GitHub

About

MCP server to communicate local Pharo Smalltalk image.

Details

Author
mumez
Downloads
199
Categories
Other

- Execute Smalltalk expressions and return results
- Retrieve class and method source code and comments
- Search classes, methods, traits, implementors, and references
- Export and import packages in Tonel format
- Install projects via Metacello
- Run test suites at package or class level
- Capture screenshots and inspect UI structure for debugging
- Retrieve and modify server settings dynamically

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Pharo Smalltalk Interop Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Requires Python 3.10+, uv package manager, and a Pharo image with PharoSmalltalkInteropServer installed. Run using uvx (no installation) or after cloning the repository using uv run. Configure with environment variable PHARO_SIS_PORT (default 8086). The server exposes 22 MCP tools.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "pharo smalltalk interop mcp server": {
            "smalltalk-interop": {
                "command": "uvx",
                "args": [
                    "--from",
                    "git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git",
                    "pharo-smalltalk-interop-mcp-server"
                ],
                "env": {
                    "PHARO_SIS_PORT": "8086"
                }
            }
        }
    }
}

McpServers

{
    "smalltalk-interop": {
        "command": "uvx",
        "args": [
            "--from",
            "git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git",
            "pharo-smalltalk-interop-mcp-server"
        ],
        "env": {
            "PHARO_SIS_PORT": "8086"
        }
    }
}

pharo-smalltalk-interop-mcp-server

CI

A local MCP server to communicate local Pharo Smalltalk image.
It supports:

- Code Evaluation: Execute Smalltalk expressions and return results
- Code Introspection: Retrieve source code, comments, and metadata for classes and methods
- Search & Discovery: Find classes, traits, methods, references, and implementors
- Package Management: Export and import packages in Tonel format
- Project Installation: Install projects using Metacello
- Test Execution: Run test suites at package or class level
- UI Debugging: Capture screenshots and inspect UI structure for World morphs, Spec presenters, and Roassal visualizations
- Server Configuration: Retrieve and modify server settings dynamically

Prerequisites

- Python 3.10 or later
- uv package manager
- Pharo with PharoSmalltalkInteropServer installed

Installation

Quick Start (using uvx)

The easiest way to run the server without cloning the repository:

uvx --from git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git pharo-smalltalk-interop-mcp-server

Development Installation

To set up for development:

1. Clone the repository:

git clone https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git

2. Install dependencies using uv:

cd pharo-smalltalk-interop-mcp-server
uv sync --dev

Usage

Running the MCP Server

Using uvx (no installation required):

uvx --from git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git pharo-smalltalk-interop-mcp-server

Using uv (after cloning the repository):

uv run pharo-smalltalk-interop-mcp-server

Environment Variables

You can configure the server using environment variables:

- PHARO_SIS_PORT: Port number for PharoSmalltalkInteropServer (default: 8086)

Examples:

Using uvx:

PHARO_SIS_PORT=8086 uvx --from git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git pharo-smalltalk-interop-mcp-server

Using uv:

PHARO_SIS_PORT=9999 uv run pharo-smalltalk-interop-mcp-server

Cursor MCP settings

Using uvx (recommended):

``json:mcp.json
{
"mcpServers": {
"smalltalk-interop": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git",
"pharo-smalltalk-interop-mcp-server"
],
"env": {
"PHARO_SIS_PORT": "8086"
}
}
}
}


Using uv (after cloning):

json:mcp.json
{
"mcpServers": {
"smalltalk-interop": {
"command": "uv",
"args": [
"--directory",
"/your-path/to/pharo-smalltalk-interop-mcp-server",
"run",
"pharo-smalltalk-interop-mcp-server"
],
"env": {
"PHARO_SIS_PORT": "8086"
}
}
}
}

Note: The
env section is optional and can be used to set environment variables for the MCP server.

Claude Code Configuration

Using uvx (recommended):

bash
claude mcp add -s user smalltalk-interop -- uvx --from git+https://github.com/mumez/pharo-smalltalk-interop-mcp-server.git pharo-smalltalk-interop-mcp-server

Using uv (after cloning):

bash
claude mcp add -s user smalltalk-interop -- uv --directory /path/to/pharo-smalltalk-interop-mcp-server run pharo-smalltalk-interop-mcp-server

MCP Tools Available

This server provides 22 MCP tools that map to all PharoSmalltalkInteropServer APIs:

Code Evaluation

- eval: Execute Smalltalk expressions and return results

Code Introspection

- get_class_source: Retrieve source code of a class
-
get_method_source: Retrieve source code of a specific method
-
get_class_comment: Retrieve comment/documentation of a class

Search & Discovery

- search_classes_like: Find classes matching a pattern
-
search_methods_like: Find methods matching a pattern
-
search_traits_like: Find traits matching a pattern
-
search_implementors: Find all implementors of a method selector
-
search_references: Find all references to a method selector
-
search_references_to_class: Find all references to a class

Package Management

- list_packages: List all packages in the image
-
list_classes: List classes in a specific package
-
list_extended_classes: List extended classes in a package
-
list_methods: List methods in a package
-
export_package: Export a package in Tonel format
-
import_package: Import a package from specified path

Project Installation

- install_project: Install a project using Metacello with optional load groups

Test Execution

- run_package_test: Run test suites for a package
-
run_class_test: Run test suites for a specific class

UI Debugging

- read_screen: UI screen reader for debugging Pharo interfaces with screenshot and structure extraction

Server Configuration

- get_settings: Retrieve current server configuration
-
apply_settings: Modify server configuration dynamically

read_screen Tool

The read_screen tool captures screenshots and extracts UI structure for debugging Pharo UI issues.

Parameters:

- target_type (string, default: 'world'): UI type to inspect ('world' for morphs, 'spec' for windows, 'roassal' for visualizations)
-
capture_screenshot` (boolean, default: true): Include PNG screenshot in response

Returns: UI structure with screenshot and human-readable summary

Usage Examples:

python

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.