@evref-bl/pharo-mcp 1.5.0 → 2.0.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.
@@ -5,19 +5,31 @@ advertised directly; less common tools can be found through the catalog tools.
5
5
  Tool names use `snake_case` names that generally put the domain before the
6
6
  action.
7
7
 
8
- By default, every tool returns MCP call `content` as the canonical response for
9
- LLMs. The text block contains the complete tool payload encoded as JSON using
10
- this common shape:
8
+ Every tool returns MCP call `content` as the canonical response for LLMs, in
9
+ plain text: the summary first, then any warnings, then the payload as lines.
10
+ The fields that identify one record share a line as `key=value` pairs, and a
11
+ value carrying spaces is quoted, as in `protocol="private - results"`. A record
12
+ that names a method opens with the method, written the way Pharo writes it:
13
+ `MCPTool>>batchSummaryNoun`, or `MCPTool class>>toolName` on the class side. A
14
+ list of plain values is bracketed, as in `required: [name, slotName]`, and a
15
+ list of records is named before its entries. Text with its own lines, such as
16
+ method source, follows under its own label. `tool_get` answers a tool's
17
+ contract as YAML.
18
+
19
+ A result does not repeat itself: what the summary states in prose, and what a
20
+ record already says another way, is left out of the lines.
21
+
22
+ The same payload is also carried as `structuredContent`:
11
23
 
12
24
  ```text
13
- status: ok | error
14
25
  summary: human-readable summary
15
26
  warnings: array of warning strings
16
27
  data: structured success payload
17
28
  error: structured error payload
18
29
  ```
19
30
 
20
- `data` is present on success. `error` is present on failure.
31
+ `data` is present on success. `error` is present on failure, where the call is
32
+ also flagged with the protocol's own `isError`.
21
33
 
22
34
  For clients or integrations that need programmatic payloads, configure the
23
35
  server response fields before `start`:
@@ -30,231 +42,90 @@ mcp useContentAndStructuredContentToolResponses.
30
42
 
31
43
  ## Compact Paging
32
44
 
33
- List and search tools are optimized for low token usage. Broad tools return a
34
- small page by default and put only the entry array in `data`. When another page
35
- exists, `data` includes `nextOffset`; call the same tool again with that
36
- `offset` to continue.
45
+ List and search tools are optimized for low token usage. A page is the tool's
46
+ own size, chosen for what one of its entries costs to read: fifty classes,
47
+ twenty-five methods or packages, twenty critique hits, ten repositories. When
48
+ another page exists, `data` includes `nextOffset`; call the same tool again
49
+ with that `offset` to continue.
37
50
 
38
- Use the returned array size for the current page and follow `nextOffset` when
39
- present. Request larger pages only when the next step truly needs more entries.
51
+ A search answers what identifies each hit, not everything known about it.
52
+ `repository_search` says how many packages a repository holds rather than
53
+ naming them, which `package_search` answers; `critique_run` names the rule
54
+ rather than restating its documentation on every hit.
40
55
 
41
- ## Tool Catalog
56
+ ## Naming Several Targets
42
57
 
43
- | Tool | Use |
44
- | --- | --- |
45
- | `tool_search` | Search the tool catalog by group, keyword, title, or description. |
46
- | `tool_get` | Return input schema and metadata for one catalog tool. |
47
- | `tool_call` | Invoke a catalog tool that is not exposed directly by the current client. |
48
-
49
- Use `tool_search` before calling less common or high-risk tools. Inspect the
50
- schema before invoking a discoverable tool.
58
+ Four tools act on several targets in one call. The argument that names the
59
+ target holds either one value or a list of them, and every other argument
60
+ applies to all of them:
51
61
 
52
- ## Repositories
62
+ | Tool | Argument | One call covers |
63
+ | --- | --- | --- |
64
+ | `method_get` | `selector` | Methods of one class, on one side. |
65
+ | `method_compile` | `source` | Sources compiled into one class, under one protocol. |
66
+ | `class_get` | `name` | Classes read with the same options. |
67
+ | `class_create` | `name` | Classes sharing a superclass, package and slots. |
53
68
 
