@evref-bl/pharo-mcp 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -7
- package/package.json +1 -1
- package/templates/pharo-references/pharo-coding.md +105 -0
- package/templates/pharo-references/tool-reference.md +78 -158
- package/templates/pharo-skills/pharo-ci-repro/references/pharo-smalltalkci.md +4 -28
- package/templates/pharo-skills/pharo-code-profiling/SKILL.md +19 -38
- package/templates/pharo-skills/pharo-image-sync/SKILL.md +47 -0
- package/templates/pharo-skills/pharo-image-sync/agents/openai.yaml +4 -0
- package/templates/pharo-skills/pharo-mcp-recovery/SKILL.md +1 -1
- package/templates/pharo-skills/pharo-project-load/SKILL.md +2 -1
- package/templates/pharo.AGENTS.md +16 -14
- package/templates/pharo-references/building-on-mcp.md +0 -473
- package/templates/pharo-references/debugging.md +0 -70
- package/templates/pharo-references/getting-started.md +0 -151
- package/templates/pharo-references/pharo-coding-rules.md +0 -147
- package/templates/pharo-references/pharo-coding-style.md +0 -141
- package/templates/pharo-references/safety-and-ecosystem.md +0 -323
- package/templates/pharo-references/source-vs-live-image.md +0 -75
- package/templates/pharo-references/troubleshooting.md +0 -145
- package/templates/pharo-references/using-pharo-mcp.md +0 -86
- package/templates/pharo-skills/pharo-image-git-handoff/SKILL.md +0 -40
- package/templates/pharo-skills/pharo-image-git-handoff/agents/openai.yaml +0 -4
- package/templates/pharo-skills/pharo-version-compat/SKILL.md +0 -54
- package/templates/pharo-skills/pharo-version-compat/agents/openai.yaml +0 -4
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
# Safety And Ecosystem Integration
|
|
2
|
-
|
|
3
|
-
MCP is safest when callers use the dedicated tools before falling back to raw
|
|
4
|
-
evaluation. The tools are built around Pharo's normal development systems, so an
|
|
5
|
-
agent works through image-aware operations instead of editing exported source
|
|
6
|
-
text blindly.
|
|
7
|
-
|
|
8
|
-
## Tool Boundary
|
|
9
|
-
|
|
10
|
-
Each tool owns its MCP metadata:
|
|
11
|
-
|
|
12
|
-
- name and title
|
|
13
|
-
- description
|
|
14
|
-
- icon
|
|
15
|
-
- input JSON schema
|
|
16
|
-
- output JSON schema
|
|
17
|
-
|
|
18
|
-
The execution path is:
|
|
19
|
-
|
|
20
|
-
1. The HTTP endpoint receives a JSON-RPC `tools/call`.
|
|
21
|
-
2. `MCPToolRequest` validates raw arguments against the tool input schema.
|
|
22
|
-
3. The concrete tool parses the request into a typed request or spec object.
|
|
23
|
-
4. The tool dispatches a command or query object.
|
|
24
|
-
5. The command uses Pharo APIs to query or mutate the image.
|
|
25
|
-
6. The tool returns a payload with `summary`, `warnings`, and either `data` or
|
|
26
|
-
`error`, with a failure flagged by the protocol's own `isError`. By default
|
|
27
|
-
this payload reaches the MCP `content` field; the server can also emit
|
|
28
|
-
`structuredContent` for clients that need programmatic results.
|
|
29
|
-
|
|
30
|
-
### Notifications
|
|
31
|
-
|
|
32
|
-
A notification is not a failed call. Pharo signals them for remarks rather than
|
|
33
|
-
faults, and every `Warning` is one. The tool boundary resumes them with the
|
|
34
|
-
value the image itself would have produced and the call proceeds, so a
|
|
35
|
-
deprecated send, or an undeclared variable during a package load, does not fail
|
|
36
|
-
it. A deprecated method called from a test does not abort the suite.
|
|
37
|
-
|
|
38
|
-
Refactoring warnings are the exception. `RBRefactoringWarning` reports a change
|
|
39
|
-
that breaks something, so it reaches the boundary unresumed and stops the call,
|
|
40
|
-
aborting a removal or a rename that `force=true` did not authorize.
|
|
41
|
-
|
|
42
|
-
```mermaid
|
|
43
|
-
sequenceDiagram
|
|
44
|
-
participant Client
|
|
45
|
-
participant HTTP as HTTP Endpoint
|
|
46
|
-
participant Req as MCPToolRequest
|
|
47
|
-
participant Tool as Concrete Tool
|
|
48
|
-
participant Cmd as Command/Query
|
|
49
|
-
participant Pharo as Pharo Image
|
|
50
|
-
|
|
51
|
-
Client->>HTTP: JSON-RPC tools/call
|
|
52
|
-
HTTP->>Req: validate raw arguments
|
|
53
|
-
Req->>Req: check against tool input schema
|
|
54
|
-
alt invalid arguments
|
|
55
|
-
Req-->>HTTP: validation error
|
|
56
|
-
HTTP-->>Client: error response
|
|
57
|
-
else valid arguments
|
|
58
|
-
Req->>Tool: validated arguments
|
|
59
|
-
Tool->>Tool: parse into typed request/spec
|
|
60
|
-
Tool->>Cmd: dispatch command or query
|
|
61
|
-
Cmd->>Pharo: query or mutate image via Pharo APIs
|
|
62
|
-
Pharo-->>Cmd: result / side effect
|
|
63
|
-
Cmd-->>Tool: outcome
|
|
64
|
-
Tool-->>HTTP: structured content (status, summary, warnings, data/error)
|
|
65
|
-
HTTP-->>Client: JSON-RPC response
|
|
66
|
-
end
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
This keeps transport parsing, schema validation, image operations, and result
|
|
70
|
-
formatting in separate places.
|
|
71
|
-
|
|
72
|
-
## Refactorings
|
|
73
|
-
|
|
74
|
-
Class and method edits use Refactoring Browser and Refactoring Engine operations
|
|
75
|
-
where Pharo owns the behavior.
|
|
76
|
-
|
|
77
|
-
Examples include:
|
|
78
|
-
|
|
79
|
-
- class rename with `ReRenameClassRefactoring`
|
|
80
|
-
- class removal with `ReRemoveClassRefactoring`
|
|
81
|
-
- method rename with `ReRenameMethodRefactoring`
|
|
82
|
-
- argument add/remove with `RBAddParameterRefactoring` and
|
|
83
|
-
`RBRemoveParameterRefactoring`
|
|
84
|
-
- slot add, remove, rename, pull-up, and push-down with the corresponding
|
|
85
|
-
instance-variable refactorings
|
|
86
|
-
- method batch removal with `ReRemoveMethodsRefactoring`
|
|
87
|
-
|
|
88
|
-
When a refactoring raises `RBRefactoringWarning`, the default behavior is to
|
|
89
|
-
stop. The tool result includes:
|
|
90
|
-
|
|
91
|
-
```text
|
|
92
|
-
impactMessages
|
|
93
|
-
howToProceed
|
|
94
|
-
forceSupported: true
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Review the impact and rerun the same request with `force=true` only when the
|
|
98
|
-
warning is acceptable. When forced, the warning messages are returned in the
|
|
99
|
-
normal `warnings` array.
|
|
100
|
-
|
|
101
|
-
## Critiques
|
|
102
|
-
|
|
103
|
-
`method_compile` compiles method source in the image and returns selected Renraku
|
|
104
|
-
critiques in the structured result. It includes error-severity critiques and a
|
|
105
|
-
small set of non-error rules that are useful after automated edits, such as
|
|
106
|
-
excessive arguments, missing super sends, return in ensure, temporary variable
|
|
107
|
-
overrides, and unary accessing methods without returns.
|
|
108
|
-
|
|
109
|
-
Critiques include:
|
|
110
|
-
|
|
111
|
-
- Renraku rule class
|
|
112
|
-
- title
|
|
113
|
-
- description
|
|
114
|
-
- source interval when available
|
|
115
|
-
|
|
116
|
-
The method may compile successfully and still return critiques. Treat critiques
|
|
117
|
-
as follow-up review evidence, not as transport failures.
|
|
118
|
-
|
|
119
|
-
## Rewriting Methods
|
|
120
|
-
|
|
121
|
-
`method_rewrite` uses Smalltalk AST rewrite patterns, not regex. A rule has a
|
|
122
|
-
`match` and a `replacement`, and a scope is required, so rewriting everything is
|
|
123
|
-
something a caller asks for by naming the packages rather than by leaving an
|
|
124
|
-
argument out.
|
|
125
|
-
|
|
126
|
-
A metavariable starts with a backquote and stands for whatever is in its place.
|
|
127
|
-
`` `@receiver `` matches one expression, however big: the same rule rewrites
|
|
128
|
-
`anObject notNil` and `(anObject foo) notNil`. **The names must be the same on
|
|
129
|
-
both sides** — a name that appears only in `replacement` is bound to nothing.
|
|
130
|
-
|
|
131
|
-
The default mode is preview, which carries the old and new source of every
|
|
132
|
-
change:
|
|
133
|
-
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"rules": [
|
|
137
|
-
{
|
|
138
|
-
"match": "`@receiver notNil",
|
|
139
|
-
"replacement": "`@receiver isNotNil"
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"scope": { "packages": ["MyPackage"] }
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
A metavariable stands for a block just as readily, which is how a rule drops
|
|
147
|
-
one branch of a conditional:
|
|
148
|
-
|
|
149
|
-
```json
|
|
150
|
-
{
|
|
151
|
-
"rules": [
|
|
152
|
-
{
|
|
153
|
-
"match": "`@receiver ifTrue: [ `@body ] ifFalse: [ nil ]",
|
|
154
|
-
"replacement": "`@receiver ifTrue: [ `@body ]"
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"scope": { "packages": ["MyPackage"] }
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Add `apply` to make the changes. One call is enough; preview first only when
|
|
162
|
-
you want to read them before they land. `history_entry_revert` undoes a rewrite
|
|
163
|
-
that turned out wrong.
|
|
164
|
-
|
|
165
|
-
Any rewrite rule stands for its own patterns, so its name can be given instead
|
|
166
|
-
of writing them out. That includes Pharo's own, not only MCP's:
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"ruleClasses": ["MCPCollectionThenDoRule"],
|
|
171
|
-
"scope": { "packages": ["MyPackage"] },
|
|
172
|
-
"apply": true
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Rules that report a critique are not applied by the tools that compile. A
|
|
177
|
-
compile reports what it would change; changing it is this tool's job, and the
|
|
178
|
-
caller asks.
|
|
179
|
-
|
|
180
|
-
## Tests And Coverage
|
|
181
|
-
|
|
182
|
-
`test_run` runs SUnit classes or individual methods and returns structured test
|
|
183
|
-
results. Use `test_coverage_run` when the same test run should collect
|
|
184
|
-
CoverageCollector method and node coverage for an explicit method scope.
|
|
185
|
-
`test_run` deduplicates concrete test cases across a batch. Use
|
|
186
|
-
`selectedTestCount` for selected unique tests, `runCount` for non-skipped
|
|
187
|
-
executed tests, and `skippedCount` for skipped tests.
|
|
188
|
-
|
|
189
|
-
Coverage output includes method counts, node counts, uncovered methods,
|
|
190
|
-
partially covered methods, and optional covered method details. Use it after
|
|
191
|
-
edits to ask whether the relevant methods were exercised.
|
|
192
|
-
|
|
193
|
-
## Repository Work
|
|
194
|
-
|
|
195
|
-
MCP uses Iceberg for repository state. The repository tools can:
|
|
196
|
-
|
|
197
|
-
- list registered repositories and their branch, head, package, modified, and
|
|
198
|
-
remote metadata
|
|
199
|
-
- load Metacello baselines
|
|
200
|
-
- create image-side repository registrations or update their metadata,
|
|
201
|
-
including registrations for linked Git worktree checkouts
|
|
202
|
-
- inspect `workingCopyDiff`
|
|
203
|
-
- verify expected repository identity before edits or exports
|
|
204
|
-
- export image changes to Tonel files
|
|
205
|
-
- commit, fetch, pull, push, create branches, and switch branches
|
|
206
|
-
|
|
207
|
-
Use `repository_identity_verify` before edits or exports, and
|
|
208
|
-
`repository_change_list` before exporting or committing. Use
|
|
209
|
-
`repository_create`, `repository_attach`, and `repository_update` for repository
|
|
210
|
-
registration workflows. Export writes image changes to disk and updates the
|
|
211
|
-
Iceberg index; it does not stage or commit Git changes.
|
|
212
|
-
|
|
213
|
-
## Change History
|
|
214
|
-
|
|
215
|
-
MCP uses Epicea change history. `history_file_list` lists `.ombu`
|
|
216
|
-
files, and `history_entry_list` lists entries from the current history
|
|
217
|
-
or a selected file. `history_entry_apply` and `history_entry_revert` preview
|
|
218
|
-
selected entries, and perform the selected apply or revert only when
|
|
219
|
-
`confirm=true`.
|
|
220
|
-
|
|
221
|
-
Use this when recovering image-side changes or preparing a clean handoff from a
|
|
222
|
-
live image back to Tonel/Git.
|
|
223
|
-
|
|
224
|
-
## Debugging
|
|
225
|
-
|
|
226
|
-
Debugger tools are discoverable through the `debugging` group. They keep no
|
|
227
|
-
state: `debug_watch` installs non-halting probes and removes them before it
|
|
228
|
-
answers, and `debug_search` only reads the debuggers a person has open.
|
|
229
|
-
|
|
230
|
-
A debugger somebody opened belongs to them. Read it, then act with the ordinary
|
|
231
|
-
class and method tools; do not step, resume or terminate it.
|
|
232
|
-
|
|
233
|
-
## Evaluation Escape Hatch
|
|
234
|
-
|
|
235
|
-
`image_evaluate` runs arbitrary Smalltalk in the running image without saving
|
|
236
|
-
it. It is useful for short inspection or glue code when no dedicated tool
|
|
237
|
-
exists.
|
|
238
|
-
|
|
239
|
-
Prefer a dedicated tool when one exists, because the dedicated tools validate
|
|
240
|
-
input, return structured result data, and often use safer Pharo APIs.
|
|
241
|
-
|
|
242
|
-
Compiling source is one of those cases. Method source in the image separates
|
|
243
|
-
lines with CR, and `method_compile` normalizes what it is given; a bare
|
|
244
|
-
`compile:` from `image_evaluate` stores whatever it receives, so source written
|
|
245
|
-
with LF compares unequal to every other method in the image. Use
|
|
246
|
-
`method_compile` for a method, and `withInternalLineEndings` if you must compile
|
|
247
|
-
source by hand.
|
|
248
|
-
|
|
249
|
-
## Observability And UI
|
|
250
|
-
|
|
251
|
-
The servers an image holds are listed under `Library → MCP Servers` in the
|
|
252
|
-
world menu, and on the `Servers` tab of an inspected `MCP` class. From there a
|
|
253
|
-
server can be started, stopped, or opened in its dashboard, and a new one
|
|
254
|
-
created on a port, where 0 asks for a free one. The tool catalog sits beside it
|
|
255
|
-
under `Library → MCP Tool Catalog`, since it describes the image rather than
|
|
256
|
-
any one server. The same list in a script:
|
|
257
|
-
|
|
258
|
-
```smalltalk
|
|
259
|
-
MCP allServers
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
It is taken from the heap rather than from a registry, so a server is never
|
|
263
|
-
kept alive for being listable, and one that is still holding a port after its
|
|
264
|
-
owner forgot it is shown rather than hidden.
|
|
265
|
-
|
|
266
|
-
To reach the server on a port, whether or not this script is the one that
|
|
267
|
-
started it, ask for the port rather than for a new server:
|
|
268
|
-
|
|
269
|
-
```smalltalk
|
|
270
|
-
MCP startOnPort: 4000
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
That answers the server already on 4000, starting it if it was stopped, and
|
|
274
|
-
makes one only when the image has none there. Starting a second server on a
|
|
275
|
-
taken port fails after a couple of seconds, and the error now says when the
|
|
276
|
-
port is held by another MCP in the same image.
|
|
277
|
-
|
|
278
|
-
An inspected `MCP` object has a dashboard tab and an observability tab. The
|
|
279
|
-
dashboard runs the server:
|
|
280
|
-
|
|
281
|
-
- server status, endpoint and port
|
|
282
|
-
- debug mode
|
|
283
|
-
- every tool the server could run, with `Enabled` for whether it has the tool
|
|
284
|
-
at all and `Listed` for whether `tools/list` shows it; an unlisted tool is
|
|
285
|
-
still found by `tool_search` and still runs
|
|
286
|
-
|
|
287
|
-
The observability tab shows what the server recorded about itself:
|
|
288
|
-
|
|
289
|
-
- per-tool timing metrics
|
|
290
|
-
- traces for errors, outliers, and output overruns
|
|
291
|
-
- recent logs
|
|
292
|
-
- auto-refresh while the tab is displayed
|
|
293
|
-
|
|
294
|
-
MCP starts with the built-in JSON observability backend enabled. Disable it for
|
|
295
|
-
a specific server when its local metrics, traces, and logs are not wanted:
|
|
296
|
-
|
|
297
|
-
```smalltalk
|
|
298
|
-
mcp observabilityEnabled: false
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
By default, JSON observability exports under the image-local
|
|
302
|
-
`pharo-local/mcp/observability` directory. Configure
|
|
303
|
-
`mcp observabilityExportDirectory: aDirectory` to override that export root for
|
|
304
|
-
instance metadata, `logs.jsonl`, `metrics.json`, and `traces.jsonl`.
|
|
305
|
-
|
|
306
|
-
OpenTelemetry support is optional. Load the `Telemetry` group, then enable
|
|
307
|
-
the OpenTelemetry backend for an MCP instance:
|
|
308
|
-
|
|
309
|
-
```smalltalk
|
|
310
|
-
Metacello new
|
|
311
|
-
baseline: 'MCP';
|
|
312
|
-
repository: 'github://Evref-BL/MCP:main/src';
|
|
313
|
-
load: 'Telemetry'.
|
|
314
|
-
|
|
315
|
-
mcp useOpenTelemetryObservability
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
## Version Compatibility
|
|
319
|
-
|
|
320
|
-
The core baseline loads PharoBackwardCompatibility, JRPC, and PCRE2.
|
|
321
|
-
OpenTelemetry is loaded only by the optional `Telemetry` group. CI covers
|
|
322
|
-
Pharo 12, 13, 14, and 15. Code should target the Pharo 14 API;
|
|
323
|
-
PharoBackwardCompatibility backports supported APIs to older images.
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Source Files Vs Live Pharo Image State
|
|
2
|
-
|
|
3
|
-
Applies when an agent uses the Pharo MCP server to inspect, modify, or verify a
|
|
4
|
-
Pharo project.
|
|
5
|
-
|
|
6
|
-
## Goal
|
|
7
|
-
|
|
8
|
-
Keep source inspection, loaded image state, Iceberg state, and Git state
|
|
9
|
-
separate. Each one can answer different questions, and none should be treated
|
|
10
|
-
as a substitute for the others.
|
|
11
|
-
|
|
12
|
-
## Source-Only Checks
|
|
13
|
-
|
|
14
|
-
Source-only checks can confirm:
|
|
15
|
-
|
|
16
|
-
- files exist where expected;
|
|
17
|
-
- packages, classes, and methods are exported in Tonel;
|
|
18
|
-
- baseline files and package declarations look coherent;
|
|
19
|
-
- static documentation and scripts are present;
|
|
20
|
-
- Git diffs contain the expected source changes;
|
|
21
|
-
- formatting and whitespace checks pass.
|
|
22
|
-
|
|
23
|
-
Source-only checks cannot prove:
|
|
24
|
-
|
|
25
|
-
- the project loads in the image;
|
|
26
|
-
- classes and methods are currently loaded;
|
|
27
|
-
- tools see the expected image state;
|
|
28
|
-
- tests pass inside the image;
|
|
29
|
-
- image-side edits were exported to source;
|
|
30
|
-
- the running server or application behaves correctly.
|
|
31
|
-
|
|
32
|
-
## Live Image Checks
|
|
33
|
-
|
|
34
|
-
Use live image checks when the answer depends on image state:
|
|
35
|
-
|
|
36
|
-
- loading a baseline or package;
|
|
37
|
-
- listing loaded repositories, packages, classes, or methods;
|
|
38
|
-
- inspecting compiled methods or class definitions;
|
|
39
|
-
- running SUnit tests;
|
|
40
|
-
- starting or exercising a server/application in the image;
|
|
41
|
-
- applying image-side edits;
|
|
42
|
-
- exporting image-side changes to Tonel or Git.
|
|
43
|
-
|
|
44
|
-
Prefer dedicated `pharo` MCP tools for these checks. Use `image_evaluate` only
|
|
45
|
-
when no dedicated tool fits.
|
|
46
|
-
|
|
47
|
-
## Iceberg And Git
|
|
48
|
-
|
|
49
|
-
Remember:
|
|
50
|
-
|
|
51
|
-
- Tonel files are exported source.
|
|
52
|
-
- The loaded image can differ from Tonel files.
|
|
53
|
-
- Iceberg working-copy state can differ from both image state and Git state.
|
|
54
|
-
- Git commits record disk files, not unsaved image changes.
|
|
55
|
-
|
|
56
|
-
When these states disagree, report the mismatch and resolve it deliberately.
|
|
57
|
-
Do not claim a change is complete just because one layer looks correct.
|
|
58
|
-
|
|
59
|
-
## Blocked Live Verification
|
|
60
|
-
|
|
61
|
-
If the current context does not have a safe or approved live image:
|
|
62
|
-
|
|
63
|
-
- run only source-safe checks;
|
|
64
|
-
- say which live checks are still needed;
|
|
65
|
-
- do not use image-side evaluation or mutation as a workaround;
|
|
66
|
-
- do not claim live behavior is verified.
|
|
67
|
-
|
|
68
|
-
## Reporting
|
|
69
|
-
|
|
70
|
-
When finishing work, report:
|
|
71
|
-
|
|
72
|
-
- source checks run;
|
|
73
|
-
- live image checks run;
|
|
74
|
-
- live checks not run and why;
|
|
75
|
-
- any image/source/Iceberg/Git state mismatch observed.
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Troubleshooting
|
|
2
|
-
|
|
3
|
-
Most failures fall into one of three groups: the image is not reachable, the
|
|
4
|
-
requested tool input is invalid, or the live image state differs from what the
|
|
5
|
-
caller expected.
|
|
6
|
-
|
|
7
|
-
For standalone image crashes or stopped servers, the installed
|
|
8
|
-
`pharo-mcp-recovery` skill gives agents a recovery workflow for preserving
|
|
9
|
-
evidence, restarting or replacing the image, reloading projects, and recovering
|
|
10
|
-
change history.
|
|
11
|
-
|
|
12
|
-
## The Client Cannot Connect
|
|
13
|
-
|
|
14
|
-
Ask the image what servers it holds, which answers after a restart even when
|
|
15
|
-
nothing in the workspace refers to one:
|
|
16
|
-
|
|
17
|
-
```smalltalk
|
|
18
|
-
MCP allServers.
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
`Library → MCP Servers` in the world menu shows the same list, with the state,
|
|
22
|
-
port and endpoint of each, and starts or stops the one selected.
|
|
23
|
-
|
|
24
|
-
Check a server directly:
|
|
25
|
-
|
|
26
|
-
```smalltalk
|
|
27
|
-
mcp isRunning.
|
|
28
|
-
mcp isListening.
|
|
29
|
-
mcp localUrlString.
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Confirm that the client URL uses the same host and port:
|
|
33
|
-
|
|
34
|
-
```text
|
|
35
|
-
http://127.0.0.1:4000
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
If you changed the port in Pharo, update the MCP client configuration.
|
|
39
|
-
|
|
40
|
-
MCP handles MCP calls over HTTP POST. Unsupported HTTP methods
|
|
41
|
-
return method-not-allowed instead of hanging.
|
|
42
|
-
|
|
43
|
-
## `tools/list` Is Empty Or Stale
|
|
44
|
-
|
|
45
|
-
Run:
|
|
46
|
-
|
|
47
|
-
```smalltalk
|
|
48
|
-
mcp refreshToolsList.
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Then call `tools/list` again. If you loaded new MCP code into the image, restart
|
|
52
|
-
the server:
|
|
53
|
-
|
|
54
|
-
```smalltalk
|
|
55
|
-
mcp restart.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## A Tool Rejects Input
|
|
59
|
-
|
|
60
|
-
Each tool validates arguments against its input schema. Call `tools/list` and
|
|
61
|
-
inspect the tool's `inputSchema`.
|
|
62
|
-
|
|
63
|
-
Common causes:
|
|
64
|
-
|
|
65
|
-
- missing required fields for the selected tool
|
|
66
|
-
- extra fields rejected by `additionalProperties: false`
|
|
67
|
-
- passing arguments from a different tool
|
|
68
|
-
- `history_entry_apply` or `history_entry_revert` without `confirm=true`
|
|
69
|
-
|
|
70
|
-
## A Refactoring Stops With A Warning
|
|
71
|
-
|
|
72
|
-
This is expected for Pharo refactoring warnings. With `force=false`, the edit
|
|
73
|
-
tool stops and returns impact details.
|
|
74
|
-
|
|
75
|
-
Read:
|
|
76
|
-
|
|
77
|
-
```text
|
|
78
|
-
impactMessages
|
|
79
|
-
howToProceed
|
|
80
|
-
forceSupported
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Rerun with `force=true` only when the impact is acceptable.
|
|
84
|
-
|
|
85
|
-
## A Method Compiles But Returns Critiques
|
|
86
|
-
|
|
87
|
-
`method_compile` can return Renraku critiques after compilation. The method exists,
|
|
88
|
-
but Pharo found review issues. Inspect the critique rule class, title,
|
|
89
|
-
description, and source interval if present.
|
|
90
|
-
|
|
91
|
-
Use a follow-up `method_compile`, `method_update`, `test_run`, or
|
|
92
|
-
`method_get` call depending on the critique.
|
|
93
|
-
|
|
94
|
-
## Repository State Looks Wrong
|
|
95
|
-
|
|
96
|
-
MCP reads repository state from Iceberg in the running image. The exported
|
|
97
|
-
Tonel files, the image's loaded packages, and Iceberg's working-copy state can
|
|
98
|
-
differ.
|
|
99
|
-
|
|
100
|
-
Start with:
|
|
101
|
-
|
|
102
|
-
```text
|
|
103
|
-
repository_search
|
|
104
|
-
repository_identity_verify
|
|
105
|
-
repository_change_list
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Use `repository_export` only when you mean to write image changes to files.
|
|
109
|
-
Export updates the Iceberg index but does not stage or commit Git changes.
|
|
110
|
-
|
|
111
|
-
## Tests Do Not Prove The Edited Scope
|
|
112
|
-
|
|
113
|
-
`test_run` tells you whether selected tests passed. Use `test_coverage_run` with
|
|
114
|
-
an explicit coverage scope when you need to know whether the edited methods
|
|
115
|
-
executed.
|
|
116
|
-
|
|
117
|
-
Coverage scopes should be narrow: package, class, hierarchy, or method names.
|
|
118
|
-
|
|
119
|
-
## The Image Changed Unexpectedly
|
|
120
|
-
|
|
121
|
-
Image-changing tools change the running image without saving it. If you are
|
|
122
|
-
using an automation or agent, run it against a copied or disposable image.
|
|
123
|
-
|
|
124
|
-
Use `history_file_list` and `history_entry_list` to inspect
|
|
125
|
-
Epicea history. Apply or revert operations stay in `history_entry_apply` and
|
|
126
|
-
`history_entry_revert`, where they can be previewed first and performed with
|
|
127
|
-
`confirm=true`.
|
|
128
|
-
|
|
129
|
-
## A Debugger Picture Goes Out Of Date
|
|
130
|
-
|
|
131
|
-
`debug_search` answers what is open at the moment it is called. A person can
|
|
132
|
-
step, resume or close their debugger at any time, so ask again rather than
|
|
133
|
-
acting on an older answer.
|
|
134
|
-
|
|
135
|
-
Do not drive debugger windows with raw `image_evaluate` code, and do not step,
|
|
136
|
-
resume or terminate a debugger a person opened.
|
|
137
|
-
|
|
138
|
-
## Source Checks Are Not Enough
|
|
139
|
-
|
|
140
|
-
Exported source files can confirm package layout, class definitions, and docs.
|
|
141
|
-
They cannot prove that the running image has loaded the latest code or that an
|
|
142
|
-
MCP tool works over HTTP.
|
|
143
|
-
|
|
144
|
-
Use [Source vs live image](source-vs-live-image.md) to decide which checks are
|
|
145
|
-
valid for the current work boundary.
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Using The Pharo MCP Server
|
|
2
|
-
|
|
3
|
-
Applies when an agent or user interacts with a running Pharo image through MCP.
|
|
4
|
-
Follow [Getting started](getting-started.md) to load, start, and connect first.
|
|
5
|
-
|
|
6
|
-
## Source Of Truth
|
|
7
|
-
|
|
8
|
-
Use the running image for live classes, methods, packages, repositories, and
|
|
9
|
-
tests. Tonel source, Iceberg, and Git are separate state layers; read
|
|
10
|
-
[Source files vs live image state](source-vs-live-image.md) before reasoning
|
|
11
|
-
across them.
|
|
12
|
-
|
|
13
|
-
If image access is unavailable, state which live check is blocked instead of
|
|
14
|
-
guessing from source or memory.
|
|
15
|
-
|
|
16
|
-
## Discover Before Calling
|
|
17
|
-
|
|
18
|
-
- Inspect the tools exposed by the current client; do not rely on remembered
|
|
19
|
-
names or schemas.
|
|
20
|
-
- Use `tool_search`, then `tool_get`, for less common tools. Call one by name
|
|
21
|
-
like any other, or through `tool_call` when the client will only send a name
|
|
22
|
-
its own list holds.
|
|
23
|
-
- Prefer the least-mutating dedicated tool. Use `image_evaluate` only when no
|
|
24
|
-
dedicated tool fits.
|
|
25
|
-
- Start list/search calls with the default page or a small `limit`. Continue
|
|
26
|
-
only when the result contains `nextOffset`.
|
|
27
|
-
|
|
28
|
-
See [Tool reference](tool-reference.md) for tool groups and common workflows.
|
|
29
|
-
|
|
30
|
-
## Choose Specialized Lookups
|
|
31
|
-
|
|
32
|
-
Use `method_search` for metadata, `method_source_search` for source,
|
|
33
|
-
`method_equivalent_search` for equivalent ASTs, and the implementor, sender,
|
|
34
|
-
class-reference, or variable-reference search matching the question.
|
|
35
|
-
|
|
36
|
-
For repository work, inspect with `repository_search`, verify identity before
|
|
37
|
-
mutation, and inspect `repository_change_list` before export or commit. Read
|
|
38
|
-
[Safety and ecosystem integration](safety-and-ecosystem.md) for mutation
|
|
39
|
-
boundaries.
|
|
40
|
-
|
|
41
|
-
`method_get` and `class_get` read several targets in one call when their
|
|
42
|
-
`selector` or `name` holds a list, and `method_compile` and `class_create`
|
|
43
|
-
write several the same way. See [Tool reference](tool-reference.md).
|
|
44
|
-
|
|
45
|
-
For history recovery, inspect files and entries before applying or reverting.
|
|
46
|
-
For watching values, debugger sessions, or repairs, read the installed local
|
|
47
|
-
debugging guide.
|
|
48
|
-
|
|
49
|
-
## Image Mutation
|
|
50
|
-
|
|
51
|
-
Mutating tools change the running image and never save it, so closing the image
|
|
52
|
-
discards everything since its last save. Saving is the caller's responsibility:
|
|
53
|
-
evaluate `Smalltalk saveSession` when a change should survive, or leave it to
|
|
54
|
-
whoever owns the image lifecycle. Use a copied or disposable image for broad or
|
|
55
|
-
risky edits, preview changes when the tool supports it, and run focused tests
|
|
56
|
-
after source changes.
|
|
57
|
-
|
|
58
|
-
Report incomplete or failing tool results clearly. Never silently fall back to
|
|
59
|
-
exported source for a question about the live image.
|
|
60
|
-
|
|
61
|
-
## Failures And Notifications
|
|
62
|
-
|
|
63
|
-
A notification is not a failure. Pharo signals them for remarks rather than
|
|
64
|
-
faults, and every `Warning` is one, so a deprecated send or an undeclared
|
|
65
|
-
variable during a load is resumed and the call proceeds. A refactoring warning
|
|
66
|
-
is the exception: it reports a change that breaks something, so it stops the
|
|
67
|
-
call until you rerun with `force=true`.
|
|
68
|
-
|
|
69
|
-
A failed call reports the error class, the message and the frames of the failing
|
|
70
|
-
code; the server's own frames are left out. For `image_evaluate` a compilation
|
|
71
|
-
failure also names the line and shows it, and a `MessageNotUnderstood` suggests
|
|
72
|
-
selectors the receiver does understand.
|
|
73
|
-
|
|
74
|
-
## Reusable Workflows
|
|
75
|
-
|
|
76
|
-
Run `npx @evref-bl/pharo-mcp install --host <host>` in the target project to
|
|
77
|
-
install context-routed skills for project loading, version compatibility,
|
|
78
|
-
image-to-Git handoff, CI reproduction, and standalone MCP recovery.
|
|
79
|
-
|
|
80
|
-
## Serving Your Own
|
|
81
|
-
|
|
82
|
-
An image can serve tools, resources and prompts a project defines itself,
|
|
83
|
-
from that project's own package and without changing MCP. Read
|
|
84
|
-
[Building on MCP](building-on-mcp.md) for the server-only load, what a tool,
|
|
85
|
-
a resource and a prompt each need, and how the surface a client sees is
|
|
86
|
-
shaped.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pharo-image-git-handoff
|
|
3
|
-
description: Reconcile live Pharo, Iceberg, Tonel, and Git state before exporting, reviewing, committing, or pushing image-side changes. Use for dirty or detached Iceberg state, linked worktrees, package-membership mismatches, and image-to-Git delivery.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Pharo Image Git Handoff
|
|
7
|
-
|
|
8
|
-
Image objects, Tonel files, Iceberg working copies, and Git refs are distinct.
|
|
9
|
-
A clean Git worktree does not prove the image is clean, and an Iceberg diff does
|
|
10
|
-
not prove files changed on disk.
|
|
11
|
-
|
|
12
|
-
## Workflow
|
|
13
|
-
|
|
14
|
-
1. Inspect the image repository with Pharo MCP tools: identity, location,
|
|
15
|
-
branch/head, source directory, package membership, and modified packages.
|
|
16
|
-
2. Inspect disk with read-only Git commands: `git status --short --branch`,
|
|
17
|
-
`git diff`, and `git remote -v`.
|
|
18
|
-
3. Export only for an intended Tonel/Git handoff. Verify repository identity and
|
|
19
|
-
inspect the image-side change list first.
|
|
20
|
-
4. After export, recheck Iceberg and Git. Review every changed Tonel, project,
|
|
21
|
-
and documentation path.
|
|
22
|
-
5. Commit only the intended diff. Push only when explicitly requested or
|
|
23
|
-
clearly approved.
|
|
24
|
-
6. When the checkout moves under the image — switching branch, pulling, or any
|
|
25
|
-
Git command that rewrites the source files — reload the image from those
|
|
26
|
-
files afterwards, or it keeps running the code the old checkout held.
|
|
27
|
-
|
|
28
|
-
## Stop Before Mutation
|
|
29
|
-
|
|
30
|
-
Stop and diagnose detached or missing heads, wrong branches/remotes, duplicate
|
|
31
|
-
repository names, source-directory or package-membership mismatches, linked
|
|
32
|
-
worktree confusion, and unexplained disagreement between Git and Iceberg.
|
|
33
|
-
|
|
34
|
-
Adopt the current Git HEAD only when the image contents are known to match it.
|
|
35
|
-
Ask the user before resolving real divergence or discarding image changes.
|
|
36
|
-
|
|
37
|
-
## Report
|
|
38
|
-
|
|
39
|
-
Report image repository state before and after export, why export was needed,
|
|
40
|
-
Git branch/status and diff summary, checks run, and unresolved ambiguity.
|