Skip to content

Commit 1d43b00

Browse files
authored
Merge pull request #235 from PaulJPhilp/codex/pr-3-remove-tier-references
Remove tier references and enforcement from MCP server
2 parents c569238 + aae59b7 commit 1d43b00

44 files changed

Lines changed: 89 additions & 1567 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/mcp-server/ENV_VARS.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Complete reference for all environment variables used across different test conf
1616
| `EFFECT_PATTERNS_API_URL` ||| Optional | Optional | Optional ||| http://localhost:3000 | API server URL |
1717
| `KV_REST_API_URL` || Optional || Optional | Optional ||| (disabled) | Vercel KV endpoint |
1818
| `KV_REST_API_TOKEN` || Optional || Optional | Optional ||| (disabled) | Vercel KV token |
19-
| `TIER_MODE` || Optional || Optional | Optional ||| "free" | User tier for testing |
2019
| `MCP_DEBUG` ||| Optional ||||| false | Enable MCP debug logs |
2120
| `MCP_ENV` ||| Optional ||||| "production" | MCP environment |
2221
| `DEBUG_TESTS` | Optional ||||||| false | Enable test debugging |
@@ -198,33 +197,6 @@ KV_REST_API_TOKEN=""
198197

199198
---
200199

201-
### Tier/Feature Configuration
202-
203-
#### `TIER_MODE`
204-
**Type:** Enum ("free" | "pro")
205-
**Required for:** None (optional)
206-
**Default:** "free"
207-
**Used by:** Routes, Integration, Workflow tests
208-
**Purpose:** Test different tier-based functionality
209-
210-
**Usage:**
211-
```bash
212-
# Test free tier features (default)
213-
bun run test:routes
214-
215-
# Test pro tier features
216-
TIER_MODE=pro bun run test:routes
217-
218-
# Test both
219-
TIER_MODE=free bun run test:routes && TIER_MODE=pro bun run test:routes
220-
```
221-
222-
**What's tested:**
223-
- Free tier: Limited to 3 recommendations, search-only
224-
- Pro tier: Full feature access, code generation
225-
226-
---
227-
228200
### Debug Configuration
229201

230202
#### `MCP_DEBUG`
@@ -321,7 +293,6 @@ Sets up common test environment variables.
321293
- `DATABASE_URL` - PostgreSQL connection
322294
- `KV_REST_API_URL` - Vercel KV (disabled if not set)
323295
- `KV_REST_API_TOKEN` - Vercel KV (disabled if not set)
324-
- `TIER_MODE` - Default to "free"
325296
- `PATTERN_API_KEY` - Optional, from environment
326297

327298
**Used by:**

packages/mcp-server/MCP-README.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ A Model Context Protocol (MCP) server that provides Effect-TS patterns, code ana
6262
| `PATTERN_API_KEY` | Authentication key | Required |
6363
| `PRODUCTION_API_KEY` | Production API key (for `mcp:production`) | Use `PATTERN_API_KEY` if unset |
6464
| `DATABASE_URL` | PostgreSQL connection | Auto-configured |
65-
| `TIER_MODE` | Service tier (`free`/`paid`) | `free` |
6665
| `NODE_ENV` | Environment mode | `development` |
6766

6867
### Claude Code Configuration
@@ -88,14 +87,14 @@ Set `PRODUCTION_API_KEY` via your environment or secrets.
8887

8988
### Available Tools
9089

91-
The MCP server exposes the free-tier tool surface only:
90+
The MCP server exposes the MCP tool surface only:
9291
- `search_patterns`
9392
- `get_pattern`
9493
- `list_analysis_rules`
9594
- `analyze_code`
9695
- `review_code`
9796

98-
Paid-tier features are available via the HTTP API only (not exposed as MCP tools).
97+
Additional analysis/refactoring endpoints are available via the HTTP API only (not exposed as MCP tools).
9998

10099
#### 🔍 `search_patterns`
101100

@@ -339,25 +338,14 @@ Create `.env.local`:
339338
```env
340339
PATTERN_API_KEY=dev-key
341340
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/effect_patterns
342-
TIER_MODE=free
343341
NODE_ENV=development
344342
```
345343

346-
## 📊 Service Tiers
344+
## 📊 Capability Model
347345

