Skip to content

Commit 80e7220

Browse files
author
Nigel Brown
authored
docs: consolidate and improve documentation structure (#19)
- Fix TLS flag inconsistency (--no-tls-enabled -> --tls-enabled=false) - Add PyPI trusted publishing guide to docs index - Add CLI alternatives throughout quickstart guide - Improve cross-references between documentation files - Enhance documentation structure and organization - Update OpenAPI spec with correct TLS flag Addresses #4
1 parent 99c763d commit 80e7220

7 files changed

Lines changed: 187 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ uv run python -m mcp_tef
4343
**Security:**
4444
- **Default**: HTTPS with auto-generated self-signed certificate
4545
- **Custom certs**: `--tls-cert-file` and `--tls-key-file` flags
46-
- **Development**: `--no-tls-enabled` for HTTP (⚠️ not for production)
46+
- **Development**: `--tls-enabled=false` for HTTP (⚠️ not for production)
4747

4848
See [docs/testing-with-ollama.md](docs/testing-with-ollama.md) and [docs/tls-configuration.md](docs/tls-configuration.md) for details.
4949

docs/README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ This directory contains detailed documentation for the mcp-tef project.
3333
- Production deployment guidelines
3434
- Troubleshooting TLS issues
3535

36+
### Publishing and Deployment
37+
38+
**[PyPI Trusted Publishing Setup](pypi-trusted-publishing-setup.md)** - PyPI publishing configuration
39+
- Configure trusted publishing for `mtef` CLI package
40+
- GitHub Actions OIDC setup
41+
- PyPI project configuration
42+
- Troubleshooting publishing issues
43+
44+
> **Note**: Currently, CLI releases are published to GitHub Releases. This guide is for future PyPI publishing setup.
45+
3646
### Project Information
3747

3848
**[Current Specification](current-specification.md)** - Comprehensive system specification and requirements
@@ -61,10 +71,18 @@ This directory contains detailed documentation for the mcp-tef project.
6171
- **Main README**: [`../README.md`](../README.md) - Project overview and quick start
6272
- **Development Guide**: [`../CLAUDE.md`](../CLAUDE.md) - Development workflow and principles
6373

64-
## Getting Started
74+
## Documentation Guide
75+
76+
**For new users:**
77+
1. Start with the [**Quickstart Guide**](quickstart.md) for step-by-step tutorials
78+
2. See the main [`README.md`](../README.md) for project overview and features
79+
80+
**For developers:**
81+
1. Read [`CLAUDE.md`](../CLAUDE.md) for development workflow and principles
82+
2. See [`testing-with-ollama.md`](testing-with-ollama.md) for testing strategies
83+
3. Check [`tls-configuration.md`](tls-configuration.md) for HTTPS/TLS setup
6584

66-
1. Start with the main [`README.md`](../README.md) for project overview and quick start
67-
2. Read [`testing-with-ollama.md`](testing-with-ollama.md) for testing strategies
68-
3. Check [`tls-configuration.md`](tls-configuration.md) for HTTPS setup
69-
4. See [`CLAUDE.md`](../CLAUDE.md) for development workflow
85+
**For deployment:**
86+
1. Review [`tls-configuration.md`](tls-configuration.md) for production TLS setup
87+
2. See [`pypi-trusted-publishing-setup.md`](pypi-trusted-publishing-setup.md) for PyPI publishing (future)
7088

docs/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ servers:
2323
- url: https://localhost:8000
2424
description: Local development server (HTTPS with auto-generated cert)
2525
- url: http://localhost:8000
26-
description: Local development server (HTTP, use --no-tls-enabled)
26+
description: Local development server (HTTP, use --tls-enabled=false)
2727

2828
tags:
2929
- name: mcp-servers

docs/pypi-trusted-publishing-setup.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This document describes how to configure PyPI trusted publishing for the `mtef` package.
44

5+
> **Note**: Currently, the CLI is published to GitHub Releases only. This guide is for future PyPI publishing setup. The workflow file referenced (`release-cli.yml`) currently creates GitHub releases but does not publish to PyPI yet.
6+
57
## Overview
68

79
Trusted publishing allows GitHub Actions to publish to PyPI without storing API tokens. It uses OpenID Connect (OIDC) to establish trust between GitHub and PyPI.
@@ -53,7 +55,7 @@ If the `mtef` project doesn't exist on PyPI yet:
5355

5456
## How It Works
5557

56-
The release workflow (`.github/workflows/release-cli.yml`) uses:
58+
When PyPI publishing is enabled, the release workflow (`.github/workflows/release-cli.yml`) would use:
5759

5860
```yaml
5961
permissions:
@@ -110,6 +112,11 @@ When the workflow runs:
110112
- A pending publisher configured on your PyPI account
111113
- Manual project creation on PyPI first
112114

115+
## Related Documentation
116+
117+
- [Main README](../README.md) - Project overview and release process
118+
- [CLI Documentation](../cli/README.md) - CLI usage and installation
119+
113120
## References
114121

115122
- [PyPI Trusted Publishing Documentation](https://docs.pypi.org/trusted-publishers/)

docs/quickstart.md

Lines changed: 145 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,29 @@ cp .env.example .env
5050

5151
### Start the Server
5252

53+
**Option 1: Run directly (Python)**
54+
5355
```bash
5456
# Default: HTTPS with auto-generated self-signed certificate
5557
uv run python -m mcp_tef
5658

5759
# OR: HTTP mode for development (insecure)
58-
uv run python -m mcp_tef --no-tls-enabled
60+
uv run python -m mcp_tef --tls-enabled=false
61+
```
62+
63+
The server starts at `https://localhost:8000` (or `http://localhost:8000` with `--tls-enabled=false`).
64+
65+
**Option 2: Deploy with CLI (Docker)**
66+
67+
```bash
68+
# Install the CLI
69+
uv tool install "mtef @ git+https://github.com/StacklokLabs/mcp-tef.git#subdirectory=cli"
70+
71+
# Deploy the server
72+
mtef deploy --health-check
5973
```
6074

61-
The server starts at `https://localhost:8000` (or `http://localhost:8000` with `--no-tls-enabled`).
75+
> **💡 Tip**: The CLI deploys mcp-tef as a Docker container from GitHub Container Registry. See [CLI documentation](../cli/README.md) for details.
6276
6377
### Access API Documentation
6478

@@ -72,7 +86,7 @@ Open your browser (accept the self-signed certificate warning if using HTTPS):
7286
# HTTPS (default)
7387
curl -k https://localhost:8000/health
7488

75-
# HTTP (with --no-tls-enabled)
89+
# HTTP (with --tls-enabled=false)
7690
curl http://localhost:8000/health
7791
```
7892

@@ -123,6 +137,8 @@ Stateless analysis that:
123137

124138
Use your actual MCP server URLs - no need to register servers first!
125139

140+
**Option A: Using the REST API (curl)**
141+
126142
```bash
127143
curl -k -X POST https://localhost:8000/test-cases \
128144
-H "Content-Type: application/json" \
@@ -141,6 +157,23 @@ curl -k -X POST https://localhost:8000/test-cases \
141157
}'
142158
```
143159

160+
**Option B: Using the CLI**
161+
162+
```bash
163+
mtef test-case create \
164+
--name "Weather query test" \
165+
--query "What is the weather in San Francisco?" \
166+
--expected-server "https://my-mcp-server.com/sse" \
167+
--expected-tool "get_weather" \
168+
--expected-params '{"location": "San Francisco"}' \
169+
--servers "https://my-mcp-server.com/sse,https://another-server.com/sse"
170+
```
171+
172+
> **Note**: The `--servers` flag accepts comma-separated URLs. See [CLI documentation](../cli/README.md) for more examples.
173+
```
174+
175+
> **💡 Tip**: The CLI provides a simpler interface for common operations. See [CLI documentation](../cli/README.md) for full details.
176+
144177
**Response**:
145178
```json
146179
{
@@ -168,6 +201,8 @@ curl -k -X POST https://localhost:8000/test-cases \
168201

169202
Execute the test with runtime API key and model configuration:
170203

204+
**Option A: Using the REST API (curl)**
205+
171206
```bash
172207
# Using OpenRouter (or OpenAI, Anthropic)
173208
curl -k -X POST https://localhost:8000/test-cases/550e8400-e29b-41d4-a716-446655440000/run \
@@ -197,6 +232,21 @@ curl -k -X POST https://localhost:8000/test-cases/550e8400-e29b-41d4-a716-446655
197232
}'
198233
```
199234

235+
**Option B: Using the CLI**
236+
237+
```bash
238+
# Using OpenRouter
239+
mtef test-run execute 550e8400-e29b-41d4-a716-446655440000 \
240+
--model-provider openrouter \
241+
--model-name anthropic/claude-3.5-sonnet \
242+
--api-key sk-or-v1-...
243+
244+
# Using Ollama (no API key needed)
245+
mtef test-run execute 550e8400-e29b-41d4-a716-446655440000 \
246+
--model-provider ollama \
247+
--model-name llama3.2:3b
248+
```
249+
200250
**What Happens**:
201251
1. **Tool Ingestion** (1-5s per server): Fresh tools loaded from all `available_mcp_servers`
202252
2. **LLM Evaluation**: LLM receives query and all tool descriptions, selects one
@@ -231,10 +281,18 @@ curl -k -X POST https://localhost:8000/test-cases/550e8400-e29b-41d4-a716-446655
231281

232282
### Step 3: View Detailed Results
233283

284+
**Option A: Using the REST API (curl)**
285+
234286
```bash
235287
curl -k https://localhost:8000/test-runs/660e8400-e29b-41d4-a716-446655440001/result
236288
```
237289

290+
**Option B: Using the CLI**
291+
292+
```bash
293+
mtef test-run get 660e8400-e29b-41d4-a716-446655440001
294+
```
295+
238296
**Response**:
239297
```json
240298
{
@@ -270,10 +328,14 @@ curl -k https://localhost:8000/test-runs/660e8400-e29b-41d4-a716-446655440001/re
270328

271329
After running multiple tests:
272330

331+
**Using the REST API (curl)**
332+
273333
```bash
274334
curl -k https://localhost:8000/metrics/summary
275335
```
276336

337+
> **Note**: Aggregate metrics are currently only available via the REST API. CLI support may be added in future releases.
338+
277339
**Response**:
278340
```json
279341
{
@@ -312,6 +374,8 @@ curl -k https://localhost:8000/metrics/summary
312374

313375
The easiest way - just provide your MCP server URLs:
314376

377+
**Using the REST API (curl)**
378+
315379
```bash
316380
curl -k -X POST https://localhost:8000/similarity/analyze \
317381
-H "Content-Type: application/json" \
@@ -325,10 +389,21 @@ curl -k -X POST https://localhost:8000/similarity/analyze \
325389
}'
326390
```
327391

392+
**Using the CLI**
393+
394+
```bash
395+
mtef similarity analyze \
396+
--server-urls "https://my-server-1.com/sse,https://my-server-2.com/sse" \
397+
--threshold 0.85 \
398+
--recommendations
399+
```
400+
328401
### Option B: Analyze Tools Directly (No Server Fetch)
329402

330403
If you already have tool definitions:
331404

405+
**Using the REST API (curl)**
406+
332407
```bash
333408
curl -k -X POST https://localhost:8000/similarity/analyze \
334409
-H "Content-Type: application/json" \
@@ -356,6 +431,8 @@ curl -k -X POST https://localhost:8000/similarity/analyze \
356431
}'
357432
```
358433

434+
> **Note**: Direct tool list analysis is currently only available via the REST API. CLI support requires MCP server URLs.
435+
359436
### Understanding Similarity Results
360437

361438
**Response**:
@@ -420,6 +497,8 @@ curl -k -X POST https://localhost:8000/similarity/analyze \
420497

421498
For visualization or analysis of all pairwise similarities:
422499

500+
**Using the REST API (curl)**
501+
423502
```bash
424503
curl -k -X POST https://localhost:8000/similarity/matrix \
425504
-H "Content-Type: application/json" \
@@ -429,6 +508,16 @@ curl -k -X POST https://localhost:8000/similarity/matrix \
429508
}'
430509
```
431510

511+
**Using the CLI**
512+
513+
```bash
514+
mtef similarity matrix \
515+
--server-urls "https://my-server.com/sse" \
516+
--threshold 0.7
517+
```
518+
519+
> **Note**: The `--server-urls` flag accepts comma-separated URLs for multiple servers.
520+
432521
#### Generate Overlap Matrix
433522

434523
Multi-dimensional analysis (semantic + parameters + description):
@@ -455,6 +544,8 @@ curl -k -X POST https://localhost:8000/similarity/overlap-matrix \
455544

456545
### Analyze Tools from MCP Server(s)
457546

547+
**Using the REST API (curl)**
548+
458549
```bash
459550
# Single server
460551
curl -k "https://localhost:8000/mcp-servers/tools/quality?server_urls=https://my-server.com/sse&model_provider=openrouter&model_name=anthropic/claude-3.5-sonnet" \
@@ -468,6 +559,29 @@ curl -k "https://localhost:8000/mcp-servers/tools/quality?server_urls=https://se
468559
curl -k "https://localhost:8000/mcp-servers/tools/quality?server_urls=https://my-server.com/sse&model_provider=ollama&model_name=llama3.2:3b"
469560
```
470561

562+
**Using the CLI**
563+
564+
```bash
565+
# Single server with OpenRouter
566+
mtef tool-quality \
567+
--server-urls "https://my-server.com/sse" \
568+
--model-provider openrouter \
569+
--model-name anthropic/claude-3.5-sonnet \
570+
--api-key sk-or-v1-...
571+
572+
# Multiple servers (comma-separated)
573+
mtef tool-quality \
574+
--server-urls "https://server1.com/sse,https://server2.com/sse" \
575+
--model-provider openrouter \
576+
--api-key sk-or-v1-...
577+
578+
# Using Ollama (no API key)
579+
mtef tool-quality \
580+
--server-urls "https://my-server.com/sse" \
581+
--model-provider ollama \
582+
--model-name llama3.2:3b
583+
```
584+
471585
### Understanding Quality Results
472586

473587
**Response**:
@@ -692,7 +806,7 @@ rm mcp_eval.db mcp_eval.db-shm mcp_eval.db-wal
692806
curl -k https://localhost:8000/health
693807

694808
# Option 2: Disable TLS for development
695-
uv run python -m mcp_tef --no-tls-enabled
809+
uv run python -m mcp_tef --tls-enabled=false
696810
# Then use http://localhost:8000
697811
```
698812