54
- | Tool | Use |
55
- | --- | --- |
56
- | `repository_search` | List Iceberg repositories registered in the image, including location, branch/head metadata, exact head commit id, modified packages, remotes, and upstream details. |
57
- | `repository_identity_verify` | Assert expected Iceberg repository identity fields before edits, exports, commits, pulls, or pushes. |
58
- | `repository_change_list` | Inspect Iceberg `workingCopyDiff` without writing files. |
59
- | `repository_create` | Create a new Iceberg repository directory and optionally attach initial packages. |
60
- | `repository_attach` | Register an existing Git checkout, including a linked Git worktree checkout, and optionally attach packages. |
61
- | `repository_update` | Change image-side repository subdirectory or package membership without exporting packages. |
62
- | `repository_export` | Export image-side package changes to Tonel files and update the Iceberg index without staging or committing Git changes. |
63
- | `repository_commit` | Commit Iceberg repository changes with a message. |
64
- | `repository_fetch` | Fetch repository remotes through Iceberg. |
65
- | `repository_pull` | Pull through Iceberg. |
66
- | `repository_push` | Push through Iceberg. |
67
- | `repository_branch_create` | Create and switch to a new repository branch through Iceberg. |
68
- | `repository_branch_switch` | Switch the Iceberg repository head to an existing branch without loading package changes into the image. |
69
- | `repository_branch_checkout` | Check out an existing repository branch and load changes for packages already loaded in the image. |
70
- | `repository_head_adopt` | Adopt the current repository head as the Iceberg working-copy reference after verifying the image and Git state. |
71
- | `baseline_load` | Load an already-known Metacello baseline available in the image. |
72
- | `repository_load` | Load a Metacello baseline from a remote repository. |
73
-
74
- Use `repository_identity_verify` before edits or exports, and
75
- `repository_change_list` before exporting or committing image changes.
76
- Identity verification requires at least one expected identity field, such as
77
- `location`, `branchName`, `subdirectory`, `packageNames`,
78
- `modifiedPackageNames`, or `isModified`.
79
-
80
- Use plural fields such as `repositoryNames`, `directoryPaths`, and
81
- `packageNames` for exact repository scope. Use singular text filters such as
82
- `repositoryName`, `branchName`, `headCommitId`, `remoteUrl`, and
83
- `upstreamBranchName` for field-specific matching.
84
-
85
- ## Packages
86
-
87
- | Tool | Use |
88
- | --- | --- |
89
- | `package_search` | List packages by project/package scope, with optional `packageName`, `projectName`, and `tag` filters. |
69
+ Every target is attempted. The summary states how many succeeded, each target
70
+ then reads as it would have read on its own, and `data` carries one entry per
71
+ target under `results`, in request order. An entry that failed carries its
72
+ `error`. The call is flagged `isError` only when every target failed.
90
73
 
91
- ## Classes
74
+ A call naming one target answers exactly what it answers when the argument
75
+ holds a single value.
92
76
 