348-
### Free Tier (Default)
349-
350-
- **Code Review**: Top 3 architectural recommendations
351-
- **Pattern Search**: Full access to pattern library
352-
- **Analysis**: Basic rule-based analysis
353-
- **Rate Limit**: 100 requests per 15 minutes
354-
355-
### Pro Tier (Coming Soon)
356-
357-
- **Code Review**: Unlimited recommendations
358-
- **Enhanced Analysis**: AI-powered insights
359-
- **Custom Patterns**: Organization-specific patterns
360-
- **Priority Support**: Dedicated assistance
346+
- **MCP tool surface**: Pattern search, pattern retrieval, and analysis-rule catalog.
347+
- **HTTP API / CLI surface**: Analysis, review, refactoring, and generation endpoints.
348+
- **Operational limits**: Standard rate limits apply per API key.
361349

362350
## 🐛 Troubleshooting
363351

@@ -387,9 +375,9 @@ curl -H "x-api-key: YOUR_KEY" https://effect-patterns-mcp.vercel.app/api/pattern
387375

388376
#### Performance Issues
389377

390-
- Use free tier within rate limits
378+
- Use the standard rate limits for your API key
391379
- Optimize search queries with specific filters
392-
- Consider Pro tier for higher limits
380+
- Use direct HTTP API endpoints for non-MCP features
393381

394382
### Debug Mode
395383

packages/mcp-server/README-END-USER.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Never commit API keys; use environment variables or your IDE's secret storage.
128128

129129
---
130130

131-
## MCP Tools (Free Tier)
131+
## MCP Tools
132132

133133
The MCP server exposes **exactly five tools** in production and staging. No other tools (including code analysis or review) are available via MCP.
134134

@@ -178,6 +178,27 @@ No parameters.
178178
- "List all analysis rules."
179179
- "What rules does the analyzer use?"
180180

181+
---
182+
183+
### 4. `list_skills`
184+
185+
Search Effect-TS skills by query and optional category.
186+
187+
| Parameter | Type | Required | Description |
188+
|-----------|------|----------|-------------|
189+
| `q` | string | No | Search query string. |
190+
| `category` | string | No | Skill category filter. |
191+
| `limit` | number | No | Maximum results (1–100). |
192+
| `format` | string | No | `markdown`, `json`, or `both`. |
193+
194+
### 5. `get_skill`
195+
196+
Get full details for one skill by slug.
197+
198+
| Parameter | Type | Required | Description |
199+
|-----------|------|----------|-------------|
200+
| `slug` | string | Yes | Skill slug identifier. |
201+
181202
**Debug / local only:** The tool `get_mcp_config` is not part of the default production/staging surface; it only appears when `MCP_DEBUG=true` or `MCP_ENV=local`.
182203

183204
---
@@ -216,23 +237,25 @@ Get full details for a specific skill by slug, including full guidance content.
216237

217238
## HTTP API
218239

219-
When you use the **hosted** server, the MCP server forwards tool calls to the HTTP API for patterns and rules only. You can also call the API directly (e.g. from scripts or CI) with the same API key. **MCP tools do not call paid endpoints**analysis, review, refactoring, and generation are available only when using the HTTP API or paid CLI directly.
240+
When you use the **hosted** server, the MCP server forwards tool calls to the HTTP API for patterns and rules only. You can also call the API directly (e.g. from scripts or CI) with the same API key. **MCP tools do not call analysis/refactoring/generation endpoints**those are available only when using the HTTP API or CLI directly.
220241

221242
- **Auth:** `x-api-key: <PATTERN_API_KEY>` on requests (or query param in some setups).
222243
- **Base URLs:** Production: `https://effect-patterns-mcp.vercel.app`; Staging: `https://effect-patterns-mcp-staging.vercel.app`.
223244

224245
### Endpoints (summary)
225246

226-
**Free (used by MCP tools):**
247+
**Used by MCP tools:**
227248

228249
| Method | Path | Purpose |
229250
|--------|------|---------|
230251
| GET | `/api/health` | Health check (no auth). |
231252
| GET | `/api/patterns` | Search patterns (query params: `q`, `category`, `difficulty`, `limit`). |
232253
| GET | `/api/patterns/[id]` | Get pattern by ID. |
254+
| GET | `/api/skills` | List/search skills (`q`, `category`, `limit`). |
255+
| GET | `/api/skills/[slug]` | Get skill by slug. |
233256
| POST | `/api/list-rules` | List rules metadata (read-only catalog). |
234257