@@ -805,6 +919,7 @@ ollama pull llama3.2:3b
805919
5. **Understand Data Model**: [docs/data-model.md](data-model.md)
806920
6. **Deep Dive: Ollama Testing**: [docs/testing-with-ollama.md](testing-with-ollama.md)
807921
7. **Production TLS Setup**: [docs/tls-configuration.md](tls-configuration.md)
922+
8. **Browse All Documentation**: [docs/README.md](README.md)
808923

809924
---
810925

@@ -817,7 +932,7 @@ ollama pull llama3.2:3b
817932
uv run python -m mcp_tef
818933

819934
# Start server (HTTP)
820-
uv run python -m mcp_tef --no-tls-enabled
935+
uv run python -m mcp_tef --tls-enabled=false
821936

822937
# Run tests
823938
task test
@@ -852,5 +967,30 @@ open https://localhost:8000/docs
852967

853968
---
854969

970+
## Choosing Between API and CLI
971+
972+
Both the REST API and CLI provide access to mcp-tef functionality:
973+
974+
| Use Case | Recommended Method |
975+
|----------|-------------------|
976+
| **Interactive exploration** | REST API (curl) - See examples in workflows above |
977+
| **Scripting and automation** | CLI (`mtef`) - Better for shell scripts and CI/CD |
978+
| **Docker deployment** | CLI (`mtef deploy`) - Simplifies container management |
979+
| **Direct server control** | Python (`uv run python -m mcp_tef`) - Full control over configuration |
980+
981+
**CLI Installation:**
982+
983+
```bash
984+
# Install from GitHub release
985+
uv tool install https://github.com/StacklokLabs/mcp-tef/releases/download/cli-v0.1.0/mcp_tef_cli-0.1.0-py3-none-any.whl
986+
987+
# Or install from Git
988+
uv tool install "mtef @ git+https://github.com/StacklokLabs/mcp-tef.git#subdirectory=cli"
989+
```
990+
991+
See the [CLI documentation](../cli/README.md) for complete CLI usage and examples.
992+
993+
---
994+
855995
**Need help?** Check the [troubleshooting section](#troubleshooting) or review the [full documentation](README.md).
856996

docs/testing-with-ollama.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ pytest --tb=short
470470

471471
## Related Resources
472472

473+
- [Quickstart Guide](quickstart.md) - Complete user workflows and examples
474+
- [TLS Configuration](tls-configuration.md) - HTTPS/TLS setup for production
473475
- [Ollama Documentation](https://github.com/ollama/ollama)
474476
- [Ollama API Reference](https://github.com/ollama/ollama/blob/main/docs/api.md)
475477
- [Available Models](https://ollama.ai/library)

0 commit comments

Comments
 (0)