93
- | Tool | Use |
94
- | --- | --- |
95
- | `class_search` | List classes by package/class/hierarchy scope, with optional `className`, `tag`, `instanceSlot`, and `classSlot` filters. |
96
- | `class_get` | Get one class by name and return structured class metadata with optional superclass and subclass context. |
97
- | `class_create` | Create one class definition. |
98
- | `class_name_update` | Rename one class through the Refactoring Engine. |
99
- | `class_superclass_update` | Change one class superclass. |
100
- | `class_package_update` | Move one class to a package and/or recategorize it under a package tag. |
101
- | `class_comment_update` | Set or clear one class comment. |
102
- | `class_slots_update` | Replace instance-side and/or class-side slot definitions. |
103
- | `class_traits_update` | Replace instance-side trait composition. |
104
- | `class_side_traits_update` | Replace class-side trait composition. |
105
- | `class_shared_variables_update` | Replace class variables. |
106
- | `class_shared_pools_update` | Replace shared pools. |
107
- | `class_layout_update` | Replace the layout class. |
108
- | `class_slot_add` | Add one instance-side or class-side slot. |
109
- | `class_slot_remove` | Remove one instance-side or class-side slot. |
110
- | `class_slot_name_update` | Rename one instance-side or class-side slot. |
111
- | `class_slot_pull_up` | Pull one instance-side or class-side slot up to a superclass. |
112
- | `class_slot_push_down` | Push one instance-side or class-side slot down to subclasses. |
113
- | `class_remove` | Remove classes as one batch. Refactoring warnings stop removal unless `force=true`. |
114
-
115
- Class mutation tools and `class_remove` use Pharo refactoring support
116
- where available. With `force=false`, refactoring warnings return impact details
117
- instead of continuing.
118
-
119
- ## Methods
120
-
121
- | Tool | Use |
122
- | --- | --- |
123
- | `method_metadata_search` | List/search methods by class/package/hierarchy scope, with optional `selector` and `protocol` filters. |
124
- | `method_source_search` | Search methods by source text. |
125
- | `method_equivalent_search` | Search methods whose AST is equivalent to a referenced method. |
126
- | `method_implementor_search` | Search methods that implement a selector. |
127
- | `method_sender_search` | Search methods that send a selector. |
128
- | `method_class_reference_search` | Search methods that reference a class binding. |
129
- | `method_variable_reference_search` | Search methods that reference a variable. |
130
- | `method_get` | Get one known method and return source plus structured variable-reference context. |
131
- | `method_compile` | Create or replace one method from source. |
132
- | `method_selector_update` | Rename selectors, add/remove arguments, or reorder arguments through the Refactoring Engine. |
133
- | `method_protocol_update` | Move one method to another regular or extension protocol. |
134
- | `method_rewrite` | Preview or apply AST rewrite rules across a method scope. Applying requires `expectedChangeSetHash` from a preview. |
135
- | `critique_run` | Run selected or all Renraku critiques over a scope and return hits grouped by rule class. |
136
- | `method_remove` | Remove methods from one class as a batch without sender safety checks. |
137
-
138
- Prefer the specialized lookup tools for navigation tasks. Use
139
- `method_source_search` for source text and `method_equivalent_search` for
140
- equivalent-AST matches. Keep `method_metadata_search` for method metadata
141
- search. Top-level `method_metadata_search` filtering is limited to `selector`
142
- and `protocol` fields (`substring`, `prefix`, `exact`, or `regex`); use
143
- specialized tools for source, equivalent methods, implementors, senders, class
144
- references, and variable references.
145
-
146
- `method_compile` returns selected Renraku critiques after method compilation when
147
- they are relevant to review.
148
-
149
- ## History
150
-
151
- | Tool | Use |
152
- | --- | --- |
153
- | `history_file_list` | List Epicea `.ombu` change-history files, including the current history file. |
154
- | `history_entry_list` | List entries from the current image change history or a selected `.ombu` file. |
155
- | `history_entry_apply` | Preview applying selected entries, and apply them with `confirm=true`. |
156
- | `history_entry_revert` | Preview reverting selected entries, and revert them with `confirm=true`. |
77
+ ## The Advertised Surface
157
78
 
158
- Prefer the read-only tools when browsing history. Use
159
- `history_entry_apply` or `history_entry_revert` when you need apply/revert
160
- preview or confirmation.
79
+ Fifteen tools are advertised directly: `tool_search`, `tool_get`, `tool_call`, `class_search`, `class_get`, `class_create`, `class_remove`, `method_search`, `method_source_search`, `method_reference_search`, `method_get`, `method_compile`, `method_remove`, `test_run` and `image_evaluate`. Every other tool is found with `tool_search` and called through `tool_call`.
161
80
 
