Skip to content

Commit 2750f11

Browse files
Fix markdown linting issues
1 parent 92ffd53 commit 2750f11

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docker run --rm -p 8080:8080 `
3232
```
3333

3434
> ℹ️ The container image includes pre-generated embeddings and CSLA code examples.
35-
35+
>
3636
> ℹ️ The container exposes port 8080 by default. You can map it to a different port on your host (e.g., `-p 9000:8080`).
3737
3838
To enable semantic search with vector embeddings, provide Azure OpenAI credentials:
@@ -46,7 +46,7 @@ docker run --rm -p 8080:8080 `
4646

4747
> ⚠️ Azure OpenAI credentials are required to generate embeddings for user search queries at runtime.
4848
49-
**Optional: Override embedded data with custom examples**
49+
#### Optional: Override embedded data with custom examples
5050

5151
If you want to use your own code examples or updated embeddings, you can override the embedded data with volume mounts:
5252

@@ -64,10 +64,12 @@ docker run --rm -p 8080:8080 `
6464
The server uses Azure OpenAI for vector embeddings to provide semantic search capabilities. You must configure the following environment variables:
6565

6666
#### Required Environment Variables
67+
6768
- `AZURE_OPENAI_ENDPOINT`: Your Azure OpenAI service endpoint (e.g., `https://your-resource.openai.azure.com/`)
6869
- `AZURE_OPENAI_API_KEY`: Your Azure OpenAI API key
6970

7071
#### Optional Environment Variables
72+
7173
- `AZURE_OPENAI_EMBEDDING_MODEL`: The embedding model deployment name to use (default: `text-embedding-3-large`)
7274
- `AZURE_OPENAI_API_VERSION`: The API version to use (default: `2024-02-01`)
7375

@@ -78,6 +80,7 @@ The server uses Azure OpenAI for vector embeddings to provide semantic search ca
7880
**Quick Setup**: See [azure-openai-setup-guide.md](azure-openai-setup-guide.md) for step-by-step instructions.
7981

8082
To deploy a model:
83+
8184
1. Go to [Azure OpenAI Studio](https://oai.azure.com/)
8285
2. Navigate to "Deployments"
8386
3. Create a new deployment with the model `text-embedding-3-large`
@@ -88,6 +91,7 @@ To deploy a model:
8891
#### Example Configuration
8992

9093
**PowerShell (Windows):**
94+
9195
```powershell
9296
$env:AZURE_OPENAI_ENDPOINT = "https://your-resource.openai.azure.com/"
9397
$env:AZURE_OPENAI_API_KEY = "your-api-key-here"
@@ -96,6 +100,7 @@ $env:AZURE_OPENAI_API_VERSION = "2024-02-01" # Optional, API version
96100
```
97101

98102
**Bash (Linux/macOS):**
103+
99104
```bash
100105
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/"
101106
export AZURE_OPENAI_API_KEY="your-api-key-here"
@@ -114,11 +119,9 @@ The server uses **pre-generated vector embeddings** for semantic search function
114119
1. **Embedding Generation** (before running the server):
115120
- Run the `csla-embeddings-generator` CLI tool to generate embeddings for all code samples
116121
- This creates an `embeddings.json` file containing pre-computed vector embeddings
117-
118122
2. **Server Startup**:
119123
- The server loads the pre-generated embeddings from `embeddings.json` at startup
120124
- No embedding generation occurs during server initialization
121-
122125
3. **Runtime** (user queries):
123126
- Azure OpenAI credentials are still required to generate embeddings for user search queries
124127
- The server compares user query embeddings against the pre-loaded code sample embeddings
@@ -162,23 +165,27 @@ The server needs to know where to find the CSLA code samples. There are three wa
162165
#### Examples
163166

164167
**Using command-line flag:**
168+
165169
```bash
166170
dotnet run --project csla-mcp-server -- run --folder ./csla-examples
167171
```
168172

169173
**Using environment variable (PowerShell):**
174+
170175
```powershell
171176
$env:CSLA_CODE_SAMPLES_PATH = "S:\src\rdl\csla-mcp\csla-examples"
172177
dotnet run --project csla-mcp-server -- run
173178
```
174179

175180
**Using environment variable (Bash):**
181+
176182
```bash
177183
export CSLA_CODE_SAMPLES_PATH="/path/to/csla-examples"
178184
dotnet run --project csla-mcp-server -- run
179185
```
180186

181187
**Using default path:**
188+
182189
```bash
183190
# When running from the repository root, the default ../csla-examples works automatically
184191
dotnet run --project csla-mcp-server -- run
@@ -203,6 +210,7 @@ The server currently exposes two MCP tools implemented in the `CslaCodeTool` cla
203210
- `Fetch` — return the raw content of a named code sample or markdown file.
204211

205212
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+
206214
- The `--folder` or `-f` command-line option
207215
- The `CSLA_CODE_SAMPLES_PATH` environment variable
208216
- 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
212220
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.
213221

214222
Parameters:
223+
215224
- `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").
216225
- `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.
217226

@@ -252,6 +261,7 @@ Example call without version (uses highest available):
252261
```
253262

254263
Notes and behavior:
264+
255265
- The tool ignores short words (<= 3 characters) when building the search terms.
256266
- 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).
257267
- 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:
265275
Description: Returns the text contents of a specific file from the configured code samples folder by file name.
266276

267277
Parameters:
278+
268279
- `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.
269280

270281
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`):
282293
```
283294

284295
Security note:
296+
285297
- 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.
286298

287299
## Integration with AI Assistants

0 commit comments

Comments
 (0)