235-
**Paid (HTTP API / CLI only not exposed via MCP):**
258+
**HTTP API / CLI only (not exposed via MCP):**
236259

237260
| Method | Path | Purpose |
238261
|--------|------|---------|
@@ -248,10 +271,15 @@ Full request/response shapes: see [MCP Server API Reference](../../docs/mcp-serv
248271

249272
---
250273

251-
## Service Tiers
274+
## Capability Boundaries
252275

276+
<<<<<<< codex/pr-3-remove-tier-references
277+
- **MCP surface:** Patterns and rule catalog only — `search_patterns`, `get_pattern`, `list_analysis_rules`. Rate limits apply (e.g. 100 requests per 15 minutes per key). MCP does not call analysis/refactoring/generation endpoints.
278+
- **HTTP API / CLI surface:** Code analysis, code review, consistency analysis, apply refactoring, and generate pattern code.
279+
=======
253280
- **MCP (free):** Patterns, skills, and rule catalog — `search_patterns`, `get_pattern`, `list_analysis_rules`, `list_skills`, `get_skill`. Rate limits apply (e.g. 100 requests per 15 minutes per key). MCP cannot call paid endpoints.
254281
- **Paid (HTTP API / CLI only):** Code analysis, code review, consistency analysis, apply refactoring, generate pattern code, and higher limits. Use the HTTP API or paid CLI; these capabilities are not available via MCP.
282+
>>>>>>> main
255283
256284
---
257285

@@ -278,7 +306,7 @@ Full request/response shapes: see [MCP Server API Reference](../../docs/mcp-serv
278306

279307
- **Backend not running:** If using local API, ensure `bun run dev` is running in `packages/mcp-server` and the API is at `http://localhost:3000`.
280308
- **Wrong URL:** If using hosted, set `EFFECT_PATTERNS_API_URL` to `https://effect-patterns-mcp.vercel.app` (or staging).
281-
- **Auth:** 401/402 usually mean invalid or missing API key. Check the key and that it's passed to the process that runs the MCP server.
309+
- **Auth:** 401/403 usually mean invalid or missing API key. Check the key and that it's passed to the process that runs the MCP server.
282310

283311
### Debugging
284312

packages/mcp-server/README-LOCAL.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ Edit `.env` with your settings:
4343
# API Security - Generate a secure key
4444
PATTERN_API_KEY=your-secret-api-key-here
4545
46-
# Tier Configuration
47-
TIER_MODE=free # or "paid" for full features
48-
4946
# Database Connection
5047
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/effect_patterns
5148
@@ -105,49 +102,28 @@ The MCP server has two components:
105102

106103
### 1. HTTP API Server (port 3000)
107104

108-
Test tier validation:
105+
Test key endpoints:
109106

110107
```bash
111-
# Free tier - should return 402 for paid features
108+
# Generate code from a pattern
112109
curl -X POST http://localhost:3000/api/generate \
113110
-H "x-api-key: your-api-key" \
114111
-H "Content-Type: application/json" \
115112
-d '{"patternId": "use-pipe-for-composition", "name": "myFunction"}'
116113

117-
# Free tier features - should work
114+
# Pattern search
118115
curl http://localhost:3000/api/patterns \
119116
-H "x-api-key: your-api-key"
120117
```
121118

122-
## Tier Configuration
123-
124-
### Free Tier (Default)
125-
- **Available**: Pattern search, pattern retrieval
126-
- **Blocked**: Code generation, refactoring, advanced analysis
127-
- **MCP Tools**: `search_patterns`, `get_pattern`, `list_analysis_rules`, `analyze_code`, `review_code`
128-
129-
### Paid Tier
130-
- **Available**: All features
131-
- **MCP Tools**: Free-tier surface only (paid tools are HTTP API only)
132-
133-
Switch tiers by setting `TIER_MODE`:
134-
135-
```bash
136-
# Free tier
137-
TIER_MODE=free bun run dev
138-
139-
# Paid tier
140-
TIER_MODE=paid bun run dev
141-
```
142-
143119
## API Endpoints
144120

145-
### Free Tier Available
121+
### Core Endpoints
146122
- `GET /api/patterns` - List all patterns
147123
- `GET /api/patterns/[id]` - Get specific pattern
148124
- `GET /api/health` - Health check
149125

150-
### Paid Tier Only
126+
### Extended Endpoints
151127
- `POST /api/generate` - Generate code from pattern
152128
- `POST /api/generate-pattern` - Generate custom pattern
153129
- `POST /api/analyze-consistency` - Analyze code consistency
@@ -209,7 +185,6 @@ bun run build
209185

210186
| Variable | Default | Description |
211187
|----------|---------|-------------|
212-
| `TIER_MODE` | `free` | Server tier: `free` or `paid` |
213188
| `PORT` | `3000` | Server port |
214189
| `NODE_ENV` | `development` | Environment mode |
215190
| `DATABASE_URL` | - | PostgreSQL connection string |
@@ -221,11 +196,9 @@ bun run build
221196
1. **Start**: `bun run dev`
222197
2. **Test**: Use curl or API client to test endpoints
223198
3. **Debug**: Check server logs and error responses
224-
4. **Switch Tiers**: Change `TIER_MODE` and restart
225199

226200
## Next Steps
227201

228202
- Configure your IDE to use the MCP server
229-
- Test with different tier modes
230203
- Explore the API documentation
231204
- Contribute to the project!

packages/mcp-server/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ A comprehensive MCP 2.0 server and HTTP API for the Effect Patterns ecosystem, p
2828
- **Consistency Analysis**: Cross-file pattern consistency checking
2929
- **Enterprise Features**: Rate limiting, caching, metrics, tracing, and comprehensive logging
3030

31-
**Free Tier Features**: Pattern search, basic code analysis, and MCP tools
32-
**Paid Tier Features**: Advanced code generation, consistency analysis, and automated refactoring (HTTP API only)
31+
**MCP Tool Surface**: Pattern search and rule catalog
32+
**HTTP API / CLI Surface**: Code analysis, generation, consistency analysis, and automated refactoring
3333

3434
## 📋 MCP Tools Available
3535

@@ -413,7 +413,7 @@ guidance (low severity).
413413
}
414414
```
415415

416-
#### Review Code (Free Tier)
416+
#### Review Code
417417

418418
```http
419419
POST /api/review-code
@@ -428,7 +428,7 @@ Content-Type: application/json
428428
Get high-fidelity architectural recommendations for Effect codebases.
429429
Returns the top 3 highest-priority issues with actionable guidance.
430430

431-
**Free Tier Features:**
431+
**Response Characteristics:**
432432

433433
- Top 3 recommendations per request (sorted by severity, then line number)
434434
- Unlimited queries
@@ -482,7 +482,7 @@ Returns the top 3 highest-priority issues with actionable guidance.
482482
}
483483
```
484484

485-
#### Analyze Consistency (Pro Tier)
485+
#### Analyze Consistency
486486

487487
```http
488488
POST /api/analyze-consistency
@@ -521,7 +521,7 @@ Detect code inconsistencies across multiple files.
521521
}
522522
```
523523

524-
#### Apply Refactoring (Pro Tier)
524+
#### Apply Refactoring
525525

526526
```http
527527
POST /api/apply-refactoring
@@ -860,7 +860,7 @@ sequenceDiagram
860860
MCP->>Response: Build rich response
861861
Response->>API: Formatted findings
862862
API->>Client: Analysis report
863-
%% Code Review Flow (Pro Tier)
863+
%% Code Review Flow
864864
Client->>API: POST /api/review-code
865865
Note over API: API Key Auth
866866
API->>Services: ReviewCodeService.review()
@@ -869,7 +869,7 @@ sequenceDiagram
869869
Services->>DB: Store review metrics
870870
Services->>API: Top 3 issues + capability message
871871
API->>Client: Review results
872-
%% Refactoring Flow (Pro Tier)
872+
%% Refactoring Flow
873873
Client->>API: POST /api/apply-refactoring
874874
API->>Services: RefactoringEngineService.apply()
875875
Services->>Analysis: AST transformation

packages/mcp-server/TESTING_GUIDE.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ DATABASE_URL="postgres://user:password@localhost:5432/test_db"
184184
# Optional - disables Vercel KV
185185
KV_REST_API_URL=""
186186
KV_REST_API_TOKEN=""
187-
188-
# Optional - test tier mode
189-
TIER_MODE=free # or 'pro'
190187
```
191188

192189
#### MCP Tests (vitest.mcp.config.ts)

0 commit comments

Comments
 (0)