162
- ## Tests
81
+ A server chooses its own surface before `start`:
163
82
 
164
- | Tool | Use |
165
- | --- | --- |
166
- | `test_run` | Run SUnit test classes or individual methods. |
167
- | `test_coverage_run` | Run SUnit test classes or individual methods while collecting method and node coverage for an explicit method scope. |
83
+ ```smalltalk
84
+ mcp advertiseTools: #( 'tool_search' 'tool_get' 'tool_call' 'method_get' ).
85
+ ```
168
86
 
169
- ## UI
87
+ ## Finding A Tool
170
88
 
171
- | Tool | Use |
172
- | --- | --- |
173
- | `screenshot_capture` | Capture the active Morphic world and return MCP image content with dimensions and MIME type metadata. |
89
+ The server answers for its own catalogue. `tool_search` ranks it by keyword,
90
+ best match first, and answers the closest tools even when none matches every
91
+ word; add words to narrow the ranking. With no query it answers the catalogue's
92
+ size and its groups. `tool_get` returns one tool's metadata and input schema,
93
+ and `tool_call` invokes a tool the current client does not advertise directly.
174
94
 
175
- ## Debugging
95
+ Search before calling anything less common or high-risk, and read the schema
96
+ before invoking it.
176
97
 
177
- The debugger tools are discoverable under the `debugging` group. Read
178
- [Debugging with MCP](debugging.md) before using them.
98
+ Tools are named `domain_action`, and the domains are:
179
99
 
180
- | Tool | Use |
100
+ | Group | Covers |
181
101
  | --- | --- |
182
- | `debug_capture` | Evaluate a Smalltalk expression in a bounded worker process and capture runtime exceptions as tracked debug sessions. |
183
- | `debug_test_run` | Run one SUnit test method under debugger control and capture failures or errors as tracked debug sessions. |
184
- | `debug_session_list` | List tracked debug sessions. |
185
- | `debug_session_get` | Inspect one tracked debug session summary. |
186
- | `debug_session_remove` | Remove a tracked debug session from the registry. |
187
- | `debug_candidate_search` | Search unattached open debugger candidates. |
188
- | `debug_candidate_attach` | Attach an open debugger candidate and return its debug state. |
189
- | `debug_state_get` | Return a debug-session snapshot with stack, selected frame, source, scopes, repair actions, and state-scoped references. |
190
- | `debug_variable_get` | Expand scope and variable references returned by `debug_state_get`. |
191
- | `debug_expression_evaluate` | Evaluate a Smalltalk expression in a selected debug frame. |
192
- | `debug_session_step_into` | Step into the selected frame of a tracked debug session. |
193
- | `debug_session_step_over` | Step over the selected frame of a tracked debug session. |
194
- | `debug_session_step_through` | Step through the selected frame of a tracked debug session. |
195
- | `debug_session_restart` | Restart the selected frame of a tracked debug session. |
196
- | `debug_session_resume` | Resume a tracked debug session. |
197
- | `debug_session_terminate` | Terminate a tracked debug session. |
198
- | `debug_breakpoint_list` | List tracked transient DebugPoint breakpoints. |
199
- | `debug_breakpoint_set` | Install a transient method-entry or source-interval DebugPoint breakpoint. |
200
- | `debug_breakpoint_remove` | Remove one tracked transient DebugPoint breakpoint. |
201
- | `debug_breakpoint_enable` | Enable one tracked transient DebugPoint breakpoint. |
202
- | `debug_breakpoint_disable` | Disable one tracked transient DebugPoint breakpoint. |
203
- | `debug_breakpoint_clear` | Remove all tracked transient DebugPoint breakpoints. |
204
- | `debug_method_update` | Update the method associated with a paused debug state, then proceed when possible. |
102
+ | `classes` | Defining classes and changing their slots, traits, shared variables, pools, layout, package and comment, including the slot refactorings. |
103
+ | `methods` | Compiling, reading, removing and rewriting methods, renaming selectors and protocols, and searching by source, metadata, senders, implementors, references or equivalence. |
104
+ | `repositories` | What the image knows about its Iceberg repositories: identity, package membership, working-copy changes, export, commit, and reloading the image from the files. Branches, remotes and transfers are git's, and belong in a shell. |
105
+ | `debugging` | Reading the debuggers a person opened, with their exceptions and nearest frames, and watching what variables hold while an expression runs. Neither attaches to a debugger or leaves a session behind. |
106
+ | `history` | Epicea change history: locating files, listing entries, and applying or reverting them. |
107
+ | `tests` | Running tests and running them under coverage. |
108
+ | `packages` | Searching packages. |
109
+ | `runtime` | `image_evaluate`, the escape hatch. |
110
+ | `ui` | Reading what is on screen, as a tree of windows and the presenters or morphs inside them, or as a screenshot. Either one can take a single window instead of the whole world, for a fraction of the cost. |
111
+ | `tool-catalog` | `tool_search`, `tool_get` and `tool_call`. |
205
112
 
