You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# When running from the repository root, the default ../csla-examples works automatically
184
191
dotnet run --project csla-mcp-server -- run
@@ -203,6 +210,7 @@ The server currently exposes two MCP tools implemented in the `CslaCodeTool` cla
203
210
-`Fetch` — return the raw content of a named code sample or markdown file.
204
211
205
212
Both tools operate over the repository folder that contains the example files. By default, this is `../csla-examples` relative to the server executable, but this can be configured using:
213
+
206
214
- The `--folder` or `-f` command-line option
207
215
- The `CSLA_CODE_SAMPLES_PATH` environment variable
208
216
- When running from the repository root, the default resolves to `csla-examples/`
@@ -212,6 +220,7 @@ Both tools operate over the repository folder that contains the example files. B
212
220
Description: Extracts significant words from the provided input text and searches `.cs` and `.md` files under the examples folder for occurrences of those words. Returns a JSON array of consolidated search results that merge semantic (vector-based) and word-based (keyword) search scores.
213
221
214
222
Parameters:
223
+
215
224
-`message` (string, required): Natural language text or keywords to search for. Words of length 4 or less are ignored by the tool. The tool also searches for 2-word combinations from adjacent words to find phrase matches (e.g., "create operation" and "operation method" from "create operation method").
216
225
-`version` (integer, optional): CSLA version number to filter results (e.g., `9` or `10`). If not provided, defaults to the highest version available by scanning version subdirectories in the examples folder (e.g., `v9/`, `v10/`). Files in the root directory (common to all versions) are included regardless of the specified version.
217
226
@@ -252,6 +261,7 @@ Example call without version (uses highest available):
252
261
```
253
262
254
263
Notes and behavior:
264
+
255
265
- The tool ignores short words (<= 3 characters) when building the search terms.
256
266
- The tool creates 2-word combinations from adjacent words in the search message to find phrase matches. Multi-word phrase matches receive higher scores (weight of 2) compared to single word matches (weight of 1).
257
267
- Word matching uses word boundaries to ensure exact matches. For example, searching for "property" will not match "ReadProperty" or "GetProperty".
@@ -265,6 +275,7 @@ Notes and behavior:
265
275
Description: Returns the text contents of a specific file from the configured code samples folder by file name.
266
276
267
277
Parameters:
278
+
268
279
-`fileName` (string, required): The name or relative path of the file to fetch (for example, `ReadOnlyProperty.md`, `v10/EditableRoot.md`, or `MyBusinessClass.cs`). The tool resolves the file by combining the configured code samples path with the given file name. Path traversal attempts (e.g., `../`) are blocked for security.
269
280
270
281
Output: Raw file contents as a string. If the file is not found or the path is invalid, the tool returns a JSON error object with `Error` and `Message` fields.
@@ -282,6 +293,7 @@ Example call (MCP `tools/call`):
282
293
```
283
294
284
295
Security note:
296
+
285
297
- The implementation validates file paths to prevent path traversal attacks. Only files within the configured code samples directory can be accessed. Relative paths like `../` or absolute paths are rejected.
0 commit comments