206
113
  ## Scripting
207
114
 
208
- | Tool | Use |
209
- | --- | --- |
210
- | `image_evaluate` | Evaluate arbitrary Smalltalk and return a bounded preview of the result. |
211
-
212
- Use `image_evaluate` only when no dedicated tool fits. A successful evaluation can
213
- mutate and save the image.
115
+ Use `image_evaluate` only when no dedicated tool fits. A successful evaluation
116
+ can mutate the running image.
214
117
 
215
118
  ## Mutation And Saving
216
119
 
217
- Most search and inspection tools are read-only and do not save the image.
218
- Mutating tools save the image after a successful call.
219
-
220
- Tools that can save after success include:
120
+ No tool saves the image. Mutating tools change the running image only, so
121
+ closing it discards every change since its last save, and a mistake costs the
122
+ session rather than the image file. Saving is the caller's responsibility:
123
+ evaluate `Smalltalk saveSession` when a change should survive, or leave it to
124
+ whoever owns the image lifecycle.
221
125
 
222
- ```text
223
- class_create
224
- class_name_update
225
- class_package_update
226
- class_comment_update
227
- class_slot_add
228
- class_slot_remove
229
- class_slot_name_update
230
- method_compile
231
- method_selector_update
232
- method_protocol_update
233
- repository_create
234
- repository_attach
235
- repository_update
236
- repository_export
237
- repository_commit
238
- repository_fetch
239
- repository_pull
240
- repository_push
241
- repository_branch_create
242
- repository_branch_switch
243
- repository_branch_checkout
244
- repository_head_adopt
245
- baseline_load
246
- repository_load
247
- class_remove
248
- method_remove
249
- method_rewrite when apply=true and changes were applied
250
- history_entry_apply when entries were performed
251
- history_entry_revert when entries were performed
252
- debug_expression_evaluate
253
- debug_capture
254
- debug_test_run
255
- debug_method_update when a method is accepted
256
- image_evaluate
257
- ```
126
+ Use `history_entry_list` to see what changed and `history_entry_revert` to undo
127
+ a change in the running image; both preview first and perform with
128
+ `confirm=true`.
258
129
 
259
130
  `repository_identity_verify` and `repository_change_list` are read-only.
260
131
 
@@ -11,7 +11,17 @@ change history.
11
11
 
12
12
  ## The Client Cannot Connect
13
13
 
14
- Check the server in the image:
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:
15
25
 
16
26
  ```smalltalk
17
27
  mcp isRunning.
@@ -55,7 +65,6 @@ Common causes:
55
65
  - missing required fields for the selected tool
56
66
  - extra fields rejected by `additionalProperties: false`
57
67
  - passing arguments from a different tool
58
- - `method_rewrite` with `apply=true` but no `expectedChangeSetHash`
59
68
  - `history_entry_apply` or `history_entry_revert` without `confirm=true`
60
69
 
61
70
  ## A Refactoring Stops With A Warning
@@ -109,23 +118,22 @@ Coverage scopes should be narrow: package, class, hierarchy, or method names.
109
118
 
110
119
  ## The Image Changed Unexpectedly
111
120
 
112
- Image-changing tools save the image after successful mutation. If you are using
113
- an automation or agent, run it against a copied or disposable image.
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.
114
123
 
115
124
  Use `history_file_list` and `history_entry_list` to inspect
116
125
  Epicea history. Apply or revert operations stay in `history_entry_apply` and
117
126
  `history_entry_revert`, where they can be previewed first and performed with
118
127
  `confirm=true`.
119
128
 
120
- ## Debugger References Are Stale
129
+ ## A Debugger Picture Goes Out Of Date
121
130
 
122
- Debugger `stateId`, `frameRef`, and `variableRef` values are scoped to one
123
- debug_state_get snapshot. After a control action, debugger edit, or resume, discard
124
- old references and use the newly returned state.
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.
125
134
 
126
- If a human opened the debugger, attach through the debugging tools and let the
127
- debugger controller own UI actions. Do not drive debugger windows with raw
128
- `image_evaluate` code.
135
+ Do not drive debugger windows with raw `image_evaluate` code, and do not step,
136
+ resume or terminate a debugger a person opened.
129
137
 
130
138
  ## Source Checks Are Not Enough
131
139
 
@@ -28,7 +28,7 @@ See [Tool reference](tool-reference.md) for tool groups and common workflows.
28
28
 
29
29
  ## Choose Specialized Lookups
30
30
 
31
- Use `method_metadata_search` for metadata, `method_source_search` for source,
31
+ Use `method_search` for metadata, `method_source_search` for source,
32
32
  `method_equivalent_search` for equivalent ASTs, and the implementor, sender,
33
33
  class-reference, or variable-reference search matching the question.
34
34
 
@@ -37,19 +37,39 @@ mutation, and inspect `repository_change_list` before export or commit. Read
37
37
  [Safety and ecosystem integration](safety-and-ecosystem.md) for mutation
38
38
  boundaries.
39
39
 
40
+ `method_get` and `class_get` read several targets in one call when their
41
+ `selector` or `name` holds a list, and `method_compile` and `class_create`
42
+ write several the same way. See [Tool reference](tool-reference.md).
43
+
40
44
  For history recovery, inspect files and entries before applying or reverting.
41
- For debugger sessions, breakpoints, or repairs, read the installed local
45
+ For watching values, debugger sessions, or repairs, read the installed local
42
46
  debugging guide.
43
47
 
44
48
  ## Image Mutation
45
49
 
46
- Successful mutating tools save the image. Use a copied or disposable image for
47
- broad or risky edits, preview changes when the tool supports it, and run focused
48
- tests after source changes.
50
+ Mutating tools change the running image and never save it, so closing the image
51
+ discards everything since its last save. Saving is the caller's responsibility:
52
+ evaluate `Smalltalk saveSession` when a change should survive, or leave it to
53
+ whoever owns the image lifecycle. Use a copied or disposable image for broad or
54
+ risky edits, preview changes when the tool supports it, and run focused tests
55
+ after source changes.
49
56
 
50
57
  Report incomplete or failing tool results clearly. Never silently fall back to
51
58
  exported source for a question about the live image.
52
59
 
60
+ ## Failures And Notifications
61
+
62
+ A notification is not a failure. Pharo signals them for remarks rather than
63
+ faults, and every `Warning` is one, so a deprecated send or an undeclared
64
+ variable during a load is resumed and the call proceeds. A refactoring warning
65
+ is the exception: it reports a change that breaks something, so it stops the
66
+ call until you rerun with `force=true`.
67
+
68
+ A failed call reports the error class, the message and the frames of the failing
69
+ code; the server's own frames are left out. For `image_evaluate` a compilation
70
+ failure also names the line and shows it, and a `MessageNotUnderstood` suggests
71
+ selectors the receiver does understand.
72
+
53
73
  ## Reusable Workflows
54
74
 
55
75
  Run `npx @evref-bl/pharo-mcp install --host <host>` in the target project to
@@ -86,10 +106,6 @@ MyProjectMCPTool >> buildInputSchema
86
106
  additionalProperties: false;
87
107
  yourself
88
108
 
89
- MyProjectMCPTool >> buildOutputSchema
90
-
91
- ^ self standardOutputSchemaForDataProperties: #( ) required: #( )
92
-
93
109
  MyProjectMCPTool >> executeWithRequest: request
94
110
 
95
111
  ^ self
@@ -116,40 +132,39 @@ normal use, configure it through the `MCP` instance messages below. The
116
132
  instance; discoverable tools remain available through `tool_search`, `tool_get`,
117
133
  and `tool_call`.
118
134
 
119
- For a server with only your own tools, use a profile:
135
+ Two words govern the surface. A **registered** tool is in the catalog and
136
+ reachable through `tool_search`, `tool_get` and `tool_call`. An **advertised**
137
+ tool is also in `tools/list`.
138
+
139
+ For a server with only your own tools:
120
140
 
121
141
  ```smalltalk
122
- mcp := MCP profile: (MCPProfile tools: { MyProjectMCPTool }).
142
+ mcp := MCP onlyTools: { MyProjectMCPTool }.
123
143
  mcp start.
124
144
  ```
125
145
 
126
- `MCPProfile tools:` registers the given tools and advertises them directly in
127
- `tools/list`. Use `tools:static:` when some registered tools should stay
128
- discoverable through the catalog tools:
146
+ `onlyTools:` replaces the catalog with exactly those tools and advertises all of
147
+ them. Advertise a subset when some registered tools should stay discoverable
148
+ through the catalog tools instead:
129
149
 
130
150
  ```smalltalk
131
- mcp := MCP profile: (MCPProfile
132
- tools: { MyProjectMCPTool. MyOtherMCPTool }
133
- static: { MyProjectMCPTool }).
151
+ mcp := MCP onlyTools: { MyProjectMCPTool. MyOtherMCPTool }.
152
+ mcp advertiseTools: { MyProjectMCPTool }.
134
153
  ```
135
154
 
136
- For incremental per-server configuration, register tools explicitly before
137
- starting the server:
155
+ To add to the tools a server already has, rather than replacing them:
138
156
 
139
157
  ```smalltalk
140
158
  mcp := MCP new.
141
- mcp registerToolClass: MyProjectMCPTool.
159
+ mcp addTool: MyProjectMCPTool.
142
160
  mcp start.
143
161
  ```
144
162
 
145
- You can also register several classes, register an already-created tool, or
146
- remove a tool from one server instance:
147
-
148
- ```smalltalk
149
- mcp registerToolClasses: { MyProjectMCPTool. MyOtherMCPTool }.
150
- mcp registerTool: MyProjectMCPTool new.
151
- mcp unregisterToolNamed: 'my_project_tool'.
152
- ```
163
+ `addTool:` takes a class or a ready instance, and `addTools:` takes several.
164
+ `removeTool:` takes one back out by name. `advertiseTools:` accepts classes,
165
+ instances or names, and registers anything not in the catalog yet, so it can be
166
+ called before or after adding. `advertiseAllTools` advertises everything, and
167
+ `advertiseToolDefaults` returns to each tool's own default exposure.
153
168
 
154
169
  Use `defaultExposure` to decide whether a registered tool is directly
155
170
  advertised in `tools/list` (`'static'`) or kept discoverable through